ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
onsite_proj_pw.h
Go to the documentation of this file.
1#ifndef MODULEHAMILTPW_ONSITE_PROJ_PW_H
2#define MODULEHAMILTPW_ONSITE_PROJ_PW_H
3
4#include "operator_pw.h"
5
8
9namespace hamilt {
10
11#ifndef ONSITETEMPLATE_H
12#define ONSITETEMPLATE_H
13
14template<class T> class OnsiteProj : public T {};
15// template<typename Real, typename Device = base_device::DEVICE_CPU>
16// class OnsiteProj : public OperatorPW<T, Device> {};
17
18#endif
19
20template<typename T, typename Device>
21class OnsiteProj<OperatorPW<T, Device>> : public OperatorPW<T, Device>
22{
23 private:
24 using Real = typename GetTypeReal<T>::type;
25 public:
26 OnsiteProj(const int* isk_in,
27 const UnitCell* ucell_in,
28 const bool cal_delta_spin,
29 const bool cal_dftu);
30
31 template<typename T_in, typename Device_in = Device>
32 explicit OnsiteProj(const OnsiteProj<OperatorPW<T_in, Device_in>>* onsite_proj);
33
34 virtual ~OnsiteProj();
35
36 virtual void init(const int ik_in)override;
37
38 virtual void act(const int nbands,
39 const int nbasis,
40 const int npol,
41 const T* tmpsi_in,
42 T* tmhpsi,
43 const int ngk = 0,
44 const bool is_first_node = false)const override;
45
46 const int *get_isk() const {return this->isk;}
47 const UnitCell *get_ucell() const {return this->ucell;}
48
49 private:
50 void cal_ps_delta_spin(const int npol, const int m) const;
51 void cal_ps_dftu(const int npol, const int m) const;
52 void update_becp(const T* psi_in, const int npol, const int m) const;
53 void add_onsite_proj(T *hpsi_in, const int npol, const int m) const;
54
55 const int* isk = nullptr;
56
57 const UnitCell* ucell = nullptr;
58
59 mutable int* ip_iat = nullptr;
60 mutable T* lambda_coeff = nullptr;
61 mutable int* orb_l_iat = nullptr;
62 mutable int* ip_m = nullptr;
63 mutable int* vu_begin_iat = nullptr;
64 mutable T* vu_device = nullptr;
65
66 mutable int nkb_m = 0;
67
68 bool has_delta_spin = false;
69 bool has_dftu = false;
70
71 mutable bool init_dftu = false;
72 mutable bool init_delta_spin = false;
73
74 mutable T *ps = nullptr;
75 int tnp = 0;
76 Device* ctx = {};
77 base_device::DEVICE_CPU* cpu_ctx = {};
78
91
92 T one{1, 0};
93 T zero{0, 0};
94};
95
96} // namespace hamilt
97
98#endif
Definition unitcell.h:16
const int * get_isk() const
Definition onsite_proj_pw.h:46
typename GetTypeReal< T >::type Real
Definition onsite_proj_pw.h:24
const UnitCell * get_ucell() const
Definition onsite_proj_pw.h:47
Definition onsite_proj_pw.h:14
void add_onsite_proj(std::complex< float > *hpsi_in, const int npol, const int m) const
Definition onsite_proj_pw.cpp:357
void cal_ps_delta_spin(const int npol, const int m) const
Definition onsite_proj_pw.cpp:363
void update_becp(const std::complex< float > *psi_in, const int npol, const int m) const
Definition onsite_proj_pw.cpp:360
void cal_ps_dftu(const int npol, const int m) const
Definition onsite_proj_pw.cpp:366
Definition operator_pw.h:8
#define T
Definition exp.cpp:237
Definition hamilt.h:12
T type
Definition macros.h:8
Definition math_kernel_op.h:217
Definition math_kernel_op.h:192
Definition memory_op.h:77
Definition memory_op.h:17
Definition memory_op.h:31
const std::map< std::string, std::vector< double > > zero
Definition vdwd3_autoset_xcparam.cpp:323