PSCF v1.1
|
Base class template for a field defined on a spatial grid. More...
#include <Field.h>
Public Member Functions | |
Field () | |
Constructor. More... | |
Field (Field< T > const &other) | |
Copy constructor. More... | |
Field< T > & | operator= (Field< T > const &other) |
Assignment operator. More... | |
Field< T > & | operator= (T &scalar) |
Assignment - assign all elements to a common scalar. More... | |
Field< T > & | operator+= (Field< T > &other) |
Increment operator - add one field by another. More... | |
Field< T > & | operator-= (Field< T > &other) |
Decrement operator - subtract one field from another. More... | |
Field< T > & | operator*= (T scalar) |
Multiplication operator - multiply one field by a scalar. More... | |
Field< T > & | operator*= (Field< T > &other) |
Pointwise multipication of one field by another. More... | |
void | setToZero () |
Set all elements to zero. More... | |
T | average () const |
Compute and return average of all elements. More... | |
Public Member Functions inherited from Util::DArray< Data > | |
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... | |
Public Member Functions inherited from Util::Array< Data > | |
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 | |
Protected Member Functions inherited from Util::Array< Data > | |
Array () | |
Default constructor. More... | |
Protected Attributes inherited from Util::Array< Data > | |
Data * | data_ |
Pointer to an array of Data elements. More... | |
int | capacity_ |
Allocated size of the data_ array. More... | |
Base class template for a field defined on a spatial grid.
Derived from DArray<T>, and provides useful arithmetic operations.
Definition at line 25 of file pscf/math/Field.h.
Pscf::Pspc::Field< Data >::Field |
Pscf::Field< T >::Field | ( | Field< T > const & | other | ) |
Copy constructor.
Definition at line 100 of file pscf/math/Field.h.
References Util::Memory::allocate(), Util::Array< Data >::capacity_, Util::Array< Data >::data_, Util::DArray< Data >::isAllocated(), and UTIL_THROW.
Field< T > & Pscf::Field< T >::operator= | ( | Field< T > const & | other | ) |
Assignment operator.
Definition at line 124 of file pscf/math/Field.h.
References Util::Array< Data >::capacity(), Util::Array< Data >::capacity_, Util::DArray< Data >::isAllocated(), and UTIL_THROW.
Field< T > & Pscf::Field< T >::operator= | ( | T & | scalar | ) |
Assignment - assign all elements to a common scalar.
Definition at line 152 of file pscf/math/Field.h.
References UTIL_THROW.
Field< T > & Pscf::Field< T >::operator+= | ( | Field< T > & | other | ) |
Increment operator - add one field by another.
Definition at line 167 of file pscf/math/Field.h.
References Util::Array< Data >::capacity_, Util::Array< Data >::data_, Util::DArray< Data >::isAllocated(), and UTIL_THROW.
Field< T > & Pscf::Field< T >::operator-= | ( | Field< T > & | other | ) |
Decrement operator - subtract one field from another.
Definition at line 188 of file pscf/math/Field.h.
References Util::Array< Data >::capacity_, Util::Array< Data >::data_, Util::DArray< Data >::isAllocated(), and UTIL_THROW.
Field< T > & Pscf::Field< T >::operator*= | ( | T | scalar | ) |
Multiplication operator - multiply one field by a scalar.
Definition at line 212 of file pscf/math/Field.h.
References UTIL_THROW.
Field< T > & Pscf::Field< T >::operator*= | ( | Field< T > & | other | ) |
Pointwise multipication of one field by another.
Definition at line 229 of file pscf/math/Field.h.
References Util::Array< Data >::capacity_, Util::Array< Data >::data_, Util::DArray< Data >::isAllocated(), and UTIL_THROW.
void Pscf::Field< T >::setToZero |
Set all elements to zero.
Definition at line 252 of file pscf/math/Field.h.
T Pscf::Field< T >::average |
Compute and return average of all elements.
Definition at line 263 of file pscf/math/Field.h.