PSCF v1.1
|
Fourier transform of a real field on an FFT mesh. More...
#include <RFieldDft.h>
Public Member Functions | |
RFieldDft () | |
Default constructor. More... | |
RFieldDft (RFieldDft< D > const &other) | |
Copy constructor. More... | |
virtual | ~RFieldDft () |
Destructor. More... | |
RFieldDft< D > & | operator= (RFieldDft< D > const &other) |
Assignment operator. More... | |
void | allocate (IntVec< D > const &meshDimensions) |
Allocate the underlying C array for an FFT grid. More... | |
IntVec< D > const & | meshDimensions () const |
Return vector of spatial mesh dimensions by constant reference. More... | |
IntVec< D > const & | dftDimensions () const |
Return vector of dft (Fourier) grid dimensions by constant reference. More... | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Serialize a Field to/from an Archive. More... | |
![]() | |
Field () | |
Constructor. More... | |
Field (Field< fftw_complex > const &other) | |
Copy constructor. More... | |
Field< fftw_complex > & | operator= (Field< fftw_complex > const &other) |
Assignment operator. More... | |
Field< fftw_complex > & | operator= (fftw_complex &scalar) |
Assignment - assign all elements to a common scalar. More... | |
Field< fftw_complex > & | operator+= (Field< fftw_complex > &other) |
Increment operator - add one field by another. More... | |
Field< fftw_complex > & | operator-= (Field< fftw_complex > &other) |
Decrement operator - subtract one field from another. More... | |
Field< fftw_complex > & | operator*= (fftw_complex scalar) |
Multiplication operator - multiply one field by a scalar. More... | |
Field< fftw_complex > & | operator*= (Field< fftw_complex > &other) |
Pointwise multipication of one field by another. More... | |
void | setToZero () |
Set all elements to zero. More... | |
fftw_complex | average () const |
Compute and return average of all elements. More... | |
![]() | |
DArray () | |
Default constructor. More... | |
DArray (DArray< Data > const &other) | |
Copy constructor. More... | |
virtual | ~DArray () |
Destructor. More... | |
DArray< Data > & | operator= (DArray< Data > const &other) |
Assignment operator. More... | |
void | allocate (int capacity) |
Allocate the underlying C array. More... | |
void | deallocate () |
Dellocate the underlying C array. More... | |
void | reallocate (int capacity) |
Reallocate the underlying C array and copy to new location. More... | |
bool | isAllocated () const |
Return true if this DArray has been allocated, false otherwise. More... | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Serialize a DArray to/from an Archive. More... | |
![]() | |
virtual | ~Array () |
Destructor. More... | |
int | capacity () const |
Return allocated size. More... | |
void | begin (ArrayIterator< Data > &iterator) |
Set an iterator to begin this Array. More... | |
void | begin (ConstArrayIterator< Data > &iterator) const |
Set a const iterator to begin this Array. More... | |
Data & | operator[] (int i) |
Get an element by non-const reference. More... | |
Data const & | operator[] (int i) const |
Get an element by const reference. More... | |
Data * | cArray () |
Return a pointer to the underlying C array. More... | |
Data const * | cArray () const |
Return pointer to const to the underlying C array. More... | |
Additional Inherited Members | |
![]() | |
Array () | |
Default constructor. More... | |
![]() | |
Data * | data_ |
Pointer to an array of Data elements. More... | |
int | capacity_ |
Allocated size of the data_ array. More... | |
Fourier transform of a real field on an FFT mesh.
Definition at line 30 of file RFieldDft.h.
Pscf::Pspc::RFieldDft< D >::RFieldDft |
Default constructor.
Definition at line 22 of file RFieldDft.tpp.
Pscf::Pspc::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 41 of file RFieldDft.tpp.
References Util::Array< Data >::capacity_, Util::Array< Data >::data_, Util::DArray< Data >::isAllocated(), and UTIL_THROW.
|
virtual |
Destructor.
Deletes underlying C array, if allocated previously.
Definition at line 30 of file RFieldDft.tpp.
RFieldDft< D > & Pscf::Pspc::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 68 of file RFieldDft.tpp.
References Util::Array< Data >::capacity(), Util::Array< Data >::capacity_, Util::Array< Data >::data_, Util::DArray< Data >::isAllocated(), and UTIL_THROW.
void Pscf::Pspc::RFieldDft< D >::allocate | ( | IntVec< D > const & | meshDimensions | ) |
Allocate the underlying C array for an FFT grid.
Exception | if the RFieldDft is already allocated. |
meshDimensions | vector of grid points in each direction |
Definition at line 116 of file RFieldDft.h.
References Pscf::Pspc::Field< Data >::allocate(), and UTIL_CHECK.
Referenced by Pscf::Pspc::Mask< D >::phiTot(), and Pscf::Pspc::FFT< D >::setup().
|
inline |
Return vector of spatial mesh dimensions by constant reference.
Definition at line 137 of file RFieldDft.h.
Referenced by Pscf::Pspc::FFT< D >::forwardTransform(), Pscf::Pspc::FFT< D >::inverseTransform(), and Pscf::Pspc::FFT< D >::setup().
|
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 144 of file RFieldDft.h.
Referenced by Pscf::Pspc::FieldIo< D >::convertBasisToKGrid(), Pscf::Pspc::FieldIo< D >::convertKGridToBasis(), and Pscf::Pspc::FieldIo< D >::hasSymmetry().
void Pscf::Pspc::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 152 of file RFieldDft.h.
References Pscf::Pspc::Field< Data >::serialize().