PSCF v1.3
|
A list of c fields stored in both basis and r-grid format. More...
#include <CFieldsReal.h>
Public Member Functions | |
CFieldsReal () | |
Constructor. | |
~CFieldsReal () | |
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 | setNMonomer (int nMonomer) |
Set stored value of nMonomer. | |
void | allocateRGrid (IntVec< D > const &dimensions) |
Allocate memory for fields in rgrid format. | |
void | allocateBasis (int nBasis) |
Allocate or re-allocate memory for fields in basis format. | |
void | allocate (int nMonomer, int nBasis, IntVec< D > const &dimensions) |
Allocate memory for both r-grid and basis field formats. | |
Field Accessors (return by reference) | |
DArray< DArray< double > > & | basis () |
Get array of all fields in basis format (non-const). | |
DArray< DArray< double > > const & | basis () const |
Get array of all fields in basis format (const) | |
DArray< double > & | basis (int monomerId) |
Get the field for one monomer type in basis format (non-const). | |
DArray< double > const & | basis (int monomerId) const |
Get the field for one monomer type in basis format (const) | |
DArray< RFT > & | rgrid () |
Get array of all fields in r-grid format (non-const). | |
DArray< RFT > const & | rgrid () const |
Get array of all fields in r-grid format (const). | |
RFT & | rgrid (int monomerId) |
Get field for one monomer type in r-grid format (non-const) | |
RFT const & | rgrid (int monomerId) const |
Get field for one monomer type in r-grid format (const). | |
Field Output | |
void | writeBasis (std::ostream &out) const |
Write fields to an input stream in symmetrized basis format. | |
void | writeBasis (std::string filename) const |
Write fields to a named file, in symmetrized basis format. | |
void | writeRGrid (std::ostream &out) const |
Writes fields to an input stream in real-space (r-grid) format. | |
void | writeRGrid (std::string filename) const |
Writes fields to a named file in real-space (r-grid) format. | |
Boolean Variable Queries | |
bool | isAllocatedRGrid () const |
Has memory been allocated for fields in r-grid format? | |
bool | isAllocatedBasis () const |
Has memory been allocated for fields in basis format? | |
bool | hasData () const |
Does this container have up-to-date fields? | |
bool | isSymmetric () const |
Are the fields invariant under elements of the space group? | |
Boolean Variable Setters | |
void | setHasData (bool hasData) |
Set the hasData flag. | |
void | setIsSymmetric (bool isSymmetric) |
Set the isSymmetric flag. |
Protected Member Functions | |
FIT const & | fieldIo () const |
Get associated FieldIo object (const reference). |
A list of c fields stored in both basis and r-grid format.
Template parameters : The template parameters represent:
- D : integer dimensionality of space, D=1,2, or 3 - RFT : field type for r-grid data (e.g., RField<D>) - FIT : FieldIo type for field io operations (e.g., FieldIo<D>)
Field Representations : A CFieldsReal contains a list of nMonomer fields that are each associated with a monomer type. The fields may be stored in two different formats:
The CFields container provides public non-const access to both field representations, and does not automatically update one of these field representations when the other is modified. Maintenance of the intended relationship between the two data representations is instead left as the responsibility of an object that owns this container.
Subclasses : Partial specializations of CFieldsReal are used as base classes for classes Prdc::CFieldsReal <D > and Rpg::CFieldsReal <D>:
Definition at line 71 of file CFieldsReal.h.
Pscf::Prdc::CFieldsReal< D, RFT, FIT >::CFieldsReal | ( | ) |
Constructor.
Definition at line 24 of file CFieldsReal.tpp.
Pscf::Prdc::CFieldsReal< D, RFT, FIT >::~CFieldsReal | ( | ) |
Destructor.
Definition at line 40 of file CFieldsReal.tpp.
void Pscf::Prdc::CFieldsReal< D, RFT, FIT >::setFieldIo | ( | FIT const & | fieldIo | ) |
Create association with FIT (store pointer).
fieldIo | associated FIT (FieldIo) object |
Definition at line 48 of file CFieldsReal.tpp.
References fieldIo().
void Pscf::Prdc::CFieldsReal< D, RFT, 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 writeBasis and writeRGrid functions, which each 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 writeBasis and writeRGrid. |
Definition at line 55 of file CFieldsReal.tpp.
References UTIL_CHECK.
void Pscf::Prdc::CFieldsReal< D, RFT, FIT >::setNMonomer | ( | int | nMonomer | ) |
Set stored value of nMonomer.
This function may only be called once. The value of nMonomer must be positive.
nMonomer | number of monomer types. |
Definition at line 65 of file CFieldsReal.tpp.
References UTIL_CHECK.
Referenced by allocate().
void Pscf::Prdc::CFieldsReal< D, RFT, FIT >::allocateRGrid | ( | IntVec< D > const & | dimensions | ) |
Allocate memory for fields in rgrid format.
This function may only be called once.
dimensions | dimensions of spatial mesh |
Definition at line 77 of file CFieldsReal.tpp.
References UTIL_CHECK.
Referenced by allocate().
void Pscf::Prdc::CFieldsReal< D, RFT, FIT >::allocateBasis | ( | int | nBasis | ) |
Allocate or re-allocate memory for fields in basis format.
This function may only be called once.
nBasis | number of basis functions |
Definition at line 94 of file CFieldsReal.tpp.
References UTIL_CHECK.
Referenced by allocate().
void Pscf::Prdc::CFieldsReal< D, RFT, FIT >::allocate | ( | int | nMonomer, |
int | nBasis, | ||
IntVec< D > const & | dimensions ) |
Allocate memory for both r-grid and basis field formats.
This function may only be called once.
nMonomer | number of monomer types |
nBasis | number of basis functions |
dimensions | dimensions of spatial mesh |
Definition at line 112 of file CFieldsReal.tpp.
References allocateBasis(), allocateRGrid(), and setNMonomer().
|
inline |
Get array of all fields in basis format (non-const).
Definition at line 348 of file CFieldsReal.h.
References UTIL_ASSERT.
|
inline |
Get array of all fields in basis format (const)
The array capacity is equal to the number of monomer types.
Definition at line 356 of file CFieldsReal.h.
References UTIL_ASSERT.
|
inline |
Get the field for one monomer type in basis format (non-const).
monomerId | integer monomer type index (0, ... ,nMonomer-1) |
Definition at line 364 of file CFieldsReal.h.
References UTIL_ASSERT.
|
inline |
Get the field for one monomer type in basis format (const)
monomerId | integer monomer type index (0, ... ,nMonomer-1) |
Definition at line 372 of file CFieldsReal.h.
References UTIL_ASSERT.
|
inline |
Get array of all fields in r-grid format (non-const).
Definition at line 381 of file CFieldsReal.h.
References UTIL_ASSERT.
|
inline |
Get array of all fields in r-grid format (const).
Definition at line 389 of file CFieldsReal.h.
References UTIL_ASSERT.
|
inline |
Get field for one monomer type in r-grid format (non-const)
monomerId | integer monomer type index (0,..,nMonomer-1) |
Definition at line 397 of file CFieldsReal.h.
References UTIL_ASSERT.
|
inline |
Get field for one monomer type in r-grid format (const).
monomerId | integer monomer type index (0,..,nMonomer-1) |
Definition at line 405 of file CFieldsReal.h.
References UTIL_ASSERT.
void Pscf::Prdc::CFieldsReal< D, RFT, FIT >::writeBasis | ( | std::ostream & | out | ) | const |
Write fields to an input stream in symmetrized basis format.
out | output stream to which to write fields |
Definition at line 126 of file CFieldsReal.tpp.
References fieldIo(), and UTIL_CHECK.
Referenced by writeBasis().
void Pscf::Prdc::CFieldsReal< D, RFT, FIT >::writeBasis | ( | std::string | filename | ) | const |
Write fields to a named file, in symmetrized basis format.
filename | name of file to which to write fields |
Definition at line 143 of file CFieldsReal.tpp.
References fieldIo(), and writeBasis().
void Pscf::Prdc::CFieldsReal< D, RFT, FIT >::writeRGrid | ( | std::ostream & | out | ) | const |
Writes fields to an input stream in real-space (r-grid) format.
out | output stream to which to write fields |
Definition at line 155 of file CFieldsReal.tpp.
References fieldIo(), and UTIL_CHECK.
Referenced by writeRGrid().
void Pscf::Prdc::CFieldsReal< D, RFT, FIT >::writeRGrid | ( | std::string | filename | ) | const |
Writes fields to a named file in real-space (r-grid) format.
filename | name of file to which to write fields |
Definition at line 174 of file CFieldsReal.tpp.
References fieldIo(), and writeRGrid().
|
inline |
Has memory been allocated for fields in r-grid format?
Definition at line 413 of file CFieldsReal.h.
|
inline |
Has memory been allocated for fields in basis format?
Definition at line 418 of file CFieldsReal.h.
|
inline |
Does this container have up-to-date fields?
Definition at line 423 of file CFieldsReal.h.
Referenced by setHasData().
|
inline |
Are the fields invariant under elements of the space group?
Definition at line 428 of file CFieldsReal.h.
Referenced by setIsSymmetric().
|
inline |
Set the hasData flag.
This should be set true when fields are set to those computed from the current w fields, and false when any input to that calculation changes.
Definition at line 186 of file CFieldsReal.tpp.
References hasData().
|
inline |
Set the isSymmetric flag.
This should be set true if and only if the fields are known to have been computed from symmetric w fields, and the basis representation exists.
Definition at line 196 of file CFieldsReal.tpp.
References isSymmetric(), and UTIL_CHECK.
|
inlineprotected |
Get associated FieldIo object (const reference).
Definition at line 436 of file CFieldsReal.h.
References UTIL_CHECK.
Referenced by setFieldIo(), writeBasis(), writeBasis(), writeRGrid(), and writeRGrid().