ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
meta_pw.h
Go to the documentation of this file.
1#ifndef METAPW_H
2#define METAPW_H
3
4#include "operator_pw.h"
9
10#include <source_base/macros.h>
11
12namespace hamilt {
13
14#ifndef __METATEMPLATE
15#define __METATEMPLATE
16
17template<class T> class Meta : public T {};
18// template<typename Real, typename Device = base_device::DEVICE_CPU>
19// class Meta : public OperatorPW<T, Device> {};
20
21#endif
22
23template<typename T, typename Device>
24class Meta<OperatorPW<T, Device>> : public OperatorPW<T, Device>
25{
26 private:
27 using Real = typename GetTypeReal<T>::type;
28 public:
29 Meta(Real tpiba2_in,
30 const int* isk_in,
31 const Real* vk_in,
32 const int vk_row,
33 const int vk_col,
34 const ModulePW::PW_Basis_K* wfcpw);
35
36 template <typename T_in, typename Device_in = Device>
37 explicit Meta(const Meta<OperatorPW<T_in, Device_in>>* meta);
38
39 virtual ~Meta();
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 // denghui added for copy constructor at 20221105
51 {
52 return this->tpiba;
53 }
54 const int * get_isk() const {return this->isk;}
55 const Real* get_vk() const {return this->vk;}
56 int get_vk_row() const {return this->vk_row;}
57 int get_vk_col() const {return this->vk_col;}
59 {
60 return this->wfcpw;
61 }
62
63 private:
64
65 mutable int max_npw = 0;
66
67 mutable int npol = 0;
68
69 mutable int vk_row = 0;
70 mutable int vk_col = 0;
71
72 Real tpiba = 0.0;
73
74 const int* isk = nullptr;
75
76 const Real * vk = nullptr;
77
78 const ModulePW::PW_Basis_K* wfcpw = nullptr;
79
80 Device* ctx = {};
81 base_device::DEVICE_CPU* cpu_ctx = {};
82 T *porter = nullptr;
88};
89
90} // namespace hamilt
91
92#endif
Special pw_basis class. It includes different k-points.
Definition pw_basis_k.h:57
int get_vk_row() const
Definition meta_pw.h:56
Real get_tpiba() const
Definition meta_pw.h:50
int get_vk_col() const
Definition meta_pw.h:57
meta_pw_op< Real, Device > meta_op
Definition meta_pw.h:83
const int * get_isk() const
Definition meta_pw.h:54
const ModulePW::PW_Basis_K * get_wfcpw() const
Definition meta_pw.h:58
typename GetTypeReal< T >::type Real
Definition meta_pw.h:27
const Real * get_vk() const
Definition meta_pw.h:55
Definition meta_lcao.h:16
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:85
Definition memory_op.h:77
Definition memory_op.h:17
Definition memory_op.h:31
Definition meta_op.h:9