28 realspace_grid_desc_type,&
32 #include "../base/base_uses.f90"
37 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
38 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'pw_env_types'
71 INTEGER :: ref_count = -1
72 INTEGER :: auxbas_grid = 0
73 TYPE(pw_pool_p_type),
DIMENSION(:),
POINTER :: pw_pools => null()
74 TYPE(pw_pool_type),
POINTER :: xc_pw_pool => null()
75 TYPE(pw_pool_type),
POINTER :: vdw_pw_pool => null()
76 TYPE(realspace_grid_desc_p_type), &
77 DIMENSION(:),
POINTER :: rs_descs => null()
78 TYPE(realspace_grid_type), &
79 DIMENSION(:),
POINTER :: rs_grids => null()
80 TYPE(gridlevel_info_type),
POINTER :: gridlevel_info => null()
81 TYPE(cube_info_type),
DIMENSION(:),
POINTER :: cube_info => null()
82 TYPE(pw_poisson_type),
POINTER :: poisson_env => null()
83 TYPE(section_vals_type),
POINTER :: interp_section => null()
85 REAL(KIND=
dp),
DIMENSION(3, 3) :: cell_hmat = -1.0_dp
110 SUBROUTINE pw_env_get(pw_env, pw_pools, cube_info, gridlevel_info, &
111 auxbas_pw_pool, auxbas_grid, auxbas_rs_desc, auxbas_rs_grid, rs_descs, rs_grids, &
112 xc_pw_pool, vdw_pw_pool, poisson_env, interp_section)
113 TYPE(pw_env_type),
INTENT(IN) :: pw_env
114 TYPE(pw_pool_p_type),
DIMENSION(:),
OPTIONAL, &
116 TYPE(cube_info_type),
DIMENSION(:),
OPTIONAL, &
118 TYPE(gridlevel_info_type),
OPTIONAL,
POINTER :: gridlevel_info
119 TYPE(pw_pool_type),
OPTIONAL,
POINTER :: auxbas_pw_pool
120 INTEGER,
INTENT(out),
OPTIONAL :: auxbas_grid
121 TYPE(realspace_grid_desc_type),
OPTIONAL,
POINTER :: auxbas_rs_desc
122 TYPE(realspace_grid_type),
OPTIONAL,
POINTER :: auxbas_rs_grid
123 TYPE(realspace_grid_desc_p_type),
DIMENSION(:), &
124 OPTIONAL,
POINTER :: rs_descs
125 TYPE(realspace_grid_type),
DIMENSION(:), &
126 OPTIONAL,
POINTER :: rs_grids
127 TYPE(pw_pool_type),
OPTIONAL,
POINTER :: xc_pw_pool, vdw_pw_pool
128 TYPE(pw_poisson_type),
OPTIONAL,
POINTER :: poisson_env
129 TYPE(section_vals_type),
OPTIONAL,
POINTER :: interp_section
131 cpassert(pw_env%ref_count > 0)
132 IF (
PRESENT(pw_pools)) pw_pools => pw_env%pw_pools
133 IF (
PRESENT(rs_descs)) rs_descs => pw_env%rs_descs
134 IF (
PRESENT(rs_grids)) rs_grids => pw_env%rs_grids
135 IF (
PRESENT(cube_info)) cube_info => pw_env%cube_info
136 IF (
PRESENT(gridlevel_info)) gridlevel_info => pw_env%gridlevel_info
137 IF (
PRESENT(auxbas_pw_pool))
THEN
138 auxbas_pw_pool => pw_env%pw_pools(pw_env%auxbas_grid)%pool
140 IF (
PRESENT(auxbas_rs_desc))
THEN
141 auxbas_rs_desc => pw_env%rs_descs(pw_env%auxbas_grid)%rs_desc
143 IF (
PRESENT(auxbas_rs_grid))
THEN
144 auxbas_rs_grid => pw_env%rs_grids(pw_env%auxbas_grid)
146 IF (
PRESENT(auxbas_grid)) auxbas_grid = pw_env%auxbas_grid
147 IF (
PRESENT(xc_pw_pool)) xc_pw_pool => pw_env%xc_pw_pool
148 IF (
PRESENT(vdw_pw_pool)) vdw_pw_pool => pw_env%vdw_pw_pool
149 IF (
PRESENT(poisson_env)) poisson_env => pw_env%poisson_env
150 IF (
PRESENT(interp_section)) interp_section => pw_env%interp_section
161 TYPE(pw_env_type),
INTENT(INOUT) :: pw_env
163 cpassert(pw_env%ref_count > 0)
164 pw_env%ref_count = pw_env%ref_count + 1
176 TYPE(pw_env_type),
POINTER :: pw_env
177 TYPE(mp_para_env_type),
INTENT(IN),
OPTIONAL :: para_env
179 INTEGER :: i, igrid_level
181 IF (
ASSOCIATED(pw_env))
THEN
182 cpassert(pw_env%ref_count > 0)
183 pw_env%ref_count = pw_env%ref_count - 1
184 IF (pw_env%ref_count < 1)
THEN
185 IF (
ASSOCIATED(pw_env%poisson_env))
THEN
186 CALL pw_env%poisson_env%release()
187 DEALLOCATE (pw_env%poisson_env)
190 IF (
ASSOCIATED(pw_env%gridlevel_info))
THEN
192 DEALLOCATE (pw_env%gridlevel_info)
194 IF (
ASSOCIATED(pw_env%cube_info))
THEN
195 DO igrid_level = 1,
SIZE(pw_env%cube_info)
198 DEALLOCATE (pw_env%cube_info)
202 IF (
ASSOCIATED(pw_env%rs_descs))
THEN
203 DO i = 1,
SIZE(pw_env%rs_descs)
206 DEALLOCATE (pw_env%rs_descs)
208 IF (
ASSOCIATED(pw_env%rs_grids))
THEN
209 DO i = 1,
SIZE(pw_env%rs_grids)
212 DEALLOCATE (pw_env%rs_grids)
for a given dr()/dh(r) this will provide the bounds to be used if one wants to go over a sphere-subre...
subroutine, public destroy_cube_info(info)
...
subroutine, public destroy_gaussian_gridlevel(gridlevel_info, para_env)
...
Defines the basic variable types.
integer, parameter, public dp
Interface to the message passing library MPI.
container for various plainwaves related things
subroutine, public pw_env_retain(pw_env)
retains the pw_env (see doc/ReferenceCounting.html)
subroutine, public pw_env_release(pw_env, para_env)
releases the given pw_env (see doc/ReferenceCounting.html)
subroutine, public pw_env_get(pw_env, pw_pools, cube_info, gridlevel_info, auxbas_pw_pool, auxbas_grid, auxbas_rs_desc, auxbas_rs_grid, rs_descs, rs_grids, xc_pw_pool, vdw_pw_pool, poisson_env, interp_section)
returns the various attributes of the pw env
functions related to the poisson solver on regular grids
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
subroutine, public pw_pools_dealloc(pools)
deallocates the given pools (releasing each of the underlying pools)
subroutine, public pw_pool_release(pool)
releases the given pool (see cp2k/doc/ReferenceCounting.html)
subroutine, public rs_grid_release_descriptor(rs_desc)
releases the given rs grid descriptor (see doc/ReferenceCounting.html)
subroutine, public rs_grid_release(rs_grid)
releases the given rs grid (see doc/ReferenceCounting.html)