|
PSCF v1.4.0
|
Field of complex double precision values on an FFT mesh. More...
#include <CField.h>
Public Types | |
| using | RealType = double |
| Type of real and imaginary parts of a complex value. | |
| Public Types inherited from Pscf::Prdc::Cpu::FftwDArray< fftw_complex > | |
| using | ValueType |
| Data type of each array element. | |
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 > | |
| 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 () | |
| Destructor (protected to prevent direct destruction). | |
| 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 28 of file cpu/CField.h.
| using Pscf::Prdc::Cpu::CField< D >::RealType = double |
Type of real and imaginary parts of a complex value.
Definition at line 40 of file cpu/CField.h.
| Pscf::Prdc::Cpu::CField< D >::CField | ( | ) |
Default constructor.
Definition at line 24 of file cpu/CField.tpp.
References Pscf::Prdc::Cpu::FftwDArray< fftw_complex >::FftwDArray().
Referenced by CField(), and operator=().
| Pscf::Prdc::Cpu::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 42 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 33 of file cpu/CField.tpp.
| CField< D > & Pscf::Prdc::Cpu::CField< D >::operator= | ( | const CField< D > & | other | ) |
Assignment operator.
If this field is not allocated, this function allocates the field and copies all elements.
If this and the other field are both allocated, the capacities must be equal. If so, this functions copies all elements.
| other | the RHS CField |
Definition at line 62 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::Cpu::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 91 of file cpu/CField.tpp.
References allocate(), Pscf::Prdc::Cpu::FftwDArray< Data >::allocate(), meshDimensions(), and UTIL_CHECK.
Referenced by allocate(), 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 106 of file cpu/CField.tpp.
References deallocate(), and Pscf::Prdc::Cpu::FftwDArray< Data >::deallocate().
Referenced by deallocate().
|
inline |
Return mesh dimensions by constant reference.
Definition at line 119 of file cpu/CField.h.
Referenced by allocate(), Pscf::Prdc::Cpu::FFT< D >::forwardTransform(), Pscf::Prdc::Cpu::FFT< D >::inverseTransform(), Pscf::Prdc::Cpu::FFT< D >::setup(), and Pscf::Cpc::FieldIo< D >::writeField().
| void Pscf::Prdc::Cpu::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 127 of file cpu/CField.h.
References Pscf::Prdc::Cpu::FftwDArray< Data >::serialize().