(git:744416f)
Loading...
Searching...
No Matches
qs_kernel_types.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
13 USE hfx_types, ONLY: hfx_release,&
16 USE kinds, ONLY: dp
19 USE qs_rho_types, ONLY: qs_rho_release,&
26#include "./base/base_uses.f90"
27
28 IMPLICIT NONE
29
30 PRIVATE
31
32 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_kernel_types'
33
34 LOGICAL, PARAMETER, PRIVATE :: debug_this_module = .false.
35 ! number of first derivative components (3: d/dx, d/dy, d/dz)
36 INTEGER, PARAMETER, PRIVATE :: nderivs = 3
37 INTEGER, PARAMETER, PRIVATE :: maxspins = 2
38
40 PUBLIC :: release_kernel_env
41
42! **************************************************************************************************
43!> \brief Collection of variables required to evaluate adiabatic TDDFPT kernel.
44!> \par History
45!> * 12.2016 created [Sergey Chulkov]
46! **************************************************************************************************
48 ! ground state electron density
49 TYPE(xc_rho_set_type), POINTER :: xc_rho_set => null()
50 TYPE(qs_rho_type), POINTER :: rho0_struct => null()
51 ! response density
52 TYPE(xc_rho_set_type), POINTER :: xc_rho1_set => null()
53 !> first and second derivatives of exchange-correlation functional
55 !> XC input section
56 LOGICAL :: do_exck = .false.
57 TYPE(section_vals_type), POINTER :: xc_section => null()
58 !> scaling coefficients in the linear combination:
59 !> K = alpha * K_{\alpha,\alpha} + beta * K_{\alpha,\beta}
60 REAL(kind=dp) :: alpha = -1.0_dp, beta = -1.0_dp
61 !> flags for finite differences/analytic XC kernels
62 LOGICAL :: deriv2_analytic = .false.
63 LOGICAL :: deriv3_analytic = .false.
64 ! Local resolution of the identity for Coulomb
65 TYPE(lri_environment_type), POINTER :: lri_env => null()
66 TYPE(lri_density_type), POINTER :: lri_density => null()
67 ! Short range HFX integral environment
68 TYPE(hfx_type), DIMENSION(:, :), POINTER :: x_data => null()
69 TYPE(section_vals_type), POINTER :: hfxsr_section => null()
70 TYPE(admm_type), POINTER :: admm_env => null()
71 TYPE(admm_control_type), POINTER :: admm_control => null()
73! **************************************************************************************************
74!> \brief Type to hold environments for the different kernels
75!> \par History
76!> * 04.2019 created [JHU]
77! **************************************************************************************************
79 TYPE(full_kernel_env_type), POINTER :: full_kernel => null()
80 TYPE(full_kernel_env_type), POINTER :: admm_kernel => null()
81 TYPE(stda_env_type), POINTER :: stda_kernel => null()
82 END TYPE kernel_env_type
83
84CONTAINS
85
86! **************************************************************************************************
87!> \brief Release kernel environment.
88!> \param kernel_env kernel environment (destroyed on exit)
89!> \par History
90!> * 02.2017 created [Sergey Chulkov]
91! **************************************************************************************************
92 SUBROUTINE release_kernel_env(kernel_env)
93 TYPE(full_kernel_env_type), POINTER :: kernel_env
94
95 IF (ASSOCIATED(kernel_env)) THEN
96 IF (ASSOCIATED(kernel_env%xc_rho1_set)) THEN
97 CALL xc_rho_set_release(kernel_env%xc_rho1_set)
98 DEALLOCATE (kernel_env%xc_rho1_set)
99 END IF
100 IF (ASSOCIATED(kernel_env%rho0_struct)) THEN
101 CALL qs_rho_release(kernel_env%rho0_struct)
102 DEALLOCATE (kernel_env%rho0_struct)
103 END IF
104 CALL xc_dset_release(kernel_env%xc_deriv_set)
105 IF (ASSOCIATED(kernel_env%xc_rho_set)) THEN
106 CALL xc_rho_set_release(kernel_env%xc_rho_set)
107 DEALLOCATE (kernel_env%xc_rho_set)
108 END IF
109 IF (ASSOCIATED(kernel_env%x_data)) THEN
110 CALL hfx_release(kernel_env%x_data)
111 END IF
112 IF (ASSOCIATED(kernel_env%admm_env)) THEN
113 CALL admm_env_release(kernel_env%admm_env)
114 END IF
115 IF (ASSOCIATED(kernel_env%admm_control)) THEN
116 CALL admm_control_release(kernel_env%admm_control)
117 END IF
118 END IF
119
120 END SUBROUTINE release_kernel_env
121
122END MODULE qs_kernel_types
Types and set/get functions for auxiliary density matrix methods.
Definition admm_types.F:15
subroutine, public admm_env_release(admm_env)
releases the ADMM environment, cleans up all types
Definition admm_types.F:429
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public admm_control_release(admm_control)
...
Types and set/get functions for HFX.
Definition hfx_types.F:16
subroutine, public hfx_release(x_data)
This routine deallocates all data structures
Definition hfx_types.F:1971
objects that represent the structure of input sections and the data contained in an input section
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
contains the types and subroutines for dealing with the lri_env lri : local resolution of the identit...
subroutine, public release_kernel_env(kernel_env)
Release kernel environment.
superstucture that hold various representations of the density and keeps track of which ones are vali...
subroutine, public qs_rho_release(rho_struct)
releases a rho_struct by decreasing the reference count by one and deallocating if it reaches 0 (to b...
Simplified Tamm Dancoff approach (sTDA).
represent a group ofunctional derivatives
subroutine, public xc_dset_release(derivative_set)
releases a derivative set
contains the structure
subroutine, public xc_rho_set_release(rho_set, pw_pool)
releases the given rho_set
stores some data used in wavefunction fitting
Definition admm_types.F:120
stores some data used in construction of Kohn-Sham matrix
Definition hfx_types.F:514
Collection of variables required to evaluate adiabatic TDDFPT kernel.
Type to hold environments for the different kernels.
keeps the density in various representations, keeping track of which ones are valid.
A derivative set contains the different derivatives of a xc-functional in form of a linked list.
represent a density, with all the representation and data needed to perform a functional evaluation