(git:62906da)
Loading...
Searching...
No Matches
qs_nlcc_methods.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
8! **************************************************************************************************
9!> \brief Common Gaussian representation of nonlinear core densities.
10! **************************************************************************************************
15 USE kinds, ONLY: dp
16 USE qs_kind_types, ONLY: get_qs_kind,&
18#include "./base/base_uses.f90"
19
20 IMPLICIT NONE
21 PRIVATE
22 PUBLIC :: get_nlcc_gaussians
23
24CONTAINS
25
26! **************************************************************************************************
27!> \brief Return rho(r) = sum_i exp(-r**2/(2*alpha(i)**2)) *
28!> sum_j cval(j,i)*(r/alpha(i))**(2*j-2).
29!> The same representation is used for collocation and force integration.
30!> \param qs_kind Atomic kind carrying a GTH or separable Gaussian potential.
31!> \param alpha Gaussian widths; an empty array indicates no core correction.
32!> \param nct Number of radial polynomial coefficients for each Gaussian.
33!> \param cval Radial polynomial coefficients, including the density normalization.
34! **************************************************************************************************
35 SUBROUTINE get_nlcc_gaussians(qs_kind, alpha, nct, cval)
36 TYPE(qs_kind_type), INTENT(IN) :: qs_kind
37 REAL(kind=dp), ALLOCATABLE, DIMENSION(:), &
38 INTENT(OUT) :: alpha
39 INTEGER, ALLOCATABLE, DIMENSION(:), INTENT(OUT) :: nct
40 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :), &
41 INTENT(OUT) :: cval
42
43 INTEGER :: nexp
44 INTEGER, DIMENSION(:), POINTER :: gth_nct
45 LOGICAL :: nlcc
46 REAL(kind=dp), DIMENSION(:), POINTER :: a_nlcc, c_nlcc, gth_alpha
47 REAL(kind=dp), DIMENSION(:, :), POINTER :: gth_cval
48 TYPE(gth_potential_type), POINTER :: gth_potential
49 TYPE(sgp_potential_type), POINTER :: sgp_potential
50
51 CALL get_qs_kind(qs_kind, gth_potential=gth_potential, sgp_potential=sgp_potential)
52 IF (ASSOCIATED(gth_potential)) THEN
53 CALL get_potential(gth_potential, nlcc_present=nlcc, nexp_nlcc=nexp, &
54 alpha_nlcc=gth_alpha, nct_nlcc=gth_nct, cval_nlcc=gth_cval)
55 IF (nlcc) THEN
56 ALLOCATE (alpha(nexp), nct(nexp), cval(SIZE(gth_cval, 1), nexp))
57 alpha(:) = gth_alpha(1:nexp)
58 nct(:) = gth_nct(1:nexp)
59 cval(:, :) = gth_cval(:, 1:nexp)
60 RETURN
61 END IF
62 ELSE IF (ASSOCIATED(sgp_potential)) THEN
63 CALL get_potential(sgp_potential, has_nlcc=nlcc, n_nlcc=nexp, &
64 a_nlcc=a_nlcc, c_nlcc=c_nlcc)
65 IF (nlcc) THEN
66 cpassert(all(a_nlcc(1:nexp) > 0.0_dp))
67 ! SGP stores exponents in exp(-a*r**2), whereas GTH stores widths.
68 ALLOCATE (alpha(nexp), nct(nexp), cval(1, nexp))
69 alpha(:) = 1.0_dp/sqrt(2.0_dp*a_nlcc(1:nexp))
70 nct = 1
71 cval(1, :) = c_nlcc(1:nexp)
72 RETURN
73 END IF
74 END IF
75 ALLOCATE (alpha(0), nct(0), cval(0, 0))
76
77 END SUBROUTINE get_nlcc_gaussians
78
79END MODULE qs_nlcc_methods
Definition of the atomic potential types.
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Define the quickstep kind type and their sub types.
logical function, public has_nlcc(qs_kind_set)
finds if a given qs run needs to use nlcc
subroutine, public get_qs_kind(qs_kind, basis_set, basis_type, ncgf, nsgf, all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, cneo_potential, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zatom, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, hund_j, u_of_dft_plus_u, j_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, proj_shell_charge, lr_atom, do_mtlr, u_j_loop, ao_coef, init_u_ramping_each_scf, reltmat, ghost, monovalent, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
Common Gaussian representation of nonlinear core densities.
subroutine, public get_nlcc_gaussians(qs_kind, alpha, nct, cval)
Return rho(r) = sum_i exp(-r**2/(2*alpha(i)**2)) * sum_j cval(j,i)*(r/alpha(i))**(2*j-2)....
Provides all information about a quickstep kind.