16 real(kind=double),
allocatable :: coeff1d(:)
21 real(kind=double),
allocatable :: coord_ab(:)
24 real(kind=double),
allocatable :: weight1d(:)
27 real(kind=double),
allocatable :: weight_ab(:)
31 real(kind=double),
allocatable :: coord_cell(:, :)
35 real(kind=double),
allocatable :: weight_cell(:, :)
38 real(kind=double),
allocatable :: weight2d(:)
65 class(
gaussq),
intent(inout) :: this
66 integer,
intent(in) :: lun_err
67 integer,
intent(in) :: ngauss
75 this%coeff1d(ngauss), &
76 this%coord_ab(ngauss), &
77 this%weight1d(ngauss), &
78 this%weight_ab(ngauss), &
79 this%coord_cell(ngauss, 2), &
80 this%weight_cell(ngauss, 2), &
81 this%weight2d(ngauss**2), &
84 ' member coeff1d, points1d, weight1d, weight2d ', res)
86 call gaussquad(lun_err, ngauss, this%coeff1d, this%weight1d)
92 this%weight2d(m) = this%weight1d(i)*this%weight1d(j)
98 subroutine gaussquad(lun_err, ngauss, coefcoord, weight)
100 integer,
intent(in) :: lun_err
101 integer,
intent(in) :: ngauss
102 real(kind=double),
intent(out) :: coefcoord(ngauss)
103 real(kind=double),
intent(out) :: weight(ngauss)
105 integer :: info, lwork, j
108 real(kind=double),
allocatable :: u(:)
109 real(kind=double),
allocatable :: work(:)
110 real(kind=double),
allocatable :: a(:, :)
119 ' local array u, work, A', res)
123 a(j, j + 1) = j/sqrt(4.0d0*j**2 - one)
126 call dsyev(
'V',
'U', ngauss, a, ngauss, coefcoord, work, lwork, info)
127 weight(:) = 2*a(1, :)**2
128 deallocate (u, work, a, stat=res)
130 ' local array u, work, A', res)
144 class(
gaussq),
intent(inout) :: this
145 integer,
intent(in) :: lun_err
161 ' member coeff1d, weight1d, weight2d', res)
172 class(
gaussq),
intent(in) :: this
173 integer,
intent(in) :: lun_out
177 write (lun_out, *)
'Nmb of Gauss points = ', this%ngauss
178 do i = 1, this%ngauss
179 write (lun_out, *)
'Gauss coeff1d, weight1d = ', &
180 this%coeff1d(i), this%weight1d(i)
195 class(
gaussq),
intent(inout) :: this
196 real(double),
intent(in) :: a, b
198 this%coord_ab(:) = onehalf*((b - a)*this%coeff1d(:) + (a + b))
199 this%weight_ab(:) = onehalf*(b - a)*this%weight1d(:)
216 class(
gaussq),
intent(inout) :: this
217 real(double),
intent(in) :: ax, bx, ay, by
219 this%coord_cell(:, 1) = onehalf*((bx - ax)*this%coeff1d(:) + (ax + bx))
220 this%coord_cell(:, 2) = onehalf*((by - ay)*this%coeff1d(:) + (ay + by))
222 this%weight_cell(:, 1) = onehalf*(bx - ax)*this%weight1d(:)
223 this%weight_cell(:, 2) = onehalf*(by - ay)*this%weight1d(:)
subroutine gaussquad(lun_err, ngauss, coefcoord, weight)
Module for computation of 1d and tensorized 2d Gauss points.
subroutine info_gaussq(this, lun_out)
Info procedure for gaussquadrature::gaussq.
subroutine init_gaussq(this, lun_err, ngauss)
Static constructor for gaussquadrature::gaussq.
subroutine on_interval(this, a, b)
Compute Gauss points on the interval .
subroutine on_cell(this, ax, bx, ay, by)
Compute Gauss points of .
subroutine kill_gaussq(this, lun_err)
Static destructor for gaussquadrature::gaussq.
integer, parameter err_alloc
Error allocation failed.
integer, parameter err_dealloc
Error deallocation failed.
logical function ioerr(lun, errno, call_proc, add_msg, add_int)
Handle and write alert I/O warnings and errors.