ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
xc_grad_internal.h
Go to the documentation of this file.
1//==========================================================
2// Internal declarations of the gradient-correction (gradcorr)
3// pipeline. This header is included only by the xc_grad*.cpp
4// implementation files; the public entry point
5// XC_Functional::gradcorr stays in xc_functional.h.
6//==========================================================
7#ifndef XC_GRAD_INTERNAL_H
8#define XC_GRAD_INTERNAL_H
9
10#include "source_base/matrix.h"
11#include "source_base/vector3.h"
12
13#include <complex>
14#include <vector>
15
16class Charge;
17class UnitCell;
18namespace ModulePW
19{
20class PW_Basis;
21}
22
32{
33 const Charge *chr;
36 int nspin;
37 int nspin0; // number of spin channels of the (rho, |grad rho|) pair
38 double fac; // 1.0 / nspin0
42 bool domag;
43 bool domag_z;
46 double hse_omega;
48 int func_type; // 0:none, 1:lda, 2:gga, 3:mgga, 4:hybrid lda/gga, 5:hybrid mgga
49 std::vector<int> func_id; // libxc id(s) of the functional
50};
51
60{
61 std::vector<double> rhotmp1;
62 std::vector<double> rhotmp2;
63 std::vector<std::complex<double>> rhogsum1;
64 std::vector<std::complex<double>> rhogsum2;
65 std::vector<ModuleBase::Vector3<double>> gdr1;
66 std::vector<ModuleBase::Vector3<double>> gdr2;
67 std::vector<ModuleBase::Vector3<double>> h1;
68 std::vector<ModuleBase::Vector3<double>> h2;
69 std::vector<double> neg;
70 std::vector<double> vsave;
71 std::vector<double> vgg;
72 std::vector<double> lapl1;
73 std::vector<double> lapl2;
74 std::vector<double> vlapl_arr1;
75 std::vector<double> vlapl_arr2;
76};
77
83
89 const GradCorrParams &params,
90 double &vtxcgc,
91 double &etxcgc,
92 std::vector<double> &stress_gga,
94 GradCorrBuffers &buf);
95
101 const GradCorrParams &params,
102 double vtxcgc,
103 double etxcgc,
104 double &vtxc,
105 double &etxc,
106 std::vector<double> &stress_gga,
108 GradCorrBuffers &buf);
109
110#endif // XC_GRAD_INTERNAL_H
Definition charge.h:24
Definition matrix.h:15
A class which can convert a function of "r" to the corresponding linear superposition of plane waves ...
Definition pw_basis.h:60
Provide the basic information about unitcell.
Definition unitcell.h:16
Definition pw_op.cpp:3
Scratch buffers shared by the gradcorr pipeline stages.
Definition xc_grad_internal.h:60
std::vector< double > rhotmp2
Definition xc_grad_internal.h:62
std::vector< double > vsave
Definition xc_grad_internal.h:70
std::vector< ModuleBase::Vector3< double > > gdr2
Definition xc_grad_internal.h:66
std::vector< ModuleBase::Vector3< double > > h2
Definition xc_grad_internal.h:68
std::vector< double > lapl2
Definition xc_grad_internal.h:73
std::vector< double > neg
Definition xc_grad_internal.h:69
std::vector< double > rhotmp1
Definition xc_grad_internal.h:61
std::vector< double > vlapl_arr2
Definition xc_grad_internal.h:75
std::vector< double > lapl1
Definition xc_grad_internal.h:72
std::vector< std::complex< double > > rhogsum1
Definition xc_grad_internal.h:63
std::vector< double > vlapl_arr1
Definition xc_grad_internal.h:74
std::vector< std::complex< double > > rhogsum2
Definition xc_grad_internal.h:64
std::vector< double > vgg
Definition xc_grad_internal.h:71
std::vector< ModuleBase::Vector3< double > > h1
Definition xc_grad_internal.h:67
std::vector< ModuleBase::Vector3< double > > gdr1
Definition xc_grad_internal.h:65
Parameters shared by all stages of the gradcorr pipeline.
Definition xc_grad_internal.h:32
double fac
Definition xc_grad_internal.h:38
double hse_omega
Definition xc_grad_internal.h:46
double hybrid_alpha
Definition xc_grad_internal.h:45
bool igcc_is_lyp
Definition xc_grad_internal.h:41
bool use_libxc
Definition xc_grad_internal.h:47
ModulePW::PW_Basis * rhopw
Definition xc_grad_internal.h:34
const UnitCell * ucell
Definition xc_grad_internal.h:35
bool is_stress
Definition xc_grad_internal.h:40
int gga_grad
Definition xc_grad_internal.h:44
bool domag_z
Definition xc_grad_internal.h:43
int nspin0
Definition xc_grad_internal.h:37
bool domag
Definition xc_grad_internal.h:42
const Charge * chr
Definition xc_grad_internal.h:33
std::vector< int > func_id
Definition xc_grad_internal.h:49
int nspin
Definition xc_grad_internal.h:36
bool need_laplacian
Definition xc_grad_internal.h:39
int func_type
Definition xc_grad_internal.h:48
void gradcorr_xc_kernel(const GradCorrParams &params, double &vtxcgc, double &etxcgc, std::vector< double > &stress_gga, ModuleBase::matrix &v, GradCorrBuffers &buf)
Second stage: evaluate the GGA/meta-GGA kernel on every grid point and accumulate vtxcgc,...
Definition xc_grad_kernel.cpp:16
void gradcorr_prepare_rho(const GradCorrParams &params, ModuleBase::matrix &v, GradCorrBuffers &buf)
First stage: build the real- and reciprocal-space density buffers and their gradients for every spin ...
Definition xc_grad_prepare.cpp:11
void gradcorr_assemble_vxc(const GradCorrParams &params, double vtxcgc, double etxcgc, double &vtxc, double &etxc, std::vector< double > &stress_gga, ModuleBase::matrix &v, GradCorrBuffers &buf)
Final stage: assemble the gradient-correction contribution into vtxc/etxc/stress_gga/v and restore th...
Definition xc_grad_assemble.cpp:12