PSCF v1.1
|
Fourier transform wrapper for real data. More...
#include <FFT.h>
Public Member Functions | |
FFT () | |
Default constructor. More... | |
virtual | ~FFT () |
Destructor. More... | |
void | setup (IntVec< D > const &meshDimensions) |
Setup grid dimensions, plans and work space. More... | |
void | setup (RField< D > &rField, RFieldDft< D > &kField) |
Setup grid dimensions, plans and work space. More... | |
void | forwardTransform (RField< D > const &in, RFieldDft< D > &out) const |
Compute forward (real-to-complex) Fourier transform. More... | |
void | inverseTransform (RFieldDft< D > &in, RField< D > &out) const |
Compute inverse (complex-to-real) Fourier transform. More... | |
void | inverseTransformSafe (RFieldDft< D > const &in, RField< D > &out) const |
Compute inverse (complex-to-real) Fourier transform without destroying input. More... | |
IntVec< D > const & | meshDimensions () const |
Return the dimensions of the grid for which this was allocated. More... | |
bool | isSetup () const |
Has this FFT object been setup? More... | |
Fourier transform wrapper for real data.
Definition at line 30 of file pspc/field/FFT.h.
Pscf::Pspc::FFT< D >::FFT |
Default constructor.
Definition at line 23 of file pspc/field/FFT.tpp.
|
virtual |
Destructor.
Definition at line 37 of file pspc/field/FFT.tpp.
void Pscf::Pspc::FFT< D >::setup | ( | IntVec< D > const & | meshDimensions | ) |
Setup grid dimensions, plans and work space.
meshDimensions | Dimensions of real-space grid. |
Definition at line 51 of file pspc/field/FFT.tpp.
References Pscf::Pspc::RField< D >::allocate(), Pscf::Pspc::RFieldDft< D >::allocate(), and UTIL_CHECK.
void Pscf::Pspc::FFT< D >::setup | ( | RField< D > & | rField, |
RFieldDft< D > & | kField | ||
) |
Setup grid dimensions, plans and work space.
rField | real data on r-space grid |
kField | complex data on k-space grid |
Definition at line 69 of file pspc/field/FFT.tpp.
References Util::Array< Data >::capacity(), Pscf::Pspc::RField< D >::meshDimensions(), Pscf::Pspc::RFieldDft< D >::meshDimensions(), and UTIL_CHECK.
void Pscf::Pspc::FFT< D >::forwardTransform | ( | RField< D > const & | in, |
RFieldDft< D > & | out | ||
) | const |
Compute forward (real-to-complex) Fourier transform.
This function computes a scaled Fourier transform, which is obtained by dividing the unscaled transform computed by FFTW by the number of elements. A scaled copy of the input data is copied to a temporary real array before being passed to the FFT forward transform function.
This function does not overwrite or corrupt the input array.
in | array of real values on r-space grid |
out | array of complex values on k-space grid |
Definition at line 125 of file pspc/field/FFT.tpp.
References Util::Array< Data >::capacity(), Pscf::Pspc::RField< D >::meshDimensions(), Pscf::Pspc::RFieldDft< D >::meshDimensions(), and UTIL_CHECK.
void Pscf::Pspc::FFT< D >::inverseTransform | ( | RFieldDft< D > & | in, |
RField< D > & | out | ||
) | const |
Compute inverse (complex-to-real) Fourier transform.
This function computes the same unscaled inverse transform as the FFTW library.
NOTE: The inverse transform generally overwrites and corrupts its input. This is the behavior of the complex-to-real transform of the underlying FFTW library. See Sec. 2.3 of the FFTW documentation at https://www.fftw.org/fftw3_doc, One-Dimensional DFTs of Real Data: "...the inverse transform (complex to real) has the side-effect of overwriting its input array, ..."
in | array of complex values on k-space grid (overwritten) |
out | array of real values on r-space grid |
Definition at line 149 of file pspc/field/FFT.tpp.
References Util::Array< Data >::capacity(), Pscf::Pspc::RField< D >::meshDimensions(), Pscf::Pspc::RFieldDft< D >::meshDimensions(), and UTIL_CHECK.
void Pscf::Pspc::FFT< D >::inverseTransformSafe | ( | RFieldDft< D > const & | in, |
RField< D > & | out | ||
) | const |
Compute inverse (complex-to-real) Fourier transform without destroying input.
in | array of complex values on k-space grid |
out | array of real values on r-space grid |
Definition at line 166 of file pspc/field/FFT.tpp.
References Util::Array< Data >::capacity(), and UTIL_CHECK.
|
inline |
Return the dimensions of the grid for which this was allocated.
Definition at line 166 of file pspc/field/FFT.h.
|
inline |
Has this FFT object been setup?
Definition at line 159 of file pspc/field/FFT.h.