PSCF v1.1
|
Discrete Fourier Transform (DFT) of a real field on an FFT mesh. More...
#include <RDFieldDft.h>
Public Member Functions | |
RDFieldDft () | |
Default constructor. More... | |
RDFieldDft (const RDFieldDft< D > &other) | |
Copy constructor. More... | |
virtual | ~RDFieldDft () |
Destructor. More... | |
RDFieldDft< D > & | operator= (const RDFieldDft< D > &other) |
Assignment operator. More... | |
void | allocate (const IntVec< D > &meshDimensions) |
Allocate the underlying C array for an FFT grid. More... | |
const IntVec< D > & | meshDimensions () const |
Return vector of mesh dimensions by constant reference. More... | |
const IntVec< D > & | dftDimensions () const |
Return vector of dft (Fourier) grid dimensions by const reference. More... | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Serialize a Field to/from an Archive. More... | |
![]() | |
DField () | |
Default constructor. More... | |
DField (const DField &other) | |
Copy constructor. More... | |
virtual | ~DField () |
Destructor. More... | |
void | allocate (int capacity) |
Allocate the underlying C array on the device. More... | |
void | deallocate () |
Dellocate the underlying C array. More... | |
bool | isAllocated () const |
Return true if the Field has been allocated, false otherwise. More... | |
int | capacity () const |
Return allocated size. More... | |
cudaComplex * | cDField () |
Return pointer to underlying C array. More... | |
const cudaComplex * | cDField () const |
Return pointer to const to underlying C array. More... | |
virtual DField< cudaComplex > & | operator= (const DField< cudaComplex > &other) |
Assignment operator. More... | |
Additional Inherited Members | |
![]() | |
cudaComplex * | data_ |
Pointer to an array of Data elements on the device / GPU. More... | |
int | capacity_ |
Allocated size of the data_ array. More... | |
Discrete Fourier Transform (DFT) of a real field on an FFT mesh.
The DFT is stored internally as a C array of cudaComplex elements located in global GPU memory. All member functions are C++ functions that can be called from the host CPU.
Definition at line 34 of file RDFieldDft.h.
Pscf::Pspg::RDFieldDft< D >::RDFieldDft |
Default constructor.
Definition at line 22 of file RDFieldDft.tpp.
Pscf::Pspg::RDFieldDft< D >::RDFieldDft | ( | const RDFieldDft< D > & | other | ) |
Copy constructor.
Allocates new memory and copies all elements by value.
other | the RDFieldDft to be copied. |
Definition at line 41 of file RDFieldDft.tpp.
|
virtual |
Destructor.
Deletes underlying C array, if allocated previously.
Definition at line 30 of file RDFieldDft.tpp.
RDFieldDft< D > & Pscf::Pspg::RDFieldDft< D >::operator= | ( | const RDFieldDft< D > & | other | ) |
Assignment operator.
If this Field is not allocated, allocates and copies all elements.
If this and the other Field are both allocated, the capacities must be exactly equal. If so, this method copies all elements.
other | the RHS Field |
Definition at line 59 of file RDFieldDft.tpp.
References Pscf::Pspg::DField< Data >::operator=().
void Pscf::Pspg::RDFieldDft< D >::allocate | ( | const IntVec< D > & | meshDimensions | ) |
Allocate the underlying C array for an FFT grid.
Exception | if the RDFieldDft is already allocated. |
meshDimensions | vector of mesh dimensions |
Definition at line 121 of file RDFieldDft.h.
References Pscf::Pspg::DField< Data >::allocate(), and UTIL_CHECK.
Referenced by Pscf::Pspg::FFT< D >::setup().
|
inline |
Return vector of mesh dimensions by constant reference.
Definition at line 142 of file RDFieldDft.h.
Referenced by Pscf::Pspg::FieldIo< D >::convertBasisToKGrid(), Pscf::Pspg::FFT< D >::inverseTransform(), Pscf::Pspg::FFT< D >::setup(), and Pscf::Pspg::FFTBatched< D >::setup().
|
inline |
Return vector of dft (Fourier) grid dimensions by const reference.
The last element of dftDimensions() and meshDimensions() differ by about a factor of two: dftDimension()[D-1] = meshDimensions()/2 + 1. For D > 1, other elements are equal.
Definition at line 149 of file RDFieldDft.h.
Referenced by Pscf::Pspg::FieldIo< D >::convertBasisToKGrid(), and Pscf::Pspg::FieldIo< D >::convertKGridToBasis().
void Pscf::Pspg::RDFieldDft< D >::serialize | ( | Archive & | ar, |
const unsigned int | version | ||
) |
Serialize a Field to/from an Archive.
ar | archive |
version | archive version id |
Definition at line 157 of file RDFieldDft.h.
References UTIL_THROW.