|
PSCF v1.4.0
|
A list of c fields stored in both basis and r-grid format. More...
#include <CFields.h>
Public Member Functions | |
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 | |
| CFields () | |
| Constructor. | |
| ~CFields ()=default | |
| Destructor. | |
| 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:
Field Representations : A CFields container has 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 (read/write) access to both field representations, and does not automatically update one of these field representations when the other is modified.
Subclasses : Specializations of this class template are used as base classes for two closely analogous class templates, also named CFields, that are defined in Rpc and Rpg namespaces for use in the pscf_rpc and pscf_rpg programs, respectively.
Definition at line 69 of file rp/field/CFields.h.
|
protected |
Constructor.
Definition at line 24 of file rp/field/CFields.tpp.
|
protecteddefault |
Destructor.
| void Pscf::Rp::CFields< D, RFT, FIT >::setFieldIo | ( | FIT const & | fieldIo | ) |
Create association with FIT (store pointer).
| fieldIo | associated FIT (FieldIo) object |
Definition at line 41 of file rp/field/CFields.tpp.
References fieldIo().
| void Pscf::Rp::CFields< 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 48 of file rp/field/CFields.tpp.
References UTIL_CHECK.
| void Pscf::Rp::CFields< 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 58 of file rp/field/CFields.tpp.
References UTIL_CHECK.
Referenced by allocate().
| void Pscf::Rp::CFields< 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 70 of file rp/field/CFields.tpp.
References UTIL_CHECK.
Referenced by allocate().
| void Pscf::Rp::CFields< 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 87 of file rp/field/CFields.tpp.
References UTIL_CHECK.
Referenced by allocate().
| void Pscf::Rp::CFields< 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 105 of file rp/field/CFields.tpp.
References allocateBasis(), allocateRGrid(), and setNMonomer().
|
inline |
Get array of all fields in basis format (non-const).
Definition at line 346 of file rp/field/CFields.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 354 of file rp/field/CFields.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 362 of file rp/field/CFields.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 370 of file rp/field/CFields.h.
References UTIL_ASSERT.
|
inline |
Get array of all fields in r-grid format (non-const).
Definition at line 379 of file rp/field/CFields.h.
References UTIL_ASSERT.
|
inline |
Get array of all fields in r-grid format (const).
Definition at line 387 of file rp/field/CFields.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 395 of file rp/field/CFields.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 403 of file rp/field/CFields.h.
References UTIL_ASSERT.
| void Pscf::Rp::CFields< 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 119 of file rp/field/CFields.tpp.
Referenced by writeBasis().
| void Pscf::Rp::CFields< 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 136 of file rp/field/CFields.tpp.
References fieldIo(), and writeBasis().
| void Pscf::Rp::CFields< 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 148 of file rp/field/CFields.tpp.
References fieldIo(), and UTIL_CHECK.
Referenced by writeRGrid().
| void Pscf::Rp::CFields< 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 167 of file rp/field/CFields.tpp.
References fieldIo(), and writeRGrid().
|
inline |
Has memory been allocated for fields in r-grid format?
Definition at line 411 of file rp/field/CFields.h.
|
inline |
Has memory been allocated for fields in basis format?
Definition at line 416 of file rp/field/CFields.h.
|
inline |
Does this container have up-to-date fields?
Definition at line 421 of file rp/field/CFields.h.
Referenced by setHasData().
|
inline |
Are the fields invariant under elements of the space group?
Definition at line 426 of file rp/field/CFields.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 179 of file rp/field/CFields.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 189 of file rp/field/CFields.tpp.
References isSymmetric(), and UTIL_CHECK.
|
inlineprotected |
Get associated FieldIo object (const reference).
Definition at line 433 of file rp/field/CFields.h.
References UTIL_CHECK.
Referenced by setFieldIo(), writeBasis(), writeRGrid(), and writeRGrid().