24 #include "sll_assert.h"
25 #include "sll_memory.h"
26 #include "sll_working_precision.h"
27 #include "sll_errors.h"
49 sll_real64 :: eta1_min
50 sll_real64 :: eta1_max
51 sll_real64,
dimension(:),
pointer :: wsave
52 sll_real64,
dimension(:),
pointer :: work
60 procedure, pass(poisson) :: init => &
62 procedure, pass(poisson) :: compute_phi_from_rho => &
64 procedure, pass(poisson) :: compute_e_from_rho => &
91 sll_int32,
intent(in) :: nc_eta1
92 sll_int32,
intent(out) :: error
93 sll_real64,
intent(in) :: eta1_min
94 sll_real64,
intent(in) :: eta1_max
96 sll_allocate(self, error)
105 sll_int32,
intent(in) :: nc_eta1
106 sll_int32,
intent(out) :: error
107 sll_real64,
intent(in) :: eta1_min
108 sll_real64,
intent(in) :: eta1_max
112 self%nc_eta1 = nc_eta1
113 self%eta1_min = eta1_min
114 self%eta1_max = eta1_max
116 sll_allocate(self%wsave(2*self%nc_eta1 + 15), error)
118 call dffti(self%nc_eta1, self%wsave)
121 sll_allocate(self%work(nc_eta1 + 1), error)
128 sll_real64,
dimension(:),
intent(out) :: field
129 sll_real64,
dimension(:),
intent(in) :: rhs
131 sll_real64 :: kx0, kx, k2
136 sll_assert(
size(field) == self%nc_eta1 + 1)
137 sll_assert(
size(rhs) == self%nc_eta1 + 1)
144 call dfftf(self%nc_eta1, self%work, self%wsave)
146 self%work = self%work/real(self%nc_eta1, f64)
148 kx0 = 2_f64*
sll_p_pi/(self%eta1_max - self%eta1_min)
155 do ik = 1, (self%nc_eta1 - 2)/2
156 kx = real(ik, f64)*kx0
158 field(2*ik) = kx/k2*self%work(2*ik + 1)
159 field(2*ik + 1) = -kx/k2*self%work(2*ik)
160 self%work(2*ik) = 1.0_f64/k2*self%work(2*ik)
161 self%work(2*ik + 1) = 1.0_f64/k2*self%work(2*ik + 1)
164 field(self%nc_eta1) = 0.0_f64
168 call dfftb(self%nc_eta1, field, self%wsave)
171 field(self%nc_eta1 + 1) = field(1)
182 sll_real64,
intent(in) :: eta1_min
183 sll_real64,
intent(in) :: eta1_max
184 sll_int32,
intent(in) :: nc_eta1
187 sll_allocate(poisson, ierr)
201 sll_real64,
intent(in) :: eta1_min
202 sll_real64,
intent(in) :: eta1_max
203 sll_int32,
intent(in) :: nc_eta1
213 sll_real64,
dimension(:),
intent(in) :: rho
214 sll_real64,
dimension(:),
intent(out) :: phi
216 sll_error(
'compute_phi_from_rho_1d_periodic',
'not implemented yet')
223 sll_real64,
dimension(:),
intent(in) :: rho
224 sll_real64,
dimension(:),
intent(out) :: e
sll_o_initialize a sll_o_new poisson solver on 1d mesh
Create a sll_o_new poisson solver on 1d mesh.
sll_o_solve the Poisson equation on 1d mesh and compute the potential
Fortran module where set some physical and mathematical constants.
real(kind=f64), parameter, public sll_p_pi
Module interface to solve Poisson equation in 1D.
Module to sll_o_solve Poisson equation on one dimensional mesh using FFT transform.
subroutine solve_poisson_1d_periodic(self, field, rhs)
type(sll_c_poisson_1d_periodic) function, pointer, public sll_f_new_poisson_1d_periodic(eta1_min, eta1_max, nc_eta1)
subroutine compute_e_from_rho_1d_periodic(poisson, E, rho)
type(sll_t_poisson_1d_periodic) function, pointer new_poisson_1d_periodic(eta1_min, eta1_max, nc_eta1, error)
Create a sll_o_new solver.
subroutine initialize_poisson_1d_periodic(self, eta1_min, eta1_max, nc_eta1, error)
sll_o_initialize the solver
subroutine compute_phi_from_rho_1d_periodic(poisson, phi, rho)
subroutine initialize_poisson_1d_periodic_wrapper(poisson, eta1_min, eta1_max, nc_eta1)