ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
ekinetic_pw.h
Go to the documentation of this file.
1#ifndef EKINETICPW_H
2#define EKINETICPW_H
3
4#include "operator_pw.h"
6
8
9namespace hamilt {
10
11// Not needed anymore
12#ifndef __EKINETICTEMPLATE
13#define __EKINETICTEMPLATE
14
15template<class T> class Ekinetic : public T {};
16// template<typename R, typename Device = base_device::DEVICE_CPU>
17// class Ekinetic : public OperatorPW<T, Device> {};
18
19#endif
20
21// template<typename R, typename Device = base_device::DEVICE_CPU>
22// class Ekinetic : public OperatorPW<T, Device>
23template<typename T, typename Device>
24class Ekinetic<OperatorPW<T, Device>> : public OperatorPW<T, Device>
25{
26 private:
27 using Real = typename GetTypeReal<T>::type;
28 public:
30 Real tpiba2_in,
31 const Real* gk2_in,
32 const int gk2_row,
33 const int gk2_col);
34
35 template<typename T_in, typename Device_in = Device>
36 explicit Ekinetic(const Ekinetic<OperatorPW<T_in, Device_in>>* ekinetic);
37
38 virtual ~Ekinetic();
39
40 virtual void act(const int nbands,
41 const int nbasis,
42 const int npol,
43 const T* tmpsi_in,
44 T* tmhpsi,
45 const int ngk_ik = 0,
46 const bool is_first_node = false)const override;
47
48 // denghuilu added for copy construct at 20221105
49 int get_gk2_row() const {return this->gk2_row;}
50 int get_gk2_col() const {return this->gk2_col;}
51 Real get_tpiba2() const {return this->tpiba2;}
52 const Real* get_gk2() const {return this->gk2;}
53 Device* get_ctx() const {return this->ctx;}
54
55 private:
56
57 Real tpiba2 = 0.0;
58 const Real* gk2 = nullptr;
59 int gk2_row = 0;
60 int gk2_col = 0;
61
62 Device* ctx = {};
63 base_device::DEVICE_CPU* cpu_ctx = {};
65
70};
71
72} // namespace hamilt
73
74#endif
Device * get_ctx() const
Definition ekinetic_pw.h:53
ekinetic_pw_op< Real, Device > ekinetic_op
Definition ekinetic_pw.h:66
int get_gk2_col() const
Definition ekinetic_pw.h:50
Real get_tpiba2() const
Definition ekinetic_pw.h:51
const Real * get_gk2() const
Definition ekinetic_pw.h:52
typename GetTypeReal< T >::type Real
Definition ekinetic_pw.h:27
int get_gk2_row() const
Definition ekinetic_pw.h:49
Definition ekinetic_pw.h:15
Definition operator_pw.h:8
#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 ekinetic_op.h:9