|
| PW_Basis_K () |
|
| PW_Basis_K (std::string device_, std::string precision_) |
|
| ~PW_Basis_K () |
|
void | initparameters (const bool gamma_only_in, const double ecut_in, const int nk_in, const ModuleBase::Vector3< double > *kvec_d, const int distribution_type_in=1, const bool xprime_in=true) |
|
void | setuptransform () |
|
void | collect_local_pw (const double &erf_ecut_in=0.0, const double &erf_height_in=0.0, const double &erf_sigma_in=0.1) |
|
template<typename FPTYPE > |
void | real2recip (const FPTYPE *in, std::complex< FPTYPE > *out, const int ik, const bool add=false, const FPTYPE factor=1.0) const |
| transform real space to reciprocal space
|
|
template<typename FPTYPE > |
void | real2recip (const std::complex< FPTYPE > *in, std::complex< FPTYPE > *out, const int ik, const bool add=false, const FPTYPE factor=1.0) const |
| transform real space to reciprocal space
|
|
template<typename FPTYPE > |
void | recip2real (const std::complex< FPTYPE > *in, FPTYPE *out, const int ik, const bool add=false, const FPTYPE factor=1.0) const |
| transform reciprocal space to real space
|
|
template<typename FPTYPE > |
void | recip2real (const std::complex< FPTYPE > *in, std::complex< FPTYPE > *out, const int ik, const bool add=false, const FPTYPE factor=1.0) const |
| transform reciprocal space to real space
|
|
template<typename FPTYPE , typename Device > |
void | real_to_recip (const Device *ctx, const std::complex< FPTYPE > *in, std::complex< FPTYPE > *out, const int ik, const bool add=false, const FPTYPE factor=1.0) const |
|
template<typename FPTYPE , typename Device > |
void | recip_to_real (const Device *ctx, const std::complex< FPTYPE > *in, std::complex< FPTYPE > *out, const int ik, const bool add=false, const FPTYPE factor=1.0) const |
|
template<typename TK , typename Device , typename std::enable_if< std::is_same< Device, base_device::DEVICE_CPU >::value, int >::type = 0> |
void | real_to_recip (const TK *in, TK *out, const int ik, const bool add=false, const typename GetTypeReal< TK >::type factor=1.0) const |
|
template<typename TK , typename Device , typename std::enable_if< std::is_same< Device, base_device::DEVICE_CPU >::value, int >::type = 0> |
void | recip_to_real (const TK *in, TK *out, const int ik, const bool add=false, const typename GetTypeReal< TK >::type factor=1.0) const |
|
template<typename FPTYPE > |
void | real2recip_gpu (const std::complex< FPTYPE > *in, std::complex< FPTYPE > *out, const int ik, const bool add=false, const FPTYPE factor=1.0) const |
|
template<typename FPTYPE > |
void | recip2real_gpu (const std::complex< FPTYPE > *in, std::complex< FPTYPE > *out, const int ik, const bool add=false, const FPTYPE factor=1.0) const |
|
template<typename FPTYPE , typename Device , typename std::enable_if<!std::is_same< Device, base_device::DEVICE_CPU >::value, int >::type = 0> |
void | real_to_recip (const FPTYPE *in, FPTYPE *out, const int ik, const bool add=false, const typename GetTypeReal< FPTYPE >::type factor=1.0) const |
|
template<typename TK , typename Device , typename std::enable_if< std::is_same< Device, base_device::DEVICE_GPU >::value, int >::type = 0> |
void | recip_to_real (const TK *in, TK *out, const int ik, const bool add=false, const typename GetTypeReal< TK >::type factor=1.0) const |
|
double & | getgk2 (const int ik, const int igl) const |
|
ModuleBase::Vector3< double > & | getgcar (const int ik, const int igl) const |
|
ModuleBase::Vector3< double > | getgdirect (const int ik, const int igl) const |
|
ModuleBase::Vector3< double > | getgpluskcar (const int ik, const int igl) const |
|
int & | getigl2isz (const int ik, const int igl) const |
|
int & | getigl2ig (const int ik, const int igl) const |
|
std::vector< int > | get_ig2ix (const int ik) const |
|
std::vector< int > | get_ig2iy (const int ik) const |
|
std::vector< int > | get_ig2iz (const int ik) const |
|
template<typename FPTYPE > |
FPTYPE * | get_gk2_data () const |
|
template<typename FPTYPE > |
FPTYPE * | get_gcar_data () const |
|
template<typename FPTYPE > |
FPTYPE * | get_kvec_c_data () const |
|
template<> |
float * | get_kvec_c_data () const |
|
template<> |
double * | get_kvec_c_data () const |
|
template<> |
float * | get_gcar_data () const |
|
template<> |
double * | get_gcar_data () const |
|
template<> |
float * | get_gk2_data () const |
|
template<> |
double * | get_gk2_data () const |
|
template<> |
void | real_to_recip (const base_device::DEVICE_CPU *, const std::complex< float > *in, std::complex< float > *out, const int ik, const bool add, const float factor) const |
|
template<> |
void | real_to_recip (const base_device::DEVICE_CPU *, const std::complex< double > *in, std::complex< double > *out, const int ik, const bool add, const double factor) const |
|
template<> |
void | recip_to_real (const base_device::DEVICE_CPU *, const std::complex< float > *in, std::complex< float > *out, const int ik, const bool add, const float factor) const |
|
template<> |
void | recip_to_real (const base_device::DEVICE_CPU *, const std::complex< double > *in, std::complex< double > *out, const int ik, const bool add, const double factor) const |
|
| PW_Basis () |
|
| PW_Basis (std::string device_, std::string precision_) |
|
virtual | ~PW_Basis () |
|
void | initmpi (const int poolnproc_in, const int poolrank_in, MPI_Comm pool_world_in) |
|
virtual void | initgrids (const double lat0_in, const ModuleBase::Matrix3 latvec_in, const double gridecut) |
|
virtual void | initgrids (const double lat0_in, const ModuleBase::Matrix3 latvec_in, const int nx_in, int ny_in, int nz_in) |
|
void | initparameters (const bool gamma_only_in, const double pwecut_in, const int distribution_type_in=1, const bool xprime_in=true) |
|
void | setfullpw (const bool inpt_full_pw=false, const int inpt_full_pw_dim=0) |
|
void | setuptransform () |
|
void | collect_local_pw () |
|
void | collect_uniqgg () |
|
template<typename FPTYPE > |
void | real2recip (const FPTYPE *in, std::complex< FPTYPE > *out, const bool add=false, const FPTYPE factor=1.0) const |
| transform real space to reciprocal space
|
|
template<typename FPTYPE > |
void | real2recip (const std::complex< FPTYPE > *in, std::complex< FPTYPE > *out, const bool add=false, const FPTYPE factor=1.0) const |
| transform real space to reciprocal space
|
|
template<typename FPTYPE > |
void | recip2real (const std::complex< FPTYPE > *in, FPTYPE *out, const bool add=false, const FPTYPE factor=1.0) const |
| transform reciprocal space to real space
|
|
template<typename FPTYPE > |
void | recip2real (const std::complex< FPTYPE > *in, std::complex< FPTYPE > *out, const bool add=false, const FPTYPE factor=1.0) const |
| transform reciprocal space to real space
|
|
template<typename FPTYPE > |
void | real2recip_gpu (const FPTYPE *in, std::complex< FPTYPE > *out, const bool add=false, const FPTYPE factor=1.0) const |
|
template<typename FPTYPE > |
void | real2recip_gpu (const std::complex< FPTYPE > *in, std::complex< FPTYPE > *out, const bool add=false, const FPTYPE factor=1.0) const |
|
template<typename FPTYPE > |
void | recip2real_gpu (const std::complex< FPTYPE > *in, FPTYPE *out, const bool add=false, const FPTYPE factor=1.0) const |
|
template<typename FPTYPE > |
void | recip2real_gpu (const std::complex< FPTYPE > *in, std::complex< FPTYPE > *out, const bool add=false, const FPTYPE factor=1.0) const |
|
template<typename TK , typename TR , typename Device , typename std::enable_if<!std::is_same< TK, typename GetTypeReal< TK >::type >::value &&(std::is_same< TR, typename GetTypeReal< TK >::type >::value||std::is_same< TR, TK >::value) &&std::is_same< Device, base_device::DEVICE_CPU >::value, int >::type = 0> |
void | recip_to_real (TK *in, TR *out, const bool add=false, const typename GetTypeReal< TK >::type factor=1.0) const |
| Converts data from reciprocal space to real space on Cpu.
|
|
template<typename TK , typename TR , typename Device , typename std::enable_if<!std::is_same< TK, typename GetTypeReal< TK >::type >::value &&(std::is_same< TR, typename GetTypeReal< TK >::type >::value||std::is_same< TR, TK >::value) &&std::is_same< Device, base_device::DEVICE_GPU >::value, int >::type = 0> |
void | recip_to_real (TK *in, TR *out, const bool add=false, const typename GetTypeReal< TK >::type factor=1.0) const |
| Converts data from reciprocal space (Fourier space) to real space.
|
|
template<typename TR , typename TK , typename Device , typename std::enable_if<!std::is_same< TK, typename GetTypeReal< TK >::type >::value &&(std::is_same< TR, typename GetTypeReal< TK >::type >::value||std::is_same< TR, TK >::value) &&std::is_same< Device, base_device::DEVICE_CPU >::value, int >::type = 0> |
void | real_to_recip (TR *in, TK *out, const bool add=false, const typename GetTypeReal< TK >::type factor=1.0) const |
| Converts data from real space to reciprocal space (Fourier space).
|
|
template<typename TR , typename TK , typename Device , typename std::enable_if<!std::is_same< TK, typename GetTypeReal< TK >::type >::value &&(std::is_same< TR, typename GetTypeReal< TK >::type >::value||std::is_same< TR, TK >::value) &&std::is_same< Device, base_device::DEVICE_GPU >::value, int >::type = 0> |
void | real_to_recip (TR *in, TK *out, const bool add=false, const typename GetTypeReal< TK >::type factor=1.0) const |
|
void | getfftixy2is (int *fftixy2is) const |
|
void | set_device (std::string device_) |
|
void | set_precision (std::string precision_) |
|
std::string | get_device () const |
|
std::string | get_precision () const |
|
Special pw_basis class. It includes different k-points.
- Author
- qianrui, Sunliang on 2021-10-15
Math: plane waves: <r|g,k> = 1/sqrt(V) * exp(i(k+g)r) f(r) = 1/sqrt(V) * \sum_g{c(g)*exp(i(k+g)r)} c(g,k) = \int f(r)*exp(-i(g+k)r) dr
USAGE: ModulePW::PW_Basis_K pwtest; 0. init mpi for PW_Basis pwtest.inimpi(nproc_in_pool,rank_in_pool,POOL_WORLD);
- setup FFT grids for PW_Basis pwtest.initgrids(lat0,latvec,gridecut); pwtest.initgrids(lat0,latvec,N1,N2,N3); //double lat0: unit length, (unit: bohr) //ModuleBase::Matrix3 latvec: lattice vector, (unit: lat0), e.g. ModuleBase::Matrix3 latvec(1, 1, 0, 0, 2, 0, 0, 0,
2); //double gridecut: cutoff energy to generate FFT grids, (unit: Ry) //int N1,N2,N3: FFT grids
- init parameters pwtest.initparameters(gamma_only, ggecut, nks, kvec_d, dividemthd); //bool gamma_only: if use gamma_only //double ggecut: cutoff kinetic energy for planewaves(unit in Ry) (G+K)^2 < ggecut //int nks: number of k points in current cores //ModuleBase::Vector<double>* kvec_d: different k points //int dividemthd: method to divide planewaves to different cores
- Setup transforms from real space to reciprocal space or from reciprocal space to real space. pwtest.setuptransform(); pwtest.recip2real(wfg,wfr,ik); //wfg to wfr pwtest.real2recip(wfr,wfg,ik); //wfr to wfg
- Generate the wave vector for planewaves pwtest.collect_local_pw(); // double erf_ecut_in: the value of the constant energy cutoff // double erf_height_in: the height of the energy step for reciprocal vectors // double erf_sigma_in: the width of the energy step for reciprocal vectors //then we can use pwtest.gk2, pwtest.gcar, (unit in lat0^-1 or lat0^-2) //getgk2(ik,ig) : get pwtest.gk2: (G+K)^2 //getgcar(ik,ig): get pwtest.gcar: G //getgdirect(ik,ig): get pwtest.gcar: latvec * G //getgpluskcar(ik.ig): get G+K //getigl2isz(ik,ig): get pwtest.igl2isz_k //getigl2ig(ik,ig): get pwtest.igl2ig_k