|
PSCF v1.5.0
|
A list of c fields stored in both basis and r-grid format. More...
#include <CFields.h>
Public Member Functions | |
| CFields () | |
| Constructor. | |
| ~CFields ()=default | |
| Destructor. | |
Initialization and Memory Management | |
| void | setFieldIo (FieldIo< D, T > const &fieldIo) |
| Create association with a FieldIo (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< RField< D, T > > & | rgrid () |
| Get array of all fields in r-grid format (non-const). | |
| DArray< RField< D, T > > const & | rgrid () const |
| Get array of all fields in r-grid format (const). | |
| RField< D, T > & | rgrid (int monomerId) |
| Get field for one monomer type in r-grid format (non-const). | |
| RField< D, T > 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 | |
| FieldIo< D, T > 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 set 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.
| Pscf::Rp::CFields< D, T >::CFields | ( | ) |
Constructor.
Definition at line 26 of file CFields.tpp.
Referenced by Pscf::Rp::System< D, T >::System().
|
default |
Destructor.
References allocate(), allocateBasis(), allocateRGrid(), fieldIo(), setFieldIo(), setNMonomer(), and setWriteUnitCell().
| void Pscf::Rp::CFields< D, T >::setFieldIo | ( | FieldIo< D, T > const & | fieldIo | ) |
Create association with a FieldIo (store pointer).
| fieldIo | associated FieldIo object |
Definition at line 43 of file CFields.tpp.
References fieldIo().
Referenced by ~CFields().
| void Pscf::Rp::CFields< D, T >::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 50 of file CFields.tpp.
References UTIL_CHECK.
Referenced by ~CFields().
| void Pscf::Rp::CFields< D, T >::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 60 of file CFields.tpp.
References UTIL_CHECK.
Referenced by allocate(), and ~CFields().
| void Pscf::Rp::CFields< D, T >::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 72 of file CFields.tpp.
References UTIL_CHECK.
Referenced by ~CFields().
| void Pscf::Rp::CFields< D, T >::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 89 of file CFields.tpp.
References UTIL_CHECK.
Referenced by ~CFields().
| void Pscf::Rp::CFields< D, T >::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 107 of file CFields.tpp.
References setNMonomer().
Referenced by ~CFields().
|
inline |
Get array of all fields in basis format (non-const).
Definition at line 334 of file 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 342 of file 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 350 of file 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 358 of file CFields.h.
References UTIL_ASSERT.
|
inline |
Get array of all fields in r-grid format (non-const).
Definition at line 367 of file CFields.h.
References UTIL_ASSERT.
|
inline |
Get array of all fields in r-grid format (const).
Definition at line 375 of file 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 383 of file 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 391 of file CFields.h.
References UTIL_ASSERT.
| void Pscf::Rp::CFields< D, T >::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 121 of file CFields.tpp.
References UTIL_CHECK.
Referenced by writeBasis().
| void Pscf::Rp::CFields< D, T >::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 138 of file CFields.tpp.
References fieldIo(), and writeBasis().
| void Pscf::Rp::CFields< D, T >::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 150 of file CFields.tpp.
References fieldIo(), and UTIL_CHECK.
Referenced by writeRGrid().
| void Pscf::Rp::CFields< D, T >::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 169 of file CFields.tpp.
References fieldIo(), and writeRGrid().
|
inline |
|
inline |
|
inline |
Does this container have up-to-date fields?
Definition at line 409 of file CFields.h.
Referenced by setHasData().
|
inline |
Are the fields invariant under elements of the space group?
Definition at line 414 of file 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 181 of file 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 191 of file CFields.tpp.
References isSymmetric(), and UTIL_CHECK.
|
inlineprotected |
Get associated FieldIo object (const reference).
Definition at line 421 of file CFields.h.
References UTIL_CHECK.
Referenced by setFieldIo(), writeBasis(), writeRGrid(), writeRGrid(), and ~CFields().