ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
op_pw_nl.h
Go to the documentation of this file.
1#ifndef NONLOCALPW_H
2#define NONLOCALPW_H
3
4#include "op_pw.h"
5
8
10
11namespace hamilt
12{
13
14#ifndef NONLOCALTEMPLATE_H
15#define NONLOCALTEMPLATE_H
16
17template <class T>
18class Nonlocal : public T
19{
20};
21// template<typename Real, typename Device = base_device::DEVICE_CPU>
22// class Nonlocal : public OperatorPW<T, Device> {};
23
24#endif
25
26template <typename T, typename Device>
27class Nonlocal<OperatorPW<T, Device>> : public OperatorPW<T, Device>
28{
29 private:
30 using Real = typename GetTypeReal<T>::type;
31
32 public:
34 const int *isk_in,
35 const pseudopot_cell_vnl *ppcell_in,
36 const UnitCell *ucell_in,
37 const ModulePW::PW_Basis_K *wfc_basis);
38
39 template <typename T_in, typename Device_in = Device>
40 explicit Nonlocal(const Nonlocal<OperatorPW<T_in, Device_in>> *nonlocal);
41
42 virtual ~Nonlocal();
43
44 virtual void init(const int ik_in) override;
45
46 virtual void act(
47 const int nbands,
48 const int nbasis,
49 const int npol,
50 const T *tmpsi_in,
51 T *tmhpsi,
52 const int ngk_ik = 0,
53 const bool is_first_node = false) const override;
54
55 const int *get_isk() const { return this->isk; }
56 const pseudopot_cell_vnl *get_ppcell() const { return this->ppcell; }
57 const UnitCell *get_ucell() const { return this->ucell; }
59 const ModulePW::PW_Basis_K *get_wfcpw() const { return this->wfcpw; }
60 T *get_vkb() const { return this->vkb; }
61 T *get_becp() const { return this->workspace_.get_becp(); }
62
63 private:
65
66 const int *isk = nullptr;
67
68 const pseudopot_cell_vnl *ppcell = nullptr;
69
70 const UnitCell *ucell = nullptr;
71
72 const ModulePW::PW_Basis_K *wfcpw = nullptr;
73
74 mutable T *vkb = nullptr;
75 Device *ctx = {};
76};
77
78} // namespace hamilt
79
80#endif
Special pw_basis class. It includes different k-points.
Definition pw_basis_k.h:56
Provide the basic information about unitcell.
Definition unitcell.h:16
Reusable device buffers for applying a nonlocal projector operator.
Definition nonlocal_workspace.h:12
virtual void init(const int ik_in) override
Definition op_pw_nl.cpp:35
typename GetTypeReal< T >::type Real
Definition op_pw_nl.h:30
const UnitCell * ucell
Definition op_pw_nl.h:70
const int * get_isk() const
Definition op_pw_nl.h:55
const int * isk
Definition op_pw_nl.h:66
T * get_vkb() const
Definition op_pw_nl.h:60
const UnitCell * get_ucell() const
Definition op_pw_nl.h:57
Nonlocal(const int *isk_in, const pseudopot_cell_vnl *ppcell_in, const UnitCell *ucell_in, const ModulePW::PW_Basis_K *wfc_basis)
Definition op_pw_nl.cpp:10
const ModulePW::PW_Basis_K * wfcpw
Definition op_pw_nl.h:72
NonlocalWorkspace< T, Device > workspace_
Definition op_pw_nl.h:64
Device * ctx
Definition op_pw_nl.h:75
const ModulePW::PW_Basis_K * get_wfcpw() const
Return the borrowed plane-wave basis and pool communicator.
Definition op_pw_nl.h:59
const pseudopot_cell_vnl * ppcell
Definition op_pw_nl.h:68
const pseudopot_cell_vnl * get_ppcell() const
Definition op_pw_nl.h:56
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_nl.cpp:54
T * get_becp() const
Definition op_pw_nl.h:61
Definition op_pw.h:9
bool is_first_node
Definition operator.h:131
Definition vnl_pw.h:23
#define T
Definition exp.cpp:237
Definition wf_op.cpp:6
T type
Definition macros.h:8