PSCF v1.3
|
Field of complex double precision values on an FFT mesh. More...
#include <CField.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 | |
CField () | |
Default constructor. | |
CField (const CField &other) | |
Copy constructor. | |
virtual | ~CField () |
Destructor. | |
CField & | operator= (const CField &other) |
Assignment operator. | |
void | allocate (const IntVec< D > &meshDimensions) |
Allocate the underlying C array for an FFT grid. | |
virtual void | deallocate () |
Deallocate underlying C array and clear mesh dimensions. | |
const IntVec< D > & | meshDimensions () const |
Return mesh 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. |
Field of complex double precision values on an FFT mesh.
Definition at line 29 of file cpu/CField.h.
typedef fftw_complex Pscf::Prdc::Cpu::CField< D >::ElementType |
Type of each element.
Definition at line 39 of file cpu/CField.h.
typedef fftw_complex Pscf::Prdc::Cpu::CField< D >::Complex |
Complex number type.
Definition at line 44 of file cpu/CField.h.
typedef double Pscf::Prdc::Cpu::CField< D >::Real |
Real and imaginary parts of a Complex number.
Definition at line 49 of file cpu/CField.h.
Pscf::Prdc::Cuda::CField< D >::CField | ( | ) |
Default constructor.
Definition at line 23 of file cpu/CField.tpp.
References Pscf::Prdc::Cpu::FftwDArray< fftw_complex >::FftwDArray().
Referenced by CField(), and operator=().
Pscf::Prdc::Cuda::CField< D >::CField | ( | const CField< D > & | other | ) |
Copy constructor.
Allocates new memory and copies all elements by value.
other | the CField to be copied. |
Definition at line 41 of file cpu/CField.tpp.
References Util::Array< Data >::capacity_, CField(), Pscf::Prdc::Cpu::FftwDArray< fftw_complex >::FftwDArray(), and Pscf::Prdc::Cpu::FftwDArray< Data >::isAllocated().
|
virtual |
Destructor.
Deletes underlying C array, if allocated previously.
Definition at line 32 of file cpu/CField.tpp.
CField< D > & Pscf::Prdc::Cuda::CField< D >::operator= | ( | const CField< 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 CField |
Definition at line 61 of file cpu/CField.tpp.
References allocate(), Util::Array< Data >::capacity_, Util::Array< fftw_complex >::capacity_, CField(), Util::Array< Data >::data_, Util::Array< fftw_complex >::data_, Pscf::Prdc::Cpu::FftwDArray< Data >::isAllocated(), Pscf::Prdc::Cpu::FftwDArray< fftw_complex >::isAllocated(), UTIL_CHECK, and UTIL_THROW.
void Pscf::Prdc::Cuda::CField< D >::allocate | ( | const IntVec< D > & | meshDimensions | ) |
Allocate the underlying C array for an FFT grid.
meshDimensions | vector of numbers of grid points per direction |
Definition at line 90 of file cpu/CField.tpp.
References Pscf::Prdc::Cpu::FftwDArray< Data >::allocate(), meshDimensions(), and UTIL_CHECK.
Referenced by Pscf::Prdc::Cuda::CField< D >::CField(), operator=(), and Pscf::Prdc::Cpu::FFT< D >::setup().
|
virtual |
Deallocate underlying C array and clear mesh dimensions.
Reimplemented from Pscf::Prdc::Cpu::FftwDArray< fftw_complex >.
Definition at line 105 of file cpu/CField.tpp.
References Pscf::Prdc::Cpu::FftwDArray< Data >::deallocate().
|
inline |
Return mesh dimensions by constant reference.
Definition at line 127 of file cpu/CField.h.
Referenced by allocate(), Pscf::Prdc::Cpu::FFT< D >::forwardTransform(), Pscf::Prdc::Cpu::FFT< D >::inverseTransform(), and Pscf::Prdc::Cpu::FFT< D >::setup().
void Pscf::Prdc::Cuda::CField< D >::serialize | ( | Archive & | ar, |
const unsigned int | version ) |
Serialize a Field to/from an Archive.
ar | archive |
version | archive version id |
Definition at line 135 of file cpu/CField.h.
References Pscf::Prdc::Cpu::FftwDArray< Data >::serialize().