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