ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
veff_pw.h
Go to the documentation of this file.
1#ifndef VEFFPW_H
2#define VEFFPW_H
3
4#include "operator_pw.h"
8
10
11namespace hamilt {
12
13#ifndef __VEFFTEMPLATE
14#define __VEFFTEMPLATE
15
16template<class T> class Veff : public T {};
17// template<typename Real, typename Device = base_device::DEVICE_CPU>
18// class Veff : public OperatorPW<T, Device> {};
19
20#endif
21
22template<typename T, typename Device>
23class Veff<OperatorPW<T, Device>> : public OperatorPW<T, Device>
24{
25 private:
26 using Real = typename GetTypeReal<T>::type;
27 public:
28 Veff(const int* isk_in,
29 const Real* veff_in,
30 const int veff_row,
31 const int veff_col,
32 const ModulePW::PW_Basis_K* wfcpw_in);
33
34 template<typename T_in, typename Device_in = Device>
35 explicit Veff(const Veff<OperatorPW<T_in, Device_in>>* veff);
36
37 virtual ~Veff();
38
39 virtual void act(const int nbands,
40 const int nbasis,
41 const int npol,
42 const T* tmpsi_in,
43 T* tmhpsi,
44 const int ngk_ik = 0,
45 const bool is_first_node = false)const override;
46
47 // denghui added for copy constructor at 20221105
48 const Real *get_veff() const {return this->veff;}
49 int get_veff_col() const {return this->veff_col;}
50 int get_veff_row() const { return this->veff_row; }
51 const int *get_isk() const {return isk;}
53 {
54 return this->wfcpw;
55 }
56
57 private:
58
59 const int* isk = nullptr;
60
61 const ModulePW::PW_Basis_K* wfcpw = nullptr;
62
63 Device* ctx = {};
64 base_device::DEVICE_CPU* cpu_ctx = {};
65
66 int veff_col = 0;
67 int veff_row = 0;
68 const Real *veff = nullptr, *h_veff = nullptr, *d_veff = nullptr;
69 T *porter = nullptr;
70 T *porter1 = nullptr;
73
77};
78
79} // namespace hamilt
80
81#endif
Special pw_basis class. It includes different k-points.
Definition pw_basis_k.h:57
Definition operator_pw.h:8
const ModulePW::PW_Basis_K * get_wfcpw() const
Definition veff_pw.h:52
const int * get_isk() const
Definition veff_pw.h:51
int get_veff_col() const
Definition veff_pw.h:49
veff_pw_op< Real, Device > veff_op
Definition veff_pw.h:72
int get_veff_row() const
Definition veff_pw.h:50
const Real * get_veff() const
Definition veff_pw.h:48
typename GetTypeReal< T >::type Real
Definition veff_pw.h:26
Definition veff_lcao.h:20
#define T
Definition exp.cpp:237
AbacusDevice_t
Definition types.h:12
Definition hamilt.h:12
T type
Definition macros.h:8
Definition memory_op.h:77
Definition memory_op.h:17
Definition memory_op.h:31
Definition veff_op.h:9