PSCF v1.2
|
Fourier transform wrapper for real or complex data. More...
#include <FFT.h>
Public Member Functions | |
FFT () | |
Default constructor. | |
virtual | ~FFT () |
Destructor. | |
void | setup (IntVec< D > const &meshDimensions) |
Setup grid dimensions, plans and work space. | |
void | forwardTransform (RField< D > const &rField, RFieldDft< D > &kField) const |
Compute forward (real-to-complex) discrete Fourier transform. | |
void | inverseTransformUnsafe (RFieldDft< D > &kField, RField< D > &rField) const |
Compute inverse (complex-to-real) DFT, overwriting the input. | |
void | inverseTransformSafe (RFieldDft< D > const &kField, RField< D > &rField) const |
Compute inverse (complex-to-real) DFT without overwriting input. | |
void | forwardTransform (CField< D > const &rField, CField< D > &kField) const |
Compute forward (complex-to-complex) discrete Fourier transform. | |
void | inverseTransform (CField< D > const &kField, CField< D > &rField) const |
Compute inverse (complex-to-complex) discrete Fourier transform. | |
const IntVec< D > & | meshDimensions () const |
Return the dimensions of the grid for which this was allocated. | |
bool | isSetup () const |
Has this FFT object been setup? | |
Fourier transform wrapper for real or complex data.
Definition at line 21 of file rpg/solvers/Mixture.h.
Pscf::Prdc::Cuda::FFT< D >::FFT | ( | ) |
Default constructor.
|
virtual |
Destructor.
void Pscf::Prdc::Cuda::FFT< D >::setup | ( | IntVec< D > const & | meshDimensions | ) |
Setup grid dimensions, plans and work space.
meshDimensions | Dimensions of real-space grid. |
void Pscf::Prdc::Cuda::FFT< D >::forwardTransform | ( | RField< D > const & | rField, |
RFieldDft< D > & | kField ) const |
Compute forward (real-to-complex) discrete Fourier transform.
The resulting complex array is the output of cuFFT's forward transform method scaled by a factor of 1/N (where N is the number of grid points). The scaling ensures that a round-trip Fourier transform (forward + inverse) reproduces the original input array.
This transform is inherently "safe", meaning that the input array will not be modified during the DFT.
rField | real values on r-space grid (input, gpu mem) |
kField | complex values on k-space grid (output, gpu mem) |
void Pscf::Prdc::Cuda::FFT< D >::inverseTransformUnsafe | ( | RFieldDft< D > & | kField, |
RField< D > & | rField ) const |
Compute inverse (complex-to-real) DFT, overwriting the input.
The resulting real array is the unaltered output of cuFFT's inverse transform function.
This transform is inherently "unsafe", meaning that the input array will be overwritten during the DFT. Accordingly, the input array kField is not const like it is in all the other transform methods.
kField | complex values on k-space grid (input, gpu mem) |
rField | real values on r-space grid (output, gpu mem) |
void Pscf::Prdc::Cuda::FFT< D >::inverseTransformSafe | ( | RFieldDft< D > const & | kField, |
RField< D > & | rField ) const |
Compute inverse (complex-to-real) DFT without overwriting input.
This method makes a copy of the input kField array before performing the DFT, thus preserving the input.
kField | complex values on k-space grid (input, gpu mem) |
rField | real values on r-space grid (output, gpu mem) |
void Pscf::Prdc::Cuda::FFT< D >::forwardTransform | ( | CField< D > const & | rField, |
CField< D > & | kField ) const |
Compute forward (complex-to-complex) discrete Fourier transform.
The resulting complex array is the output of cuFFT's forward transform method scaled by a factor of 1/N (where N is the number of grid points). The scaling ensures that a round-trip Fourier transform (forward + inverse) reproduces the original input array.
This transform is inherently "safe", meaning that the input array will not be modified during the DFT.
Note that, in this transform, the k-space grid is the same size as the r-space grid, which differs from the real-to-complex transform.
rField | complex values on r-space grid (input, gpu mem) |
kField | complex values on k-space grid (output, gpu mem) |
void Pscf::Prdc::Cuda::FFT< D >::inverseTransform | ( | CField< D > const & | kField, |
CField< D > & | rField ) const |
Compute inverse (complex-to-complex) discrete Fourier transform.
The resulting complex array is the unaltered output of cuFFT's inverse transform function.
This transform is inherently "safe", meaning that the input array will not be modified during the DFT.
Note that, in this transform, the k-space grid is the same size as the r-space grid, which differs from the real-to-complex transform.
kField | complex values on k-space grid (input, gpu mem) |
rField | complex values on r-space grid (output, gpu mem) |
const IntVec< D > & Pscf::Prdc::Cuda::FFT< D >::meshDimensions | ( | ) | const |
Return the dimensions of the grid for which this was allocated.
bool Pscf::Prdc::Cuda::FFT< D >::isSetup | ( | ) | const |
Has this FFT object been setup?