PSCF v1.3
|
A field to which the total monomer concentration is constrained. More...
#include <Mask.h>
Public Types | |
typedef Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > > | Base |
Base class typedef. |
Public Member Functions | |
void | setFieldIo (FieldIo< D > const &fieldIo) |
Create association with FieldIo (store pointer). | |
void | allocateBasis (int nBasis) |
Allocate memory for the field in basis format. | |
void | allocateRGrid (IntVec< D > const &dimensions) |
Allocate memory for the field in rgrid format. | |
void | setBasis (DArray< double > const &field) |
Set field component values, in symmetrized Fourier format. | |
void | setRGrid (Prdc::Cuda::RField< D > const &field, bool isSymmetric=false) |
Set field values in real-space (r-grid) format. | |
void | readBasis (std::istream &in) |
Read field from input stream in symmetrized basis format. | |
void | readBasis (std::string filename) |
Read field from a named file, in symmetrized basis format. | |
void | readRGrid (std::istream &in, bool isSymmetric=false) |
Reads field from an input stream in real-space (r-grid) format. | |
void | readRGrid (std::string filename, bool isSymmetric=false) |
Reads field from a named file, in real-space (r-grid) format. | |
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. | |
DArray< double > const & | basis () const |
Get the field in basis format. | |
Prdc::Cuda::RField< D > const & | rgrid () const |
Get the field in r-grid format. | |
double | phiTot () const |
Return the volume fraction of unit cell occupied by material. | |
bool | isAllocatedBasis () const |
Has memory been allocated in basis format? | |
bool | isAllocatedRGrid () const |
Has memory been allocated in rgrid format? | |
bool | hasData () const |
Has field data been set in either format? | |
bool | isSymmetric () const |
Are field symmetric under all elements of the space group? | |
Public Member Functions inherited from Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > > | |
MaskReal () | |
Constructor. | |
~MaskReal () | |
Destructor. | |
void | setFieldIo (FieldIo< D > const &fieldIo) |
Create association with FieldIo (store pointer). | |
void | setReadUnitCell (UnitCell< D > &cell) |
Set unit cell used when reading a mask field file. | |
void | setWriteUnitCell (UnitCell< D > const &cell) |
Set unit cell used when writing a mask field file. | |
void | allocateBasis (int nBasis) |
Allocate memory for the field in basis format. | |
void | allocateRGrid (IntVec< D > const &dimensions) |
Allocate memory for the field in rgrid format. | |
void | setBasis (DArray< double > const &field) |
Set field component values, in symmetrized Fourier format. | |
void | setRGrid (Prdc::Cuda::RField< D > const &field, bool isSymmetric=false) |
Set field values in real-space (r-grid) format. | |
void | readBasis (std::istream &in) |
Read field from input stream in symmetrized basis format. | |
void | readBasis (std::string filename) |
Read field from a named file, in symmetrized basis format. | |
void | readRGrid (std::istream &in, bool isSymmetric=false) |
Reads field from an input stream in real-space (r-grid) format. | |
void | readRGrid (std::string filename, bool isSymmetric=false) |
Reads field from a named file, in real-space (r-grid) format. | |
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. | |
DArray< double > const & | basis () const |
Get the field in basis format. | |
Prdc::Cuda::RField< D > const & | rgrid () const |
Get the field in r-grid format. | |
double | phiTot () const |
Return the volume fraction of unit cell occupied by material. | |
Signal< void > & | signal () |
Get a signal that notifies observers of field modification. | |
bool | isAllocatedBasis () const |
Has memory been allocated in basis format? | |
bool | isAllocatedRGrid () const |
Has memory been allocated in rgrid format? | |
bool | hasData () const |
Has field data been set in either format? | |
bool | isSymmetric () const |
Are field symmetric under all elements of the space group? |
Protected Member Functions | |
double | rGridAverage () const override |
Calculate the average value of the rgrid_ member. | |
IntVec< D > const & | meshDimensions () const |
Mesh dimensions in each direction, set by allocation. | |
int | meshSize () const |
Mesh size (number of grid points), set by allocation. | |
int | nBasis () const |
Number of basis functions, set by allocation. | |
FieldIo< D > const & | fieldIo () const |
Associated FieldIo object (const reference). | |
Protected Member Functions inherited from Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > > | |
IntVec< D > const & | meshDimensions () const |
Mesh dimensions in each direction, set by allocation. | |
int | meshSize () const |
Mesh size (number of grid points), set by allocation. | |
int | nBasis () const |
Number of basis functions, set by allocation. | |
FieldIo< D > const & | fieldIo () const |
Associated FieldIo object (const reference). |
A field to which the total monomer concentration is constrained.
Please refer to the documentation of the Prdc::MaskReal base class template for more complete API documentation for this class template. The public interface of Rpg::Mask is identical to that of the base class template Prdc::MaskReal.
Definition at line 31 of file rpg/field/Mask.h.
typedef Prdc::MaskReal< D, Prdc::Cuda::RField<D>, FieldIo<D> > Pscf::Rpg::Mask< D >::Base |
Base class typedef.
Definition at line 38 of file rpg/field/Mask.h.
|
overrideprotectedvirtual |
Calculate the average value of the rgrid_ member.
Implements Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >.
Definition at line 26 of file rpg/field/Mask.tpp.
References Util::Array< Data >::capacity(), Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::MaskReal(), and rgrid().
void Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::setFieldIo | ( | FieldIo< D > const & | fieldIo | ) |
void Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::allocateBasis | ( | int | nBasis | ) |
Allocate memory for the field in basis format.
An Exception will be thrown if this is called more than once.
nBasis | number of basis functions |
void Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::allocateRGrid | ( | IntVec< D > const & | dimensions | ) |
Allocate memory for the field in rgrid format.
An Exception will be thrown if this is called more than once.
dimensions | dimensions of spatial mesh |
void Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::setBasis | ( | DArray< double > const & | field | ) |
Set field component values, in symmetrized Fourier format.
This function also computes and stores the corresponding r-grid representation. On return, hasData and isSymmetric are both true.
The associated basis must be initialized on entry. As needed, r-grid and/or basis fields may be allocated within this function.
field | components of field in basis format |
void Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::setRGrid | ( | Prdc::Cuda::RField< D > const & | field, |
bool | isSymmetric = false ) |
Set field values in real-space (r-grid) format.
If the isSymmetric parameter is true, this function assumes that the field are known to be symmetric and so computes and stores the corresponding basis components. If isSymmetric is false, it only sets the values in the r-grid format.
On return, hasData is true and the persistent isSymmetric flag defined by the class is set to the value of the isSymmetric input parameter.
As needed, r-grid and/or basis fields may be allocated within this function. If the isSymmetric parameter is true, then a basis must be initialized prior to entry.
field | new field in r-grid format |
isSymmetric | is this field symmetric under the space group? |
void Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::readBasis | ( | std::istream & | in | ) |
Read field from input stream in symmetrized basis format.
This function also computes and stores the corresponding r-grid representation. On return, hasData and isSymmetric are both true.
This object must already be allocated and associated with a a FieldIo object to run this function.
As needed, r-grid and/or basis fields may be allocated within this functions, if not allocated on entry. An associated basis will be initialized if it is not initialized on entry.
in | input stream from which to read field |
void Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::readBasis | ( | std::string | filename | ) |
Read field from a named file, in symmetrized basis format.
This function also computes and stores the corresponding r-grid representation. On return, hasData and isSymmetric are both true.
As needed, r-grid and/or basis fields may be allocated within this functions, if not allocated on entry. An associated basis will be initialized if it is not initialized on entry.
filename | file from which to read field |
void Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::readRGrid | ( | std::istream & | in, |
bool | isSymmetric = false ) |
Reads field from an input stream in real-space (r-grid) format.
If the isSymmetric parameter is true, this function assumes that the field is known to be symmetric and so computes and stores the corresponding basis format. If isSymmetric is false, it only sets the values in the r-grid format.
On return, hasData is true and the persistent isSymmetric flag defined by the class is set to the value of the isSymmetric input parameter.
As needed, r-grid and/or basis fields may be allocated within this functions, if not allocated on entry. An associated basis will be initialized if it is not initialized on entry.
in | input stream from which to read field |
isSymmetric | is this field symmetric under the space group? |
void Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::readRGrid | ( | std::string | filename, |
bool | isSymmetric = false ) |
Reads field from a named file, in real-space (r-grid) format.
If the isSymmetric parameter is true, this function assumes that the field is known to be symmetric and so computes and stores the corresponding basis format. If isSymmetric is false, it only sets the values in the r-grid format.
On return, hasData is true and the persistent isSymmetric flag defined by the class is set to the value of the isSymmetric input parameter.
As needed, r-grid and/or basis fields may be allocated within this functions, if not allocated on entry. An associated basis will be initialized if it is not initialized on entry.
filename | file from which to read field |
isSymmetric | is this field symmetric under the space group? |
void Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::writeBasis | ( | std::ostream & | out | ) | const |
Write fields to an input stream in symmetrized basis format.
out | output stream to which to write fields |
void Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::writeBasis | ( | std::string | filename | ) | const |
Write fields to a named file, in symmetrized basis format.
filename | name of file to which to write fields |
void Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::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 |
void Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::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 |
DArray< double > const & Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::basis | ( | ) | const |
Get the field in basis format.
Prdc::Cuda::RField< D > const & Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::rgrid | ( | ) | const |
Get the field in r-grid format.
Referenced by rGridAverage().
double Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::phiTot | ( | ) | const |
Return the volume fraction of unit cell occupied by material.
This value is equivalent to the spatial average of the mask, which is the q=0 coefficient of the discrete Fourier transform.
If hasData == true and isSymmetric == false (i.e., data only exists in rgrid format), then this object must be associated with a FieldIo object in order to call phiTot(). In other cases, the FieldIo association is not necessary.
bool Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::isAllocatedBasis | ( | ) | const |
Has memory been allocated in basis format?
bool Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::isAllocatedRGrid | ( | ) | const |
Has memory been allocated in rgrid format?
bool Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::hasData | ( | ) | const |
Has field data been set in either format?
This flag is set true in setBasis and setRGrid.
bool Pscf::Prdc::MaskReal< D, Prdc::Cuda::RField< D >, FieldIo< D > >::isSymmetric | ( | ) | const |
Are field symmetric under all elements of the space group?
A valid basis format exists if and only if isSymmetric is true. This flat is set true if the field were input in basis format by the function setBasis, or if they were set in grid format by the function setRGrid but isSymmetric was set true.
|
inlineprotected |
Mesh dimensions in each direction, set by allocation.
Definition at line 370 of file MaskReal.h.
|
inlineprotected |
Mesh size (number of grid points), set by allocation.
Definition at line 376 of file MaskReal.h.
|
inlineprotected |
Number of basis functions, set by allocation.
Definition at line 382 of file MaskReal.h.
|
inlineprotected |
Associated FieldIo object (const reference).
Definition at line 388 of file MaskReal.h.