ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
gint_move.hpp
Go to the documentation of this file.
1#include "lr_util.h"
6
7// Here will be the only place where GlobalCs are used (to be moved) in source_lcao/module_lr
9
10template <typename T>
11using D2 = void(*) (T**, size_t);
12// template <typename T>
13// using D3 = void(*) (T***, size_t, size_t);
14// template <typename T>
15// D2<T> d2 = LR_Util::_deallocate_2order_nested_ptr<T>;
16// template <typename T>
17// D3<T> d3 = LR_Util::delete_p3<T>;
18// Change to C++ 11
19D2<double> d2 = LR_Util::_deallocate_2order_nested_ptr<double>;
20// D3<double> d3 = LR_Util::delete_p3<double>;
21
22
24{
25 if (this == &rhs) {return *this;
26}
27
28 this->nbx = rhs.nbx;
29 this->nby = rhs.nby;
30 this->nbz = rhs.nbz;
31 this->ncxyz = rhs.ncxyz;
32 this->nbz_start = rhs.nbz_start;
33 this->bx = rhs.bx;
34 this->by = rhs.by;
35 this->bz = rhs.bz;
36 this->bxyz = rhs.bxyz;
37 this->nbxx = rhs.nbxx;
38 this->ny = rhs.ny;
39 this->nplane = rhs.nplane;
40 this->startz_current = rhs.startz_current;
41
42 this->gridt = rhs.gridt;
43 this->ucell = rhs.ucell;
44
45 // move hR after refactor
46 this->hRGint = rhs.hRGint;
47 rhs.hRGint = nullptr;
48 this->hRGintCd = rhs.hRGintCd;
49 rhs.hRGintCd = nullptr;
50 for (int i = 0; i < this->DMRGint.size(); i++)
51 {
52 delete this->DMRGint[i];
53 }
54 for (int i = 0; i < this->hRGint_tmp.size(); i++)
55 {
56 delete this->hRGint_tmp[i];
57 }
58 this->pvdpRx_reduced = std::move(rhs.pvdpRx_reduced);
59 this->pvdpRy_reduced = std::move(rhs.pvdpRy_reduced);
60 this->pvdpRz_reduced = std::move(rhs.pvdpRz_reduced);
61 this->DMRGint = std::move(rhs.DMRGint);
62 this->hRGint_tmp = std::move(rhs.hRGint_tmp);
63 this->DMRGint_full = rhs.DMRGint_full;
64 rhs.DMRGint_full = nullptr;
65
66 return *this;
67}
68
70{
71 if (this == &rhs) {return *this;
72}
73 Gint::operator=(std::move(rhs));
74
75 // DM may not needed in beyond DFT ESolver
76 // if (this->DM != nullptr) d3<double>(this->DM, PARAM.inp.nspin, gridt.lgd);
77 assert(this->DM == nullptr);
78 return *this;
79}
80
82{
83 if (this == &rhs) {return *this;
84}
85 this->Gint::operator=(std::move(rhs));
86 return *this;
87}
Definition gint_gamma.h:23
Gint_Gamma & operator=(Gint_Gamma &&rhs)
move operator for the next ESolver to directly use its infomation
Definition gint_move.hpp:69
double *** DM
pointer to density matrix
Definition gint_gamma.h:47
Definition gint_k.h:13
Gint_k & operator=(Gint_k &&rhs)
move operator for the next ESolver to directly use its infomation
Definition gint_move.hpp:81
Definition gint.h:20
std::vector< hamilt::HContainer< double > > pvdpRy_reduced
Definition gint.h:271
int nplane
Definition gint.h:103
std::vector< hamilt::HContainer< double > * > DMRGint
stores DMR in sparse format
Definition gint.h:265
int by
Definition gint.h:98
int nbz_start
Definition gint.h:96
hamilt::HContainer< double > * hRGint
Definition gint.h:256
std::vector< hamilt::HContainer< double > * > hRGint_tmp
size of vec is 4, only used when nspin = 4
Definition gint.h:259
int nby
Definition gint.h:93
int bx
Definition gint.h:97
int nbx
variables related to FFT grid
Definition gint.h:92
int bz
Definition gint.h:99
std::vector< hamilt::HContainer< double > > pvdpRz_reduced
Definition gint.h:272
int bxyz
Definition gint.h:100
int ny
Definition gint.h:102
int startz_current
Definition gint.h:104
std::vector< hamilt::HContainer< double > > pvdpRx_reduced
Definition gint.h:270
int ncxyz
Definition gint.h:95
int nbz
Definition gint.h:94
Gint & operator=(Gint &&rhs)
move operator for the next ESolver to directly use its infomation
Definition gint_move.hpp:23
const Grid_Technique * gridt
Definition gint.h:70
hamilt::HContainer< std::complex< double > > * hRGintCd
stores Hamiltonian in sparse format
Definition gint.h:262
int nbxx
Definition gint.h:101
const UnitCell * ucell
Definition gint.h:71
hamilt::HContainer< double > * DMRGint_full
tmp tools used in transfer_DM2DtoGrid
Definition gint.h:268
#define T
Definition exp.cpp:237
void(*)(T **, size_t) D2
Definition gint_move.hpp:11
D2< double > d2
Definition gint_move.hpp:19