ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
ModuleBase::FFT_DSP< FPTYPE > Class Template Reference

#include <fft_dsp.h>

Inheritance diagram for ModuleBase::FFT_DSP< FPTYPE >:
Collaboration diagram for ModuleBase::FFT_DSP< FPTYPE >:

Public Member Functions

 FFT_DSP ()
 ~FFT_DSP ()
void setupFFT () override
 Setup the fft plan and data as pure virtual function.
void clear () override
 Clear the fft data as pure virtual function.
void cleanFFT () override
 Clean the fft plan as pure virtual function.
void resource_handler (const int flag) const override
 Control the allocation or deallocation of hthread resource.
virtual __attribute__ ((weak)) void initfft(int nx_in
 Initialize the fft parameters.
void initfft (int nx_in, int ny_in, int nz_in)
void setupFFT ()
 Setup the fft plan and data as pure virtual function.
void resource_handler (const int flag) const
 Allocate and destory the resoure in FFT running time, Now it only used in the DSP mode.
void fft3D_forward (std::complex< double > *in, std::complex< double > *out) const
void fft3D_backward (std::complex< double > *in, std::complex< double > *out) const
void cleanFFT ()
 Clean the fft plan as pure virtual function.
void clear ()
 Clear the fft data as pure virtual function.
std::complex< double > * get_auxr_3d_data () const
 Get the auxiliary real space data in 3D.
void setupFFT ()
 Setup the fft plan and data as pure virtual function.
void clear ()
 Clear the fft data as pure virtual function.
void cleanFFT ()
 Clean the fft plan as pure virtual function.
void resource_handler (const int flag) const
 Allocate and destory the resoure in FFT running time, Now it only used in the DSP mode.
Public Member Functions inherited from ModuleBase::FFT_BASE< FPTYPE >
 FFT_BASE ()
virtual ~FFT_BASE ()
virtual ABACUS_FFT_WEAK 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)
 Initialize the fft parameters as virtual function.
virtual ABACUS_FFT_WEAK FPTYPE * get_rspace_data () const
 Get the real space data in cpu-like fft.
virtual ABACUS_FFT_WEAK std::complex< FPTYPE > * get_auxr_data () const
virtual ABACUS_FFT_WEAK std::complex< FPTYPE > * get_auxg_data () const
virtual ABACUS_FFT_WEAK void fftxyfor (std::complex< FPTYPE > *in, std::complex< FPTYPE > *out) const
 Forward FFT in x-y direction.
virtual ABACUS_FFT_WEAK void fftxybac (std::complex< FPTYPE > *in, std::complex< FPTYPE > *out) const
virtual ABACUS_FFT_WEAK void fftzfor (std::complex< FPTYPE > *in, std::complex< FPTYPE > *out) const
 Forward FFT in z direction.
virtual ABACUS_FFT_WEAK void fftzbac (std::complex< FPTYPE > *in, std::complex< FPTYPE > *out) const
virtual ABACUS_FFT_WEAK void fftxyr2c (FPTYPE *in, std::complex< FPTYPE > *out) const
 Forward FFT in x-y direction with real to complex.
virtual ABACUS_FFT_WEAK void fftxyc2r (std::complex< FPTYPE > *in, FPTYPE *out) const
virtual ABACUS_FFT_WEAK void fft3D_forward (std::complex< FPTYPE > *in, std::complex< FPTYPE > *out) const
 Forward FFT in 3D.
virtual ABACUS_FFT_WEAK void fft3D_backward (std::complex< FPTYPE > *in, std::complex< FPTYPE > *out) const

Public Attributes

virtual int ny_in
virtual int int nz_in override
int nxyz =0
 Get the real space data.
INT cluster_id =0
INT b_id =0
INT thread_id_for =0
PLAN * ptr_plan_forward =nullptr
PLAN * ptr_plan_backward =nullptr
unsigned long args_for [2]
unsigned long args_back [2]
E * forward_in =nullptr
std::complex< float > * c_auxr_3d = nullptr
std::complex< double > * z_auxr_3d = nullptr

Additional Inherited Members

Protected Attributes inherited from ModuleBase::FFT_BASE< FPTYPE >
int nx = 0
int ny = 0
int nz = 0

Constructor & Destructor Documentation

◆ FFT_DSP()

template<typename FPTYPE>
template ModuleBase::FFT_DSP< FPTYPE >::FFT_DSP ( )
inline

◆ ~FFT_DSP()

template<typename FPTYPE>
template ModuleBase::FFT_DSP< FPTYPE >::~FFT_DSP ( )
inline

Member Function Documentation

◆ __attribute__()

template<typename FPTYPE>
virtual ModuleBase::FFT_DSP< FPTYPE >::__attribute__ ( (weak) )
virtual

Initialize the fft parameters.

Parameters
nx_innumber of grid points in x direction
ny_innumber of grid points in y direction
nz_innumber of grid points in z direction

◆ cleanFFT() [1/3]

void ModuleBase::FFT_DSP< double >::cleanFFT ( )
virtual

Clean the fft plan as pure virtual function.

The function is set as pure virtual function.In order to override the function in the derived class.In the derived class, the function is used to clean the fft plan.

Implements ModuleBase::FFT_BASE< FPTYPE >.

◆ cleanFFT() [2/3]

void ModuleBase::FFT_DSP< float >::cleanFFT ( )
virtual

Clean the fft plan as pure virtual function.

The function is set as pure virtual function.In order to override the function in the derived class.In the derived class, the function is used to clean the fft plan.

Implements ModuleBase::FFT_BASE< FPTYPE >.

◆ cleanFFT() [3/3]

template<typename FPTYPE>
void ModuleBase::FFT_DSP< FPTYPE >::cleanFFT ( )
overridevirtual

Clean the fft plan as pure virtual function.

The function is set as pure virtual function.In order to override the function in the derived class.In the derived class, the function is used to clean the fft plan.

Implements ModuleBase::FFT_BASE< FPTYPE >.

Here is the caller graph for this function:

◆ clear() [1/3]

void ModuleBase::FFT_DSP< double >::clear ( )
virtual

Clear the fft data as pure virtual function.

The function is set as pure virtual function.In order to override the function in the derived class.In the derived class, the function is used to clear the fft data.

Implements ModuleBase::FFT_BASE< FPTYPE >.

Here is the call graph for this function:

◆ clear() [2/3]

void ModuleBase::FFT_DSP< float >::clear ( )
virtual

Clear the fft data as pure virtual function.

The function is set as pure virtual function.In order to override the function in the derived class.In the derived class, the function is used to clear the fft data.

Implements ModuleBase::FFT_BASE< FPTYPE >.

◆ clear() [3/3]

template<typename FPTYPE>
void ModuleBase::FFT_DSP< FPTYPE >::clear ( )
overridevirtual

Clear the fft data as pure virtual function.

The function is set as pure virtual function.In order to override the function in the derived class.In the derived class, the function is used to clear the fft data.

Implements ModuleBase::FFT_BASE< FPTYPE >.

◆ fft3D_backward()

void ModuleBase::FFT_DSP< double >::fft3D_backward ( std::complex< double > * in,
std::complex< double > * out ) const

◆ fft3D_forward()

void ModuleBase::FFT_DSP< double >::fft3D_forward ( std::complex< double > * in,
std::complex< double > * out ) const

◆ get_auxr_3d_data()

std::complex< double > * ModuleBase::FFT_DSP< double >::get_auxr_3d_data ( ) const
virtual

Get the auxiliary real space data in 3D.

The function is used to get the auxiliary real space data in 3D. While the FFT_BASE is an abstract class,the function will be override, The attribute weak is used to avoid define the function.

Reimplemented from ModuleBase::FFT_BASE< FPTYPE >.

◆ initfft()

void ModuleBase::FFT_DSP< double >::initfft ( int nx_in,
int ny_in,
int nz_in )
virtual

Reimplemented from ModuleBase::FFT_BASE< FPTYPE >.

◆ resource_handler() [1/3]

void ModuleBase::FFT_DSP< double >::resource_handler ( const int flag) const
virtual

Allocate and destory the resoure in FFT running time, Now it only used in the DSP mode.

The function is set as pure virtual function.In order to override the function in the derived class.In the derived class, the function is used to allocate and destory the resoure in FFT running time.

Reimplemented from ModuleBase::FFT_BASE< FPTYPE >.

Here is the call graph for this function:

◆ resource_handler() [2/3]

void ModuleBase::FFT_DSP< float >::resource_handler ( const int flag) const
virtual

Allocate and destory the resoure in FFT running time, Now it only used in the DSP mode.

The function is set as pure virtual function.In order to override the function in the derived class.In the derived class, the function is used to allocate and destory the resoure in FFT running time.

Reimplemented from ModuleBase::FFT_BASE< FPTYPE >.

◆ resource_handler() [3/3]

template<typename FPTYPE>
void ModuleBase::FFT_DSP< FPTYPE >::resource_handler ( const int flag) const
overridevirtual

Control the allocation or deallocation of hthread resource.

Parameters
flag0: deallocate, 1: allocate

Reimplemented from ModuleBase::FFT_BASE< FPTYPE >.

◆ setupFFT() [1/3]

void ModuleBase::FFT_DSP< double >::setupFFT ( )
virtual

Setup the fft plan and data as pure virtual function.

The function is set as pure virtual function.In order to override the function in the derived class.In the derived class, the function is used to setup the fft plan and data.

Implements ModuleBase::FFT_BASE< FPTYPE >.

◆ setupFFT() [2/3]

void ModuleBase::FFT_DSP< float >::setupFFT ( )
virtual

Setup the fft plan and data as pure virtual function.

The function is set as pure virtual function.In order to override the function in the derived class.In the derived class, the function is used to setup the fft plan and data.

Implements ModuleBase::FFT_BASE< FPTYPE >.

◆ setupFFT() [3/3]

template<typename FPTYPE>
void ModuleBase::FFT_DSP< FPTYPE >::setupFFT ( )
overridevirtual

Setup the fft plan and data as pure virtual function.

The function is set as pure virtual function.In order to override the function in the derived class.In the derived class, the function is used to setup the fft plan and data.

Implements ModuleBase::FFT_BASE< FPTYPE >.

Member Data Documentation

◆ args_back

template<typename FPTYPE>
unsigned long ModuleBase::FFT_DSP< FPTYPE >::args_back[2]
mutable

◆ args_for

template<typename FPTYPE>
unsigned long ModuleBase::FFT_DSP< FPTYPE >::args_for[2]
mutable

◆ b_id

template<typename FPTYPE>
INT ModuleBase::FFT_DSP< FPTYPE >::b_id =0
mutable

◆ c_auxr_3d

template<typename FPTYPE>
std::complex<float>* ModuleBase::FFT_DSP< FPTYPE >::c_auxr_3d = nullptr

◆ cluster_id

template<typename FPTYPE>
INT ModuleBase::FFT_DSP< FPTYPE >::cluster_id =0

◆ forward_in

template<typename FPTYPE>
E* ModuleBase::FFT_DSP< FPTYPE >::forward_in =nullptr

◆ nxyz

template<typename FPTYPE>
int ModuleBase::FFT_DSP< FPTYPE >::nxyz =0

Get the real space data.

Returns
real space data

Forward FFT in 3D

Parameters
ininput data, complex FPTYPE
outoutput data, complex FPTYPE

This function performs the forward FFT in 3D.

Backward FFT in 3D

Parameters
ininput data, complex FPTYPE
outoutput data, complex FPTYPE

This function performs the backward FFT in 3D.

◆ ny_in

template<typename FPTYPE>
virtual int ModuleBase::FFT_DSP< FPTYPE >::ny_in

◆ override

template<typename FPTYPE>
virtual int int nz_in ModuleBase::FFT_DSP< FPTYPE >::override

◆ ptr_plan_backward

template<typename FPTYPE>
PLAN* ModuleBase::FFT_DSP< FPTYPE >::ptr_plan_backward =nullptr

◆ ptr_plan_forward

template<typename FPTYPE>
PLAN* ModuleBase::FFT_DSP< FPTYPE >::ptr_plan_forward =nullptr

◆ thread_id_for

template<typename FPTYPE>
INT ModuleBase::FFT_DSP< FPTYPE >::thread_id_for =0
mutable

◆ z_auxr_3d

template<typename FPTYPE>
std::complex<double>* ModuleBase::FFT_DSP< FPTYPE >::z_auxr_3d = nullptr

The documentation for this class was generated from the following files: