PSCF v1.3
|
Fourier transform of a real field on an FFT mesh. More...
#include <RFieldDft.h>
Public Types | |
typedef fftw_complex | ElementType |
Type of each element. | |
typedef fftw_complex | Complex |
Complex number type. | |
typedef double | Real |
Real and imaginary parts of a Complex number. |
Public Member Functions | |
RFieldDft () | |
Default constructor. | |
RFieldDft (RFieldDft< D > const &other) | |
Copy constructor. | |
virtual | ~RFieldDft () |
Destructor. | |
RFieldDft< D > & | operator= (RFieldDft< D > const &other) |
Assignment operator. | |
void | allocate (IntVec< D > const &meshDimensions) |
Allocate the underlying C array and set mesh dimensions. | |
virtual void | deallocate () |
Deallocate underlying C array and clear mesh dimensions. | |
IntVec< D > const & | meshDimensions () const |
Return vector of spatial mesh dimensions by constant reference. | |
IntVec< D > const & | dftDimensions () const |
Return vector of dft (Fourier) grid dimensions by constant reference. | |
template<class Archive> | |
void | serialize (Archive &ar, const unsigned int version) |
Serialize a Field to/from an Archive. | |
Public Member Functions inherited from Pscf::Prdc::Cpu::FftwDArray< fftw_complex > | |
FftwDArray () | |
Default constructor. | |
virtual | ~FftwDArray () |
Destructor. | |
void | allocate (int capacity) |
Allocate the underlying C array. | |
bool | isAllocated () const |
Return true if the FftwDArray has been allocated, false otherwise. | |
void | serialize (Archive &ar, const unsigned int version) |
Serialize a FftwDArray to/from an Archive. | |
Public Member Functions inherited from Util::Array< fftw_complex > | |
virtual | ~Array () |
Destructor. | |
int | capacity () const |
Return allocated size. | |
void | begin (ArrayIterator< fftw_complex > &iterator) |
Set an iterator to begin this Array. | |
fftw_complex & | operator[] (int i) |
Get an element by non-const reference. | |
fftw_complex * | cArray () |
Return a pointer to the underlying C array. |
Additional Inherited Members | |
Protected Member Functions inherited from Util::Array< fftw_complex > | |
Array () | |
Default constructor. | |
Protected Attributes inherited from Util::Array< fftw_complex > | |
fftw_complex * | data_ |
Pointer to an array of Data elements. | |
int | capacity_ |
Allocated size of the data_ array. |
Fourier transform of a real field on an FFT mesh.
Definition at line 31 of file cpu/RFieldDft.h.
typedef fftw_complex Pscf::Prdc::Cpu::RFieldDft< D >::ElementType |
Type of each element.
Definition at line 41 of file cpu/RFieldDft.h.
typedef fftw_complex Pscf::Prdc::Cpu::RFieldDft< D >::Complex |
Complex number type.
Definition at line 46 of file cpu/RFieldDft.h.
typedef double Pscf::Prdc::Cpu::RFieldDft< D >::Real |
Real and imaginary parts of a Complex number.
Definition at line 51 of file cpu/RFieldDft.h.
Pscf::Prdc::Cuda::RFieldDft< D >::RFieldDft | ( | ) |
Default constructor.
Definition at line 24 of file cpu/RFieldDft.tpp.
References Pscf::Prdc::Cpu::FftwDArray< fftw_complex >::FftwDArray().
Referenced by operator=(), and RFieldDft().
Pscf::Prdc::Cuda::RFieldDft< D >::RFieldDft | ( | RFieldDft< D > const & | other | ) |
Copy constructor.
Allocates new memory and copies all elements by value.
other | the RFieldDft to be copied. |
Definition at line 43 of file cpu/RFieldDft.tpp.
References allocate(), Util::Array< fftw_complex >::capacity_, Util::Array< Data >::data_, Util::Array< fftw_complex >::data_, Pscf::Prdc::Cpu::FftwDArray< fftw_complex >::FftwDArray(), Pscf::Prdc::Cpu::FftwDArray< Data >::isAllocated(), and RFieldDft().
|
virtual |
Destructor.
Deletes underlying C array, if allocated previously.
Definition at line 34 of file cpu/RFieldDft.tpp.
RFieldDft< D > & Pscf::Prdc::Cuda::RFieldDft< D >::operator= | ( | RFieldDft< D > const & | 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 69 of file cpu/RFieldDft.tpp.
References allocate(), Util::Array< Data >::capacity_, Util::Array< fftw_complex >::capacity_, Util::Array< Data >::data_, Util::Array< fftw_complex >::data_, Pscf::Prdc::Cpu::FftwDArray< Data >::isAllocated(), Pscf::Prdc::Cpu::FftwDArray< fftw_complex >::isAllocated(), RFieldDft(), UTIL_CHECK, and UTIL_THROW.
void Pscf::Prdc::Cuda::RFieldDft< D >::allocate | ( | IntVec< D > const & | meshDimensions | ) |
Allocate the underlying C array and set mesh dimensions.
meshDimensions | vector of grid points in each direction |
Definition at line 100 of file cpu/RFieldDft.tpp.
References Pscf::Prdc::Cpu::FftwDArray< Data >::allocate(), Pscf::Prdc::Cpu::FFT< D >::computeKMesh(), meshDimensions(), and UTIL_CHECK.
Referenced by operator=(), RFieldDft(), and Pscf::Prdc::Cuda::RFieldDft< D >::RFieldDft().
|
virtual |
Deallocate underlying C array and clear mesh dimensions.
Reimplemented from Pscf::Prdc::Cpu::FftwDArray< fftw_complex >.
Definition at line 120 of file cpu/RFieldDft.tpp.
References Pscf::Prdc::Cpu::FftwDArray< Data >::deallocate().
|
inline |
Return vector of spatial mesh dimensions by constant reference.
Definition at line 164 of file cpu/RFieldDft.h.
Referenced by allocate(), Pscf::Rpg::FieldIo< D >::convertBasisToKGrid(), Pscf::Rpg::FieldIo< D >::convertKGridToBasis(), Pscf::Prdc::Cpu::FFT< D >::forwardTransform(), Pscf::Rpg::FieldIo< D >::hasSymmetry(), and Pscf::Prdc::Cpu::FFT< D >::inverseTransformUnsafe().
|
inline |
Return vector of dft (Fourier) grid dimensions by constant 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 171 of file cpu/RFieldDft.h.
Referenced by Pscf::Rpc::FieldIo< D >::convertBasisToKGrid(), Pscf::Rpg::FieldIo< D >::convertBasisToKGrid(), Pscf::Rpc::FieldIo< D >::convertKGridToBasis(), Pscf::Rpg::FieldIo< D >::convertKGridToBasis(), Pscf::Rpc::FieldIo< D >::hasSymmetry(), and Pscf::Rpg::FieldIo< D >::hasSymmetry().
void Pscf::Prdc::Cuda::RFieldDft< D >::serialize | ( | Archive & | ar, |
const unsigned int | version ) |
Serialize a Field to/from an Archive.
ar | archive |
version | archive version id |
Definition at line 179 of file cpu/RFieldDft.h.
References Pscf::Prdc::Cpu::FftwDArray< Data >::serialize().