32#include "../base/base_uses.f90"
37 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
38 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'xc_derivative_set_types'
49 TYPE(pw_pool_type),
POINTER,
PRIVATE :: pw_pool => null()
67 INTEGER,
DIMENSION(:),
INTENT(in) :: description
68 LOGICAL,
INTENT(in),
OPTIONAL :: allocate_deriv
71 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: std_deriv_desc
72 LOGICAL :: my_allocate_deriv
73 REAL(kind=
dp),
CONTIGUOUS,
DIMENSION(:, :, :), &
78 NULLIFY (pos, deriv_att, r3d_ptr)
80 my_allocate_deriv = .false.
81 IF (
PRESENT(allocate_deriv)) my_allocate_deriv = allocate_deriv
84 pos => derivative_set%derivs
86 IF (
SIZE(deriv_att%split_desc) ==
SIZE(std_deriv_desc))
THEN
87 IF (all(deriv_att%split_desc == std_deriv_desc))
THEN
93 IF (.NOT.
ASSOCIATED(res) .AND. my_allocate_deriv)
THEN
94 CALL derivative_set%pw_pool%create_cr3d(r3d_ptr)
114 INTEGER,
DIMENSION(2, 3),
INTENT(IN),
OPTIONAL :: local_bounds
120 IF (
PRESENT(pw_pool))
THEN
121 derivative_set%pw_pool => pw_pool
122 CALL pw_pool%retain()
123 IF (
PRESENT(local_bounds))
THEN
124 IF (any(pw_pool%pw_grid%bounds_local /= local_bounds)) &
125 cpabort(
"incompatible local_bounds and pw_pool")
129 cpassert(
PRESENT(local_bounds))
148 NULLIFY (deriv_att, pos)
150 pos => derivative_set%derivs
153 DEALLOCATE (deriv_att)
156 IF (
ASSOCIATED(derivative_set%pw_pool))
CALL pw_pool_release(derivative_set%pw_pool)
171 NULLIFY (pos, deriv_att)
173 IF (
ASSOCIATED(deriv_set%derivs))
THEN
174 pos => deriv_set%derivs
176 deriv_att%deriv_data = 0.0_dp
193 INTEGER,
DIMENSION(:),
INTENT(IN) :: description
196 TYPE(
pw_pool_type),
INTENT(IN),
OPTIONAL,
POINTER :: pw_pool
201 IF (
ASSOCIATED(deriv_att))
THEN
202 CALL pw%create(pw_grid=pw_grid, array_ptr=deriv_att%deriv_data)
203 NULLIFY (deriv_att%deriv_data)
204 ELSE IF (
PRESENT(pw_pool))
THEN
205 CALL pw_pool%create_pw(pw)
logical function, public cp_sll_xc_deriv_next(iterator, el_att)
returns true if the actual element is valid (i.e. iterator ont at end) moves the iterator to the next...
subroutine, public cp_sll_xc_deriv_dealloc(sll)
deallocates the singly linked list starting at sll. Does not work if loops are present!
subroutine, public cp_sll_xc_deriv_insert_el(sll, el)
insert an element at the beginning of the list
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_release(pw_grid)
releases the given pw grid
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
subroutine, public pw_pool_release(pool)
releases the given pool (see cp2k/doc/ReferenceCounting.html)
subroutine, public pw_pool_create(pool, pw_grid, max_cache)
creates a pool for pw
Module with functions to handle derivative descriptors. derivative description are strings have the f...
subroutine, public standardize_desc(desc, split_desc)
...
represent a group ofunctional derivatives
subroutine, public xc_dset_zero_all(deriv_set)
...
subroutine, public xc_dset_recover_pw(deriv_set, description, pw, pw_grid, pw_pool)
Recovers a derivative on a pw_r3d_rs_type, the caller is responsible to release the grid later If the...
type(xc_derivative_type) function, pointer, public xc_dset_get_derivative(derivative_set, description, allocate_deriv)
returns the requested xc_derivative
subroutine, public xc_dset_release(derivative_set)
releases a derivative set
subroutine, public xc_dset_create(derivative_set, pw_pool, local_bounds)
creates a derivative set object
Provides types for the management of the xc-functionals and their derivatives.
subroutine, public xc_derivative_release(derivative, pw_pool)
allocates and initializes a derivative type
subroutine, public xc_derivative_create(derivative, desc, r3d_ptr)
allocates and initializes a derivative type
represent a single linked list that stores pointers to the elements
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
A derivative set contains the different derivatives of a xc-functional in form of a linked list.
represent a derivative of a functional