11#include <pscf/math/IntVec.h>
12#include <util/containers/DArray.h>
16 template <
typename T>
class Signal;
17 template <>
class Signal<void>;
90 template <
int D,
class RFT,
class FIT>
379 {
return meshDimensions_; }
385 {
return meshSize_; }
444 FIT
const * fieldIoPtr_;
454 bool isAllocatedBasis_;
459 bool isAllocatedRGrid_;
479 template <
int D,
class RFT,
class FIT>
488 template <
int D,
class RFT,
class FIT>
496 template <
int D,
class RFT,
class FIT>
498 {
return isAllocatedBasis_; }
501 template <
int D,
class RFT,
class FIT>
503 {
return isAllocatedRGrid_; }
506 template <
int D,
class RFT,
class FIT>
511 template <
int D,
class RFT,
class FIT>
513 {
return isSymmetric_; }
An IntVec<D, T> is a D-component vector of elements of integer type T.
Base template for UnitCell<D> classes, D=1, 2 or 3.
bool hasData() const
Has field data been set in either format?
void allocateBasis(int nBasis)
Allocate memory for the field in basis format.
void setWriteUnitCell(UnitCell< D > const &cell)
Set unit cell used when writing a mask field file.
bool isSymmetric() const
Are field symmetric under all elements of the space group?
void setReadUnitCell(UnitCell< D > &cell)
Set unit cell used when reading a mask field file.
double phiTot() const
Return the volume fraction of unit cell occupied by material.
void readRGrid(std::istream &in, bool isSymmetric=false)
Reads field from an input stream in real-space (r-grid) format.
void readBasis(std::istream &in)
Read field from input stream in symmetrized basis format.
Signal< void > & signal()
Get a signal that notifies observers of field modification.
void setRGrid(RFT const &field, bool isSymmetric=false)
Set field values in real-space (r-grid) format.
bool isAllocatedRGrid() const
Has memory been allocated in rgrid format?
void writeRGrid(std::ostream &out) const
Writes fields to an input stream in real-space (r-grid) format.
void setBasis(DArray< double > const &field)
Set field component values, in symmetrized Fourier format.
bool isAllocatedBasis() const
Has memory been allocated in basis format?
int nBasis() const
Number of basis functions, set by allocation.
IntVec< D > const & meshDimensions() const
Mesh dimensions in each direction, set by allocation.
void setFieldIo(FIT const &fieldIo)
Create association with FieldIo (store pointer).
DArray< double > const & basis() const
Get the field in basis format.
void writeBasis(std::ostream &out) const
Write fields to an input stream in symmetrized basis format.
RFT const & rgrid() const
Get the field in r-grid format.
void allocateRGrid(IntVec< D > const &dimensions)
Allocate memory for the field in rgrid format.
FIT const & fieldIo() const
Associated FieldIo object (const reference).
int meshSize() const
Mesh size (number of grid points), set by allocation.
Dynamically allocatable contiguous array template.
Notifier (or subject) in the Observer design pattern.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
#define UTIL_ASSERT(condition)
Assertion macro suitable for debugging serial or parallel code.
Periodic fields and crystallography.
Class templates for real-valued periodic fields.
PSCF package top-level namespace.
Utility classes for scientific computation.