|
PSCF v1.5.0
|
Field of real double precision values on a regular mesh. More...
#include <RField.h>
Public Member Functions | |
| RField () | |
| Default constructor. | |
| RField (const RField< D, CPT > &other) | |
| Copy constructor. | |
| ~RField () override=default | |
| Destructor. | |
| RField< D, CPT > & | operator= (RField< D, CPT > const &other) |
| Assignment operator. | |
| RField< D, CPT > & | operator= (HostSendArray< double, CPT > const &other) |
| Pseudo-assignment from an associated HostSendArray. | |
| void | allocate (IntVec< D > const &meshDimensions) |
| Allocate the underlying C array for values on a regular mesh. | |
| void | deallocate () override |
| Deallocate memory and return to empty state. | |
| void | associate (BackendArray< double, CPT > &arr, int beginId, IntVec< D > const &meshDimensions) |
| Associate this object with a slice of another BackendArray. | |
| IntVec< D > const & | 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. | |
Field of real double precision values on a regular mesh.
Definition at line 33 of file cpp/RField.h.
| Pscf::RField< D, CPT >::RField | ( | ) |
Default constructor.
Definition at line 23 of file cpp/RField.tpp.
References RField().
Referenced by allocate(), associate(), deallocate(), meshDimensions(), operator=(), operator=(), RField(), RField(), serialize(), and ~RField().
| Pscf::RField< D, CPT >::RField | ( | const RField< D, CPT > & | other | ) |
Copy constructor.
Allocates new memory and copies all elements by value.
| other | the RField to be copied. |
Definition at line 36 of file cpp/RField.tpp.
References RField().
|
overridedefault |
Destructor.
References allocate(), associate(), deallocate(), meshDimensions(), RField(), and serialize().
| RField< D, CPT > & Pscf::RField< D, CPT >::operator= | ( | RField< D, CPT > 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 RField |
Definition at line 104 of file cpp/RField.tpp.
References allocate(), RField(), and UTIL_CHECK.
| RField< D, CPT > & Pscf::RField< D, CPT >::operator= | ( | HostSendArray< double, CPT > const & | other | ) |
Pseudo-assignment from an associated HostSendArray.
This function simply calls the corresponding assignment operator of the BackendArray base class, then returns this RFieldDft object. It checks if an association exists between the LHS and RHS arrays, and does nothing if this is the case.
| Exception | if other (RHS) is not allocated |
| Exception | if other (RHS) is not associated with this (LHS) |
| other | the RHS host array |
Definition at line 130 of file cpp/RField.tpp.
References RField().
| void Pscf::RField< D, CPT >::allocate | ( | IntVec< D > const & | meshDimensions | ) |
Allocate the underlying C array for values on a regular mesh.
| meshDimensions | vector of numbers of grid points per direction |
Definition at line 52 of file cpp/RField.tpp.
References Pscf::FftwDRArray< Data >::allocate(), meshDimensions(), RField(), and UTIL_CHECK.
Referenced by operator=(), and ~RField().
|
override |
Deallocate memory and return to empty state.
Definition at line 67 of file cpp/RField.tpp.
References Pscf::FftwDRArray< Data >::deallocate(), and RField().
Referenced by ~RField().
| void Pscf::RField< D, CPT >::associate | ( | BackendArray< double, CPT > & | arr, |
| int | beginId, | ||
| IntVec< D > const & | meshDimensions ) |
Associate this object with a slice of another BackendArray.
| Exception | if the array is already allocated. |
| arr | parent array that owns the data |
| beginId | index in the parent array at which this array starts |
| meshDimensions | number of grid points in each dimension |
Definition at line 79 of file cpp/RField.tpp.
References meshDimensions(), RField(), and UTIL_CHECK.
Referenced by ~RField().
|
inline |
Return mesh dimensions by constant reference.
Definition at line 152 of file cpp/RField.h.
References RField().
Referenced by allocate(), associate(), and ~RField().
| void Pscf::RField< D, CPT >::serialize | ( | Archive & | ar, |
| const unsigned int | version ) |
Serialize a Field to/from an Archive.
| ar | archive |
| version | archive version id |
Definition at line 160 of file cpp/RField.h.
References RField(), and Pscf::FftwDRArray< Data >::serialize().
Referenced by ~RField().