ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
elecstate_pw.h
Go to the documentation of this file.
1#ifndef ELECSTATEPW_H
2#define ELECSTATEPW_H
3
5
6#include "elecstate.h"
11
13
14namespace elecstate
15{
16
17template <typename T, typename Device = base_device::DEVICE_CPU>
18class ElecStatePW : public ElecState
19{
20 private:
21 using Real = typename GetTypeReal<T>::type;
22
23 public:
25 Charge* chr_in,
26 K_Vectors* pkv_in,
27 UnitCell* ucell_in,
28 pseudopot_cell_vnl* ppcell_in,
29 ModulePW::PW_Basis* rhopw_in,
30 ModulePW::PW_Basis_Big* bigpw_in);
31
33
35 virtual void psiToRho(const psi::Psi<T, Device>& psi);
36
37 virtual void cal_tau(const psi::Psi<T, Device>& psi);
38
41
42 Real* becsum = nullptr;
43
45 void init_rho_data();
46 Real** rho = nullptr; // [Device] [spin][nrxx] rho
47 T** rhog = nullptr; // [Device] [spin][nrxx] rhog
48 Real** kin_r = nullptr; // [Device] [spin][nrxx] kin_r
49
51
52 protected:
53
55
56 UnitCell* ucell = nullptr;
57
58 const pseudopot_cell_vnl* ppcell = nullptr;
59
62 void updateRhoK(const psi::Psi<T, Device>& psi); // override;
63
65 void parallelK();
66
68 void rhoBandK(const psi::Psi<T, Device>& psi);
69
72
75 void addusdens_g(const Real* becsum, T** rhog);
76
77 Device * ctx = {};
78
79 bool init_rho = false;
80
81 mutable T* vkb = nullptr;
82
83 Real* rho_data = nullptr;
84 T* rhog_data = nullptr;
85 Real* kin_r_data = nullptr;
86 T* wfcr = nullptr;
87 T* wfcr_another_spin = nullptr;
88
89 private:
92
97
101
104};
105
106} // namespace elecstate
107
108#endif
Definition charge.h:17
Definition klist.h:12
Definition pw_basis_big.h:17
Special pw_basis class. It includes different k-points.
Definition pw_basis_k.h:56
A class which can convert a function of "r" to the corresponding linear superposition of plane waves ...
Definition pw_basis.h:56
Definition unitcell.h:15
Definition elecstate_pw.h:19
T * wfcr
Definition elecstate_pw.h:86
Real * kin_r_data
Definition elecstate_pw.h:85
T * wfcr_another_spin
Definition elecstate_pw.h:87
UnitCell * ucell
Definition elecstate_pw.h:56
Device * ctx
Definition elecstate_pw.h:77
virtual void cal_tau(const psi::Psi< T, Device > &psi)
Definition elecstate_pw_cal_tau.cpp:6
void init_rho_data()
init rho_data and kin_r_data
Definition elecstate_pw.cpp:60
bool init_rho
Definition elecstate_pw.h:79
typename GetTypeReal< T >::type Real
Definition elecstate_pw.h:21
Real ** kin_r
Definition elecstate_pw.h:48
void rhoBandK(const psi::Psi< T, Device > &psi)
calcualte rho for each k
Definition elecstate_pw.cpp:172
Real * becsum
Definition elecstate_pw.h:42
Real ** rho
Definition elecstate_pw.h:46
T * vkb
Definition elecstate_pw.h:81
Real * rho_data
Definition elecstate_pw.h:83
void parallelK()
sum over all pools for rho and ebands
Definition elecstate_pw.cpp:164
virtual void psiToRho(const psi::Psi< T, Device > &psi)
interface for HSolver to calculate rho from Psi
Definition elecstate_pw.cpp:111
void cal_becsum(const psi::Psi< T, Device > &psi)
calculate becsum for uspp
Definition elecstate_pw.cpp:271
ModulePW::PW_Basis * rhopw_smooth
Definition elecstate_pw.h:54
ModulePW::PW_Basis_K * basis
Definition elecstate_pw.h:50
void add_usrho(const psi::Psi< T, Device > &psi)
add to the charge density in reciprocal space the part which is due to the US augmentation.
Definition elecstate_pw.cpp:424
const pseudopot_cell_vnl * ppcell
Definition elecstate_pw.h:58
~ElecStatePW()
Definition elecstate_pw.cpp:33
T ** rhog
Definition elecstate_pw.h:47
void addusdens_g(const Real *becsum, T **rhog)
Definition elecstate_pw.cpp:457
T * rhog_data
Definition elecstate_pw.h:84
void updateRhoK(const psi::Psi< T, Device > &psi)
Definition elecstate_pw.cpp:158
Definition elecstate.h:15
Definition vnl_pw.h:21
Definition psi.h:37
#define T
Definition exp.cpp:237
Definition read_atoms_helper_test.cpp:11
Definition exx_lip.h:23
T type
Definition macros.h:8
Definition math_kernel_op.h:216
Definition math_kernel_op.h:191
Definition memory_op.h:99
Definition memory_op.h:115
Definition memory_op.h:17
Definition memory_op.h:31
Definition elecstate_op.h:11
Definition meta_op.h:10