PSCF v1.1
|
Field of real double precision values on an FFT mesh. More...
#include <RField.h>
Public Member Functions | |
RField () | |
Default constructor. More... | |
RField (const RField &other) | |
Copy constructor. More... | |
virtual | ~RField () |
Destructor. More... | |
RField & | operator= (const RField &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 mesh 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< double > const &other) | |
Copy constructor. More... | |
Field< double > & | operator= (Field< double > const &other) |
Assignment operator. More... | |
Field< double > & | operator= (double &scalar) |
Assignment - assign all elements to a common scalar. More... | |
Field< double > & | operator+= (Field< double > &other) |
Increment operator - add one field by another. More... | |
Field< double > & | operator-= (Field< double > &other) |
Decrement operator - subtract one field from another. More... | |
Field< double > & | operator*= (double scalar) |
Multiplication operator - multiply one field by a scalar. More... | |
Field< double > & | operator*= (Field< double > &other) |
Pointwise multipication of one field by another. More... | |
void | setToZero () |
Set all elements to zero. More... | |
double | 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... | |
Pscf::Pspc::RField< D >::RField |
Default constructor.
Definition at line 23 of file RField.tpp.
Pscf::Pspc::RField< D >::RField | ( | const RField< D > & | other | ) |
Copy constructor.
Allocates new memory and copies all elements by value.
other | the RField to be copied. |
Definition at line 42 of file RField.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 31 of file RField.tpp.
RField< D > & Pscf::Pspc::RField< D >::operator= | ( | const RField< 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 RField |
Definition at line 68 of file RField.tpp.
References Util::Array< Data >::capacity(), Util::Array< Data >::capacity_, Util::DArray< Data >::isAllocated(), and UTIL_THROW.
void Pscf::Pspc::RField< D >::allocate | ( | const IntVec< D > & | meshDimensions | ) |
Allocate the underlying C array for an FFT grid.
Exception | if the RField is already allocated. |
meshDimensions | vector of numbers of grid points per direction |
Definition at line 97 of file RField.tpp.
References Pscf::Pspc::Field< Data >::allocate(), and UTIL_CHECK.
Referenced by Pscf::Pspc::FilmIteratorBase< D, IteratorType >::generateWallFields(), Pscf::Pspc::FieldIo< D >::readFieldRGrid(), Pscf::Pspc::FFT< D >::setup(), and Pscf::Pspc::FieldIo< D >::writeFieldRGrid().
|
inline |
Return mesh dimensions by constant reference.
Definition at line 102 of file RField.h.
Referenced by Pscf::Pspc::FFT< D >::forwardTransform(), Pscf::Pspc::FFT< D >::inverseTransform(), Pscf::Pspc::FieldIo< D >::readFieldRGrid(), and Pscf::Pspc::FFT< D >::setup().
void Pscf::Pspc::RField< D >::serialize | ( | Archive & | ar, |
const unsigned int | version | ||
) |
Serialize a Field to/from an Archive.
ar | archive |
version | archive version id |
Definition at line 110 of file RField.h.
References Pscf::Pspc::Field< Data >::serialize().