ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
nonlocal_pw.h
Go to the documentation of this file.
1#ifndef NONLOCALPW_H
2#define NONLOCALPW_H
3
4#include "operator_pw.h"
5
9
11
12namespace hamilt {
13
14#ifndef NONLOCALTEMPLATE_H
15#define NONLOCALTEMPLATE_H
16
17template<class T> class Nonlocal : public T {};
18// template<typename Real, typename Device = base_device::DEVICE_CPU>
19// class Nonlocal : public OperatorPW<T, Device> {};
20
21#endif
22
23template<typename T, typename Device>
24class Nonlocal<OperatorPW<T, Device>> : public OperatorPW<T, Device>
25{
26 private:
27 using Real = typename GetTypeReal<T>::type;
28 public:
29 Nonlocal(const int* isk_in,
30 const pseudopot_cell_vnl* ppcell_in,
31 const UnitCell* ucell_in,
32 const ModulePW::PW_Basis_K* wfc_basis);
33
34 template<typename T_in, typename Device_in = Device>
35 explicit Nonlocal(const Nonlocal<OperatorPW<T_in, Device_in>>* nonlocal);
36
37 virtual ~Nonlocal();
38
39 virtual void init(const int ik_in)override;
40
41 virtual void act(const int nbands,
42 const int nbasis,
43 const int npol,
44 const T* tmpsi_in,
45 T* tmhpsi,
46 const int ngk_ik = 0,
47 const bool is_first_node = false)const override;
48
49 const int *get_isk() const {return this->isk;}
50 const pseudopot_cell_vnl *get_ppcell() const {return this->ppcell;}
51 const UnitCell *get_ucell() const {return this->ucell;}
52 T* get_vkb() const
53 {
54 return this->vkb;
55 }
56 T* get_becp() const
57 {
58 return this->becp;
59 }
60
61 private:
62 void add_nonlocal_pp(T *hpsi_in, const T *becp, const int m) const;
63
64 mutable int max_npw = 0;
65
66 mutable int npw = 0;
67
68 mutable int npol = 0;
69
70 mutable size_t nkb_m = 0;
71
72 const int* isk = nullptr;
73
74 const pseudopot_cell_vnl* ppcell = nullptr;
75
76 const UnitCell* ucell = nullptr;
77
78 const ModulePW::PW_Basis_K* wfcpw = nullptr;
79
80 mutable T *ps = nullptr;
81 mutable T *vkb = nullptr;
82 mutable T *becp = nullptr;
83 Device* ctx = {};
84 base_device::DEVICE_CPU* cpu_ctx = {};
85 Real * deeq = nullptr;
86 T * deeq_nc = nullptr;
87 // using nonlocal_op = nonlocal_pw_op<Real, Device>;
92 #ifdef __DSP
93 using resmem_complex_op = base_device::memory::resize_memory_op_mt<T, Device>;
94 using delmem_complex_op = base_device::memory::delete_memory_op_mt<T, Device>;
95 #else
98 #endif
100
101 T one{1, 0};
102 T zero{0, 0};
103};
104
105} // namespace hamilt
106
107#endif
Special pw_basis class. It includes different k-points.
Definition pw_basis_k.h:57
Definition unitcell.h:16
nonlocal_pw_op< Real, Device > nonlocal_op
Definition nonlocal_pw.h:90
typename GetTypeReal< T >::type Real
Definition nonlocal_pw.h:27
const int * get_isk() const
Definition nonlocal_pw.h:49
T * get_vkb() const
Definition nonlocal_pw.h:52
const UnitCell * get_ucell() const
Definition nonlocal_pw.h:51
const pseudopot_cell_vnl * get_ppcell() const
Definition nonlocal_pw.h:50
T * get_becp() const
Definition nonlocal_pw.h:56
Definition nonlocal_pw.h:17
Definition operator_pw.h:8
Definition VNL_in_pw.h:21
#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
Definition nonlocal_op.h:9
const std::map< std::string, std::vector< double > > zero
Definition vdwd3_autoset_xcparam.cpp:323