22 ewald_environment_type
36 pw_poisson_parameter_type,&
40 #include "./base/base_uses.f90"
46 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'ewald_pw_methods'
62 TYPE(ewald_pw_type),
POINTER :: ewald_pw
63 TYPE(ewald_environment_type),
POINTER :: ewald_env
64 REAL(kind=
dp),
DIMENSION(3, 3) :: cell_hmat
66 INTEGER :: ewald_type, o_spline
68 REAL(kind=
dp),
DIMENSION(3, 3) :: old_cell_hmat
70 TYPE(pw_poisson_parameter_type) :: poisson_params
71 TYPE(pw_poisson_type),
POINTER :: poisson_env
72 TYPE(pw_pool_p_type),
DIMENSION(:),
POINTER :: pw_pools
73 TYPE(pw_pool_type),
POINTER :: pw_big_pool, pw_small_pool
74 TYPE(section_vals_type),
POINTER :: poisson_section
77 NULLIFY (pw_small_pool)
78 NULLIFY (dg, poisson_env, poisson_section)
81 alpha=alpha, o_spline=o_spline, &
82 poisson_section=poisson_section, &
83 cell_hmat=old_cell_hmat)
85 IF (all(cell_hmat == old_cell_hmat))
RETURN
89 SELECT CASE (ewald_type)
92 dg=dg, poisson_env=poisson_env)
94 CALL ewald_pw_rho0_setup(ewald_env, pw_big_pool%pw_grid, dg)
95 IF (
ASSOCIATED(poisson_env))
THEN
96 CALL poisson_env%release()
97 DEALLOCATE (poisson_env)
101 poisson_env=poisson_env)
104 pw_small_pool=pw_small_pool, dg=dg, &
105 poisson_env=poisson_env)
106 IF (.NOT.
ASSOCIATED(poisson_env))
THEN
107 ALLOCATE (poisson_env)
108 CALL poisson_env%create()
112 CALL dg_grid_change(cell_hmat, pw_big_pool%pw_grid, pw_small_pool%pw_grid)
113 CALL ewald_pw_rho0_setup(ewald_env, pw_small_pool%pw_grid, dg)
115 pw_small_pool=pw_small_pool, &
116 poisson_env=poisson_env)
119 poisson_env=poisson_env)
120 IF (.NOT.
ASSOCIATED(poisson_env))
THEN
121 ALLOCATE (poisson_env)
122 CALL poisson_env%create()
126 poisson_env=poisson_env)
131 IF (
ASSOCIATED(poisson_env))
THEN
132 ALLOCATE (pw_pools(1))
133 pw_pools(1)%pool => pw_big_pool
135 poisson_params%ewald_type = ewald_type
136 poisson_params%ewald_o_spline = o_spline
137 poisson_params%ewald_alpha = alpha
138 CALL pw_poisson_set(poisson_env, cell_hmat=cell_hmat, parameters=poisson_params, &
139 use_level=1, pw_pools=pw_pools)
140 DEALLOCATE (pw_pools)
154 SUBROUTINE ewald_pw_rho0_setup(ewald_env, pw_grid, dg)
155 TYPE(ewald_environment_type),
POINTER :: ewald_env
156 TYPE(pw_grid_type),
POINTER :: pw_grid
159 INTEGER :: ewald_type
161 REAL(
dp),
POINTER :: gcc(:), zet(:)
162 TYPE(dg_rho0_type),
POINTER :: dg_rho0
164 CALL ewald_env_get(ewald_env, alpha=alpha, ewald_type=ewald_type)
165 CALL dg_get(dg, dg_rho0=dg_rho0)
168 IF (.NOT.
ASSOCIATED(zet))
THEN
176 CALL dg_rho0_set(dg_rho0, type=ewald_type, zet=zet)
180 END SUBROUTINE ewald_pw_rho0_setup
subroutine, public dg_rho0_init(dg_rho0, pw_grid)
...
subroutine, public dg_rho0_get(dg_rho0, cutoff_radius, TYPE, grid, kind, gcc, zet, density)
Get the dg_rho0_type.
subroutine, public dg_rho0_set(dg_rho0, TYPE, grid, kind, cutoff_radius, gcc, zet, density)
Set the dg_rho0_type.
subroutine, public dg_get(dg, dg_rho0)
Get the dg_type.
subroutine, public dg_grid_change(b_cell_hmat, grid_b, grid_s)
...
subroutine, public ewald_env_set(ewald_env, ewald_type, alpha, epsilon, eps_pol, gmax, ns_max, precs, o_spline, para_env, poisson_section, interaction_cutoffs, cell_hmat)
Purpose: Set the EWALD environment.
subroutine, public ewald_env_get(ewald_env, ewald_type, alpha, eps_pol, epsilon, gmax, ns_max, o_spline, group, para_env, poisson_section, precs, rcut, do_multipoles, max_multipole, do_ipol, max_ipol_iter, interaction_cutoffs, cell_hmat)
Purpose: Get the EWALD environment.
subroutine, public ewald_pw_grid_update(ewald_pw, ewald_env, cell_hmat)
Rescales pw_grids for given box, if necessary.
subroutine, public ewald_pw_set(ewald_pw, pw_big_pool, pw_small_pool, rs_desc, dg, poisson_env)
set the ewald_pw environment to the correct program.
subroutine, public ewald_pw_get(ewald_pw, pw_big_pool, pw_small_pool, rs_desc, poisson_env, dg)
get the ewald_pw environment to the correct program.
Defines the basic variable types.
integer, parameter, public dp
This module defines the grid data type and some basic operations on it.
subroutine, public pw_grid_change(cell_hmat, pw_grid)
Recalculate the g-vectors after a change of the box.
subroutine, public pw_poisson_set(poisson_env, cell_hmat, parameters, pw_pools, use_level, mt_super_ref_pw_grid, dct_pw_grid, force_rebuild)
sets cell, grids and parameters used by the poisson solver You should call this at least once (and se...
functions related to the poisson solver on regular grids
integer, parameter, public do_ewald_pme
integer, parameter, public do_ewald_ewald
integer, parameter, public do_ewald_none
integer, parameter, public do_ewald_spme
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...