11#include <pspg/field/RDField.h>
12#include <pspg/field/RDFieldDft.h>
13#include <pspg/math/GpuResources.h>
14#include <pscf/math/IntVec.h>
19#include <cuda_runtime.h>
112 cufftHandle&
fPlan();
117 cufftHandle&
iPlan();
168 {
return meshDimensions_; }
185 extern template class FFT<1>;
186 extern template class FFT<2>;
187 extern template class FFT<3>;
191void scaleRealData(cudaReal* data, cudaReal scale,
int size) {
193 int nThreads = blockDim.x * gridDim.x;
194 int startId = blockIdx.x * blockDim.x + threadIdx.x;
195 for(
int i = startId; i < size; i += nThreads ) {
An IntVec<D, T> is a D-component vector of elements of integer type T.
Fourier transform wrapper for real data.
void forwardTransformSafe(RDField< D > const &rField, RDFieldDft< D > &kField) const
Compute forward Fourier transform without destroying input.
void forwardTransform(RDField< D > &rField, RDFieldDft< D > &kField) const
Compute forward (real-to-complex) discrete Fourier transform.
void setup(IntVec< D > const &meshDimensions)
Setup grid dimensions, plans and work space.
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?
cufftHandle & fPlan()
Get the plan for the forward DFT.
void inverseTransform(RDFieldDft< D > &kField, RDField< D > &rField) const
Compute inverse (complex-to-real) discrete Fourier transform.
cufftHandle & iPlan()
Get the plan for the inverse DFT.
virtual ~FFT()
Destructor.
FFT()
Default constructor.
void inverseTransformSafe(RDFieldDft< D > const &kField, RDField< D > &rField) const
Compute inverse (complex to real) DFT without destroying input.
Discrete Fourier Transform (DFT) of a real field on an FFT mesh.
Field of real single precision values on an FFT mesh on a device.
File containing preprocessor macros for error handling.
C++ namespace for polymer self-consistent field theory (PSCF).
Utility classes for scientific computation.