ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
pw_basis_k_big.h
Go to the documentation of this file.
1#ifndef PW_BASIS_K_BIG_H
2#define PW_BASIS_K_BIG_H
5
6// temporary class, because previous ABACUS consider big grid for fft grids
7// which are used for grid integration in LCAO.
8// In fact, it is unnecessary. It will be moved after grid integration is refactored.
9namespace ModulePW
10{
11
13{
14public:
15
16 // combine [bx,by,bz] FFT grids into a big one
17 // typical values are bx=2, by=2, bz=2
18 // nbx=nx/bx, nby=ny/by, nbz=nz/bz,
19 // Note: this class can only use initgrids(lat0_in, latvec_in, PW_Basis_Big::nx, PW_Basis_Big::ny, PW_Basis_Big::nz)!!!
21 bx = 1;
22 by = 1;
23 bz = 1;
24 }
25 PW_Basis_K_Big(std::string device_, std::string precision_) : PW_Basis_K(device_, precision_) {}
27 void setbxyz(const int bx_in, const int by_in, const int bz_in)
28 {
29 bx = bx_in;
30 by = by_in;
31 bz = bz_in;
32 }
33 int bx=0;
34 int by=0;
35 int bz=0;
36 int nbx=0;
37 int nby=0;
38 int nbz=0;
39
40 virtual void distribute_r()
41 {
42 bx = (bx == 0) ? 2 : bx;
43 by = (by == 0) ? 2 : by;
44 bz = (bz == 0) ? 2 : bz;
45 this->nbx = this->nx / bx;
46 this->nby = this->ny / by;
47 this->nbz = this->nz / bz;
48 delete[] this->numz; this->numz = new int[this->poolnproc];
49 delete[] this->startz; this->startz = new int[this->poolnproc];
52
53 int npbz = this->nbz / this->poolnproc;
54 int modbz = this->nbz % this->poolnproc;
55 this->startz[0] = 0;
56 for(int ip = 0 ; ip < this->poolnproc ; ++ip)
57 {
58 this->numz[ip] = npbz*this->bz;
59 if(ip < modbz) { this->numz[ip]+=this->bz;}
60 if(ip < this->poolnproc - 1) this->startz[ip+1] = this->startz[ip] + numz[ip];
61 if(ip == this->poolrank)
62 {
63 this->nplane = numz[ip];
64 this->startz_current = startz[ip];
65 }
66 }
67 this->nrxx = this->numz[this->poolrank] * this->nxy;
68 return;
69 }
70
71};
72}
73#endif
Definition pw_basis_k_big.h:13
int nbx
Definition pw_basis_k_big.h:36
int bx
Definition pw_basis_k_big.h:33
int by
Definition pw_basis_k_big.h:34
void setbxyz(const int bx_in, const int by_in, const int bz_in)
Definition pw_basis_k_big.h:27
~PW_Basis_K_Big()
Definition pw_basis_k_big.h:26
PW_Basis_K_Big()
Definition pw_basis_k_big.h:20
virtual void distribute_r()
distribute real-space grids to different processors
Definition pw_basis_k_big.h:40
int nbz
Definition pw_basis_k_big.h:38
int nby
Definition pw_basis_k_big.h:37
int bz
Definition pw_basis_k_big.h:35
PW_Basis_K_Big(std::string device_, std::string precision_)
Definition pw_basis_k_big.h:25
Special pw_basis class. It includes different k-points.
Definition pw_basis_k.h:57
int nrxx
Definition pw_basis.h:120
int nx
Definition pw_basis.h:239
int * numz
Definition pw_basis.h:122
int nxy
Definition pw_basis.h:239
int poolnproc
Definition pw_basis.h:182
int ny
Definition pw_basis.h:239
int startz_current
Definition pw_basis.h:127
int poolrank
Definition pw_basis.h:183
int nplane
Definition pw_basis.h:128
int * startz
Definition pw_basis.h:121
int nz
Definition pw_basis.h:239
void ZEROS(std::complex< T > *u, const TI n)
Definition global_function.h:109
Definition pw_op.cpp:3