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
3#include "pw_basis_k.h"
4// temporary class, because previous ABACUS consider big grid for fft grids
5// which are used for grid integration in LCAO.
6// In fact, it is unnecessary. It will be moved after grid integration is refactored.
7namespace ModulePW
8{
9
11{
12public:
13
14 // combine [bx,by,bz] FFT grids into a big one
15 // typical values are bx=2, by=2, bz=2
16 // nbx=nx/bx, nby=ny/by, nbz=nz/bz,
17 // Note: this class can only use initgrids(lat0_in, latvec_in, PW_Basis_Big::nx, PW_Basis_Big::ny, PW_Basis_Big::nz)!!!
19 bx = 1;
20 by = 1;
21 bz = 1;
22 }
23 PW_Basis_K_Big(std::string device_, std::string precision_) : PW_Basis_K(device_, precision_) {}
25 void setbxyz(const int bx_in, const int by_in, const int bz_in)
26 {
27 bx = bx_in;
28 by = by_in;
29 bz = bz_in;
30 }
31 int bx=0;
32 int by=0;
33 int bz=0;
34 int nbx=0;
35 int nby=0;
36 int nbz=0;
37
38 virtual void distribute_r()
39 {
40 bx = (bx == 0) ? 2 : bx;
41 by = (by == 0) ? 2 : by;
42 bz = (bz == 0) ? 2 : bz;
43 this->nbx = this->nx / bx;
44 this->nby = this->ny / by;
45 this->nbz = this->nz / bz;
46 delete[] this->numz; this->numz = new int[this->poolnproc];
47 delete[] this->startz; this->startz = new int[this->poolnproc];
50
51 int npbz = this->nbz / this->poolnproc;
52 int modbz = this->nbz % this->poolnproc;
53 this->startz[0] = 0;
54 for(int ip = 0 ; ip < this->poolnproc ; ++ip)
55 {
56 this->numz[ip] = npbz*this->bz;
57 if(ip < modbz) { this->numz[ip]+=this->bz;}
58 if(ip < this->poolnproc - 1) this->startz[ip+1] = this->startz[ip] + numz[ip];
59 if(ip == this->poolrank)
60 {
61 this->nplane = numz[ip];
62 this->startz_current = startz[ip];
63 }
64 }
65 this->nrxx = this->numz[this->poolrank] * this->nxy;
66 return;
67 }
68
69};
70}
71#endif
int nbx
Definition pw_basis_k_big.h:34
int bx
Definition pw_basis_k_big.h:31
int by
Definition pw_basis_k_big.h:32
void setbxyz(const int bx_in, const int by_in, const int bz_in)
Definition pw_basis_k_big.h:25
~PW_Basis_K_Big()
Definition pw_basis_k_big.h:24
PW_Basis_K_Big()
Definition pw_basis_k_big.h:18
virtual void distribute_r()
distribute real-space grids to different processors
Definition pw_basis_k_big.h:38
int nbz
Definition pw_basis_k_big.h:36
int nby
Definition pw_basis_k_big.h:35
int bz
Definition pw_basis_k_big.h:33
PW_Basis_K_Big(std::string device_, std::string precision_)
Definition pw_basis_k_big.h:23
PW_Basis_K()
Definition pw_basis_k.cpp:12
int nrxx
Definition pw_basis.h:127
int nx
Definition pw_basis.h:246
int * numz
Definition pw_basis.h:129
int nxy
Definition pw_basis.h:246
int poolnproc
Definition pw_basis.h:189
int ny
Definition pw_basis.h:246
int startz_current
Definition pw_basis.h:134
int poolrank
Definition pw_basis.h:190
int nplane
Definition pw_basis.h:135
int * startz
Definition pw_basis.h:128
int nz
Definition pw_basis.h:246
void ZEROS(std::complex< T > *u, const TI n)
Definition global_function.h:109
Definition pw_op.cpp:3