|
PSCF v1.4.0
|
A container of complex-valued concentration fields (c fields). More...
#include <CFields.h>
Public Member Functions | |
| CFields () | |
| Constructor. | |
| ~CFields () | |
| Destructor. | |
Initialization and Memory Management | |
| void | setFieldIo (FIT const &fieldIo) |
| Create association with FIT (store pointer). | |
| void | setWriteUnitCell (UnitCell< D > const &cell) |
| Set unit cell used when writing field files. | |
| void | allocate (int nMonomer, IntVec< D > const &dimensions) |
| Allocate memory for fields. | |
Field Output to File | |
| void | writeFields (std::ostream &out) const |
| Write fields to an output stream. | |
| void | writeFields (std::string const &filename) const |
| Write fields to a named file. | |
Field Access (by reference) | |
| DArray< CFT > & | fields () |
| Get the array of all fields (non-const reference). | |
| DArray< CFT > const & | fields () const |
| Get the array of all fields (const reference). | |
| CFT & | field (int monomerId) |
| Get the field for one monomer type (non-const reference). | |
| CFT const & | field (int monomerId) const |
| Get the field for one monomer type (const reference). | |
Boolean Flags | |
| bool | isAllocated () const |
| Has memory been allocated for fields ? | |
| bool | hasData () const |
| Does this container have up-to-date field data ? | |
| void | setHasData (bool hasData) |
| Set the hasData boolean flag. | |
Protected Member Functions | |
| IntVec< D > const & | meshDimensions () const |
| Get mesh dimensions in each direction, set on r-grid allocation. | |
| int | meshSize () const |
| Get mesh size (number of grid points), set on r-grid allocation. | |
| int | nMonomer () const |
| Get number of monomer types. | |
| FIT const & | fieldIo () const |
| Get associated FIT field IO object (const reference). | |
A container of complex-valued concentration fields (c fields).
Overview : A CFields container has an array of nMonomer chemical fields (c fields) that are each associated with a monomer type. Fields can be accessed as const or non const references, or written to file.
Template parameters : The template parameters represent:
- D : integer dimensionality of space, D=1,2, or 3 - CFT : complex field type (e.g., CField<D>) - FIT : FieldIo type for field io operations (e.g., FieldIo<D>)
Subclasses : Partial specializations of CFields are used as base classes for classes Cpc::CFields <D > and Rpg::CFields <D>:
Definition at line 57 of file cp/field/CFields.h.
| Pscf::Cp::CFields< D, CFT, FIT >::CFields | ( | ) |
Constructor.
Definition at line 29 of file cp/field/CFields.tpp.
| Pscf::Cp::CFields< D, CFT, FIT >::~CFields | ( | ) |
Destructor.
Definition at line 44 of file cp/field/CFields.tpp.
| void Pscf::Cp::CFields< D, CFT, FIT >::setFieldIo | ( | FIT const & | fieldIo | ) |
Create association with FIT (store pointer).
| fieldIo | associated FIT object |
Definition at line 51 of file cp/field/CFields.tpp.
References fieldIo().
| void Pscf::Cp::CFields< D, CFT, FIT >::setWriteUnitCell | ( | UnitCell< D > const & | cell | ) |
Set unit cell used when writing field files.
This function creates a stored pointer to a UnitCell<D> that is is used by the writeFields function, which write the unit cell parameters from in this object to a field file header. This function may only be called once.
| cell | unit cell that is used by writeFields |
Definition at line 58 of file cp/field/CFields.tpp.
References UTIL_CHECK.
| void Pscf::Cp::CFields< D, CFT, FIT >::allocate | ( | int | nMonomer, |
| IntVec< D > const & | dimensions ) |
Allocate memory for fields.
This function may only be called once.
| nMonomer | number of monomer types |
| dimensions | dimensions of spatial mesh |
Definition at line 68 of file cp/field/CFields.tpp.
References meshDimensions(), nMonomer(), and UTIL_CHECK.
| void Pscf::Cp::CFields< D, CFT, FIT >::writeFields | ( | std::ostream & | out | ) | const |
Write fields to an output stream.
| out | output stream |
Definition at line 100 of file cp/field/CFields.tpp.
References fieldIo(), and UTIL_CHECK.
Referenced by writeFields().
| void Pscf::Cp::CFields< D, CFT, FIT >::writeFields | ( | std::string const & | filename | ) | const |
Write fields to a named file.
| filename | name of output file |
Definition at line 119 of file cp/field/CFields.tpp.
References fieldIo(), and writeFields().
|
inline |
Get the array of all fields (non-const reference).
The array capacity is equal to the number of monomer types.
Definition at line 263 of file cp/field/CFields.h.
References UTIL_ASSERT.
|
inline |
Get the array of all fields (const reference).
The array capacity is equal to the number of monomer types.
Definition at line 255 of file cp/field/CFields.h.
References UTIL_ASSERT.
|
inline |
Get the field for one monomer type (non-const reference).
| monomerId | integer monomer type index (0,..,nMonomer-1) |
Definition at line 279 of file cp/field/CFields.h.
References UTIL_ASSERT.
|
inline |
Get the field for one monomer type (const reference).
| monomerId | integer monomer type index (0,..,nMonomer-1) |
Definition at line 271 of file cp/field/CFields.h.
References UTIL_ASSERT.
|
inline |
Has memory been allocated for fields ?
Definition at line 287 of file cp/field/CFields.h.
|
inline |
Does this container have up-to-date field data ?
Definition at line 292 of file cp/field/CFields.h.
Referenced by setHasData().
| void Pscf::Cp::CFields< D, CFT, FIT >::setHasData | ( | bool | hasData | ) |
Set the hasData boolean flag.
This should be set true when fields are set to those computed from the current w fields, and set false when any input to that computation changes.
Definition at line 133 of file cp/field/CFields.tpp.
References hasData().
|
inlineprotected |
Get mesh dimensions in each direction, set on r-grid allocation.
Definition at line 300 of file cp/field/CFields.h.
Referenced by allocate().
|
inlineprotected |
Get mesh size (number of grid points), set on r-grid allocation.
Definition at line 305 of file cp/field/CFields.h.
|
inlineprotected |
Get number of monomer types.
Definition at line 310 of file cp/field/CFields.h.
Referenced by allocate().
|
inlineprotected |
Get associated FIT field IO object (const reference).
Definition at line 315 of file cp/field/CFields.h.
References UTIL_CHECK.
Referenced by setFieldIo(), writeFields(), and writeFields().