3 #include "sll_memory.h"
4 #include "sll_working_precision.h"
31 sll_int32,
intent(in) :: n_points
32 sll_real64,
dimension(:, :) ::points
36 x = 2._f64*
sll_p_pi*real(i, f64)/(real(n_points, f64))
39 points(3, i) = 1._f64/real(n_points, f64)
45 sll_real64,
dimension(:, :),
intent(out)::f
46 sll_int32,
intent(in)::n(2), mode(2)
47 sll_real64,
intent(in)::eta_min(2), eta_max(2)
49 sll_real64::eta(2), delta_eta(2), kmode, val
52 delta_eta(1) = (eta_max(1) - eta_min(1))/real(n(1), f64)
53 delta_eta(2) = (eta_max(2) - eta_min(2))/real(n(2), f64)
55 kmode = real(mode(2), f64)*(2._f64*
sll_p_pi)/(eta_max(2) - eta_min(2))
58 eta(2) = eta_min(2) + real(j - 1, f64)*delta_eta(2)
60 eta(1) = eta_min(1) + real(i - 1, f64)*delta_eta(1)
61 eta(1) = val*eta(1)/eta_max(1)
71 sll_real64,
intent(in)::eta_min, eta_max
72 sll_int32,
intent(in)::mode(2)
73 sll_real64,
intent(out)::val
74 sll_real64::alpha, tmp
75 sll_int32::mode_max(2), i, j
78 INQUIRE (file=
"zeros_bessel.txt", exist=is_file)
79 if ((is_file) .eqv. (.false.))
then
80 print *,
'#file zeros_bessel.txt does not exist'
83 open (27, file=
'zeros_bessel.txt', action=
"read")
84 read (27, *) mode_max(1), mode_max(2), alpha
86 if ((mode(1) < 1) .or. (mode(1) > mode_max(1)))
then
87 print *,
'#bad value of mode(1) vs mode_max(1)', mode(1), mode_max(1)
90 if ((mode(2) < 0) .or. (mode(2) > mode_max(2)))
then
91 print *,
'#bad value of mode(2) vs mode_max(2)', mode(2), mode_max(2)
94 if (abs(alpha - eta_min/eta_max) > 1.e-12)
then
95 print *,
'#bad value of rmin/rmax w.r.t zeros_bessel.txt', eta_min/eta_max, alpha
98 open (27, file=
'zeros_bessel.txt', action=
"read")
99 read (27, *) mode_max(1), mode_max(2), alpha
100 read (27, *) i, j, tmp
101 do while ((i .ne. mode(1)) .or. (j .ne. mode(2)))
102 read (27, *) i, j, tmp
116 quadrature_points_per_cell)
117 character(len=256),
intent(in) :: quadrature_case
118 sll_real64,
dimension(:),
intent(out) :: mu_points
119 sll_real64,
dimension(:),
intent(out) :: mu_weights
120 sll_int32,
intent(in) :: n_mu
121 sll_real64,
intent(in) :: mu_min
122 sll_real64,
intent(in) :: mu_max
123 sll_int32,
intent(in) :: quadrature_points_per_cell
126 sll_int32 :: num_cells
128 select case (quadrature_case)
129 case (
"SLL_RECTANGLE")
131 mu_points(i) = mu_min + real(i - 1, f64)*(mu_max - mu_min)/real(n_mu, f64)
132 mu_weights(i) = (mu_max - mu_min)/real(n_mu, f64)*exp(-mu_points(i))
135 mu_weights(1) = 1._f64
137 case (
"SLL_GAUSS_LOBATTO")
138 num_cells = n_mu/quadrature_points_per_cell
139 mu_points(1:n_mu) = mu_max
140 mu_weights(1:n_mu) = 0._f64
143 mu_points(s:s + quadrature_points_per_cell - 1) = &
145 quadrature_points_per_cell, &
146 mu_min + real(i - 1, f64)/real(num_cells, f64)*(mu_max - mu_min), &
147 mu_min + real(i, f64)/real(num_cells, f64)*(mu_max - mu_min))
148 mu_weights(s:s + quadrature_points_per_cell - 1) = &
150 quadrature_points_per_cell, &
151 mu_min + real(i - 1, f64)/real(num_cells, f64)*(mu_max - mu_min), &
152 mu_min + real(i, f64)/real(num_cells, f64)*(mu_max - mu_min))
153 s = s + quadrature_points_per_cell
158 mu_weights(i) = mu_weights(i)*exp(-mu_points(i))
160 case (
"SLL_GAUSS_LEGENDRE")
161 num_cells = n_mu/quadrature_points_per_cell
162 mu_points(1:n_mu) = mu_max
163 mu_weights(1:n_mu) = 0._f64
166 mu_points(s:s + quadrature_points_per_cell - 1) = &
168 quadrature_points_per_cell, &
169 mu_min + real(i - 1, f64)/real(num_cells, f64)*(mu_max - mu_min), &
170 mu_min + real(i, f64)/real(num_cells, f64)*(mu_max - mu_min))
171 mu_weights(s:s + quadrature_points_per_cell - 1) = &
173 quadrature_points_per_cell, &
174 mu_min + real(i - 1, f64)/real(num_cells, f64)*(mu_max - mu_min), &
175 mu_min + real(i, f64)/real(num_cells, f64)*(mu_max - mu_min))
176 s = s + quadrature_points_per_cell
181 mu_weights(i) = mu_weights(i)*exp(-mu_points(i))
184 print *,
'#bad quadrature_case', trim(quadrature_case)
185 print *,
'#not implemented'
186 print *,
'#in sll_s_compute_mu'
187 print *,
'#at line and file:', __line__, __file__
Fortran module where set some physical and mathematical constants.
real(kind=f64), parameter, public sll_p_pi
Gauss-Legendre integration.
real(kind=f64) function, dimension(1:npoints), public sll_f_gauss_legendre_points(npoints, a, b)
real(kind=f64) function, dimension(1:npoints), public sll_f_gauss_legendre_weights(npoints, a, b)
Gauss-Lobatto integration.
real(kind=f64) function, dimension(n), public sll_f_gauss_lobatto_points(n, a, b)
Returns a 1d array of size (n) containing gauss-lobatto points in the interval [a,...
real(kind=f64) function, dimension(n), public sll_f_gauss_lobatto_weights(n, a, b)
Returns a 1d array of size (n) containing gauss-lobatto weights in the interval [a,...
subroutine, public sll_s_compute_init_f_polar(f, mode, N, eta_min, eta_max)
subroutine, public sll_s_compute_shape_circle(points, N_points)
subroutine, public sll_s_zero_bessel_dir_dir(mode, eta_min, eta_max, val)
subroutine, public sll_s_compute_mu(quadrature_case, mu_points, mu_weights, N_mu, mu_min, mu_max, quadrature_points_per_cell)