ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
#include <fft_bundle.h>
Public Member Functions | |
FFT_Bundle () | |
~FFT_Bundle () | |
FFT_Bundle (std::string device_in, std::string precision_in) | |
Constructor with device and precision. | |
void | setfft (std::string device_in, std::string precision_in) |
Set device and precision. | |
void | initfft (int nx_in, int ny_in, int nz_in, int lixy_in, int rixy_in, int ns_in, int nplane_in, int nproc_in, bool gamma_only_in, bool xprime_in=true, bool mpifft_in=false) |
Initialize the fft parameters. | |
void | initfftmode (int fft_mode_in) |
Initialize the fft mode. | |
void | setupFFT () |
void | clearFFT () |
void | clear () |
void | resource_handler (const int flag) const |
template<typename FPTYPE > | |
FPTYPE * | get_rspace_data () const |
Get the real space data. | |
template<typename FPTYPE > | |
std::complex< FPTYPE > * | get_auxr_data () const |
Get the auxr data. | |
template<typename FPTYPE > | |
std::complex< FPTYPE > * | get_auxg_data () const |
Get the auxg data. | |
template<typename FPTYPE > | |
std::complex< FPTYPE > * | get_auxr_3d_data () const |
Get the auxr 3d data. | |
template<typename FPTYPE > | |
void | fftzfor (std::complex< FPTYPE > *in, std::complex< FPTYPE > *out) const |
Forward fft in z direction. | |
template<typename FPTYPE > | |
void | fftxyfor (std::complex< FPTYPE > *in, std::complex< FPTYPE > *out) const |
Forward fft in x-y direction. | |
template<typename FPTYPE > | |
void | fftzbac (std::complex< FPTYPE > *in, std::complex< FPTYPE > *out) const |
Backward fft in z direction. | |
template<typename FPTYPE > | |
void | fftxybac (std::complex< FPTYPE > *in, std::complex< FPTYPE > *out) const |
Backward fft in x-y direction. | |
template<typename FPTYPE > | |
void | fftxyr2c (FPTYPE *in, std::complex< FPTYPE > *out) const |
Real to complex fft in x-y direction. | |
template<typename FPTYPE > | |
void | fftxyc2r (std::complex< FPTYPE > *in, FPTYPE *out) const |
Complex to real fft in x-y direction. | |
template<typename FPTYPE > | |
void | fft3D_forward (std::complex< FPTYPE > *in, std::complex< FPTYPE > *out) const |
template<typename FPTYPE > | |
void | fft3D_backward (std::complex< FPTYPE > *in, std::complex< FPTYPE > *out) const |
template<> | |
void | fftxyfor (std::complex< float > *in, std::complex< float > *out) const |
template<> | |
void | fftxyfor (std::complex< double > *in, std::complex< double > *out) const |
template<> | |
void | fftzfor (std::complex< float > *in, std::complex< float > *out) const |
template<> | |
void | fftzfor (std::complex< double > *in, std::complex< double > *out) const |
template<> | |
void | fftxybac (std::complex< float > *in, std::complex< float > *out) const |
template<> | |
void | fftxybac (std::complex< double > *in, std::complex< double > *out) const |
template<> | |
void | fftzbac (std::complex< float > *in, std::complex< float > *out) const |
template<> | |
void | fftzbac (std::complex< double > *in, std::complex< double > *out) const |
template<> | |
void | fftxyr2c (float *in, std::complex< float > *out) const |
template<> | |
void | fftxyr2c (double *in, std::complex< double > *out) const |
template<> | |
void | fftxyc2r (std::complex< float > *in, float *out) const |
template<> | |
void | fftxyc2r (std::complex< double > *in, double *out) const |
template<> | |
void | fft3D_forward (std::complex< float > *in, std::complex< float > *out) const |
template<> | |
void | fft3D_forward (std::complex< double > *in, std::complex< double > *out) const |
template<> | |
void | fft3D_backward (std::complex< float > *in, std::complex< float > *out) const |
template<> | |
void | fft3D_backward (std::complex< double > *in, std::complex< double > *out) const |
template<> | |
float * | get_rspace_data () const |
template<> | |
double * | get_rspace_data () const |
template<> | |
std::complex< float > * | get_auxr_data () const |
template<> | |
std::complex< double > * | get_auxr_data () const |
template<> | |
std::complex< float > * | get_auxg_data () const |
template<> | |
std::complex< double > * | get_auxg_data () const |
template<> | |
std::complex< float > * | get_auxr_3d_data () const |
template<> | |
std::complex< double > * | get_auxr_3d_data () const |
Private Attributes | |
int | fft_mode = 0 |
bool | float_flag = false |
bool | double_flag = false |
std::shared_ptr< FFT_BASE< float > > | fft_float = nullptr |
std::shared_ptr< FFT_BASE< double > > | fft_double = nullptr |
std::string | device = "cpu" |
std::string | precision = "double" |
|
inline |
ModulePW::FFT_Bundle::~FFT_Bundle | ( | ) |
|
inline |
Constructor with device and precision.
device_in | device type, cpu or gpu. |
precision_in | precision type, single or double. |
the function will check the input device and precision, and set the device and precision.
void ModulePW::FFT_Bundle::clear | ( | ) |
void ModulePW::FFT_Bundle::clearFFT | ( | ) |
void ModulePW::FFT_Bundle::fft3D_backward | ( | std::complex< double > * | in, |
std::complex< double > * | out | ||
) | const |
void ModulePW::FFT_Bundle::fft3D_backward | ( | std::complex< float > * | in, |
std::complex< float > * | out | ||
) | const |
void ModulePW::FFT_Bundle::fft3D_backward | ( | std::complex< FPTYPE > * | in, |
std::complex< FPTYPE > * | out | ||
) | const |
void ModulePW::FFT_Bundle::fft3D_forward | ( | std::complex< double > * | in, |
std::complex< double > * | out | ||
) | const |
void ModulePW::FFT_Bundle::fft3D_forward | ( | std::complex< float > * | in, |
std::complex< float > * | out | ||
) | const |
void ModulePW::FFT_Bundle::fft3D_forward | ( | std::complex< FPTYPE > * | in, |
std::complex< FPTYPE > * | out | ||
) | const |
void ModulePW::FFT_Bundle::fftxybac | ( | std::complex< double > * | in, |
std::complex< double > * | out | ||
) | const |
void ModulePW::FFT_Bundle::fftxybac | ( | std::complex< float > * | in, |
std::complex< float > * | out | ||
) | const |
void ModulePW::FFT_Bundle::fftxybac | ( | std::complex< FPTYPE > * | in, |
std::complex< FPTYPE > * | out | ||
) | const |
Backward fft in x-y direction.
in | input data. |
out | output data. |
the function will do the backward fft in x and y direction, which is used in the cpu-like fft.As an interface, the function will call the fftxybac in the accurate fft class.
void ModulePW::FFT_Bundle::fftxyc2r | ( | std::complex< double > * | in, |
double * | out | ||
) | const |
void ModulePW::FFT_Bundle::fftxyc2r | ( | std::complex< float > * | in, |
float * | out | ||
) | const |
void ModulePW::FFT_Bundle::fftxyc2r | ( | std::complex< FPTYPE > * | in, |
FPTYPE * | out | ||
) | const |
Complex to real fft in x-y direction.
in | input data. |
out | output data. |
the function will do the complex to real fft in x and y direction, which is used in the cpu-like fft.As an interface, the function will call the fftxyc2r in the accurate fft class.
void ModulePW::FFT_Bundle::fftxyfor | ( | std::complex< double > * | in, |
std::complex< double > * | out | ||
) | const |
void ModulePW::FFT_Bundle::fftxyfor | ( | std::complex< float > * | in, |
std::complex< float > * | out | ||
) | const |
void ModulePW::FFT_Bundle::fftxyfor | ( | std::complex< FPTYPE > * | in, |
std::complex< FPTYPE > * | out | ||
) | const |
Forward fft in x-y direction.
in | input data. |
out | output data. |
the function will do the forward fft in x and y direction, which is used in the cpu-like fft.As an interface, the function will call the fftxyfor in the accurate fft class.
void ModulePW::FFT_Bundle::fftxyr2c | ( | double * | in, |
std::complex< double > * | out | ||
) | const |
void ModulePW::FFT_Bundle::fftxyr2c | ( | float * | in, |
std::complex< float > * | out | ||
) | const |
void ModulePW::FFT_Bundle::fftxyr2c | ( | FPTYPE * | in, |
std::complex< FPTYPE > * | out | ||
) | const |
Real to complex fft in x-y direction.
in | input data. |
out | output data. |
the function will do the real to complex fft in x and y direction, which is used in the cpu-like fft.As an interface, the function will call the fftxyr2c in the accurate fft class.
void ModulePW::FFT_Bundle::fftzbac | ( | std::complex< double > * | in, |
std::complex< double > * | out | ||
) | const |
void ModulePW::FFT_Bundle::fftzbac | ( | std::complex< float > * | in, |
std::complex< float > * | out | ||
) | const |
void ModulePW::FFT_Bundle::fftzbac | ( | std::complex< FPTYPE > * | in, |
std::complex< FPTYPE > * | out | ||
) | const |
Backward fft in z direction.
in | input data. |
out | output data. |
the function will do the backward many fft in z direction, which is used in the cpu-like fft.As an interface, the function will call the fftzbac in the accurate fft class.
void ModulePW::FFT_Bundle::fftzfor | ( | std::complex< double > * | in, |
std::complex< double > * | out | ||
) | const |
void ModulePW::FFT_Bundle::fftzfor | ( | std::complex< float > * | in, |
std::complex< float > * | out | ||
) | const |
void ModulePW::FFT_Bundle::fftzfor | ( | std::complex< FPTYPE > * | in, |
std::complex< FPTYPE > * | out | ||
) | const |
Forward fft in z direction.
in | input data. |
out | output data. |
The function will do the forward many fft in z direction, As an interface, the function will call the fftzfor in the accurate fft class. which is used in the cpu-like fft.
std::complex< float > * ModulePW::FFT_Bundle::get_auxg_data | ( | ) | const |
std::complex< double > * ModulePW::FFT_Bundle::get_auxg_data | ( | ) | const |
std::complex< FPTYPE > * ModulePW::FFT_Bundle::get_auxg_data | ( | ) | const |
Get the auxg data.
the function will return the auxg data, which is used in the cpu-like fft.
std::complex< float > * ModulePW::FFT_Bundle::get_auxr_3d_data | ( | ) | const |
std::complex< double > * ModulePW::FFT_Bundle::get_auxr_3d_data | ( | ) | const |
std::complex< FPTYPE > * ModulePW::FFT_Bundle::get_auxr_3d_data | ( | ) | const |
Get the auxr 3d data.
the function will return the auxr 3d data, which is used in the gpu-like fft.
std::complex< float > * ModulePW::FFT_Bundle::get_auxr_data | ( | ) | const |
std::complex< double > * ModulePW::FFT_Bundle::get_auxr_data | ( | ) | const |
std::complex< FPTYPE > * ModulePW::FFT_Bundle::get_auxr_data | ( | ) | const |
Get the auxr data.
the function will return the auxr data, which is used in the cpu-like fft.
float * ModulePW::FFT_Bundle::get_rspace_data | ( | ) | const |
double * ModulePW::FFT_Bundle::get_rspace_data | ( | ) | const |
FPTYPE * ModulePW::FFT_Bundle::get_rspace_data | ( | ) | const |
Get the real space data.
the function will return the real space data, which is used in the cpu-like fft.
void ModulePW::FFT_Bundle::initfft | ( | int | nx_in, |
int | ny_in, | ||
int | nz_in, | ||
int | lixy_in, | ||
int | rixy_in, | ||
int | ns_in, | ||
int | nplane_in, | ||
int | nproc_in, | ||
bool | gamma_only_in, | ||
bool | xprime_in = true , |
||
bool | mpifft_in = false |
||
) |
Initialize the fft parameters.
nx_in | number of grid points in x direction. |
ny_in | number of grid points in y direction. |
nz_in | number of grid points in z direction. |
lixy_in | the position of the left boundary in the x-y plane. |
rixy_in | the position of the right boundary in the x-y plane. |
ns_in | number of stick whcih is used in the Z direction. |
nplane_in | number of x-y planes. |
nproc_in | number of processors. |
gamma_only_in | whether only gamma point is used. |
xprime_in | whether xprime is used. |
the function will initialize the many-fft parameters Wheatley in cpu or gpu device.
|
inline |
Initialize the fft mode.
fft_mode_in | fft mode. |
the function will initialize the fft mode.
void ModulePW::FFT_Bundle::resource_handler | ( | const int | flag | ) | const |
void ModulePW::FFT_Bundle::setfft | ( | std::string | device_in, |
std::string | precision_in | ||
) |
Set device and precision.
device_in | device type, cpu or gpu. |
precision_in | precision type, single or double. |
the function will check the input device and precision, and set the device and precision.
void ModulePW::FFT_Bundle::setupFFT | ( | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |