PSCF v1.2
|
Classes | |
class | Pscf::Prdc::FieldIoReal< D, RFRT, RFKT, FFTT > |
File input/output operations and format conversions for fields. More... | |
class | Pscf::Prdc::MaskTmpl< D, FieldIo, RField > |
Container for a field to which the total density is constrained. More... | |
Functions | |
template<int D, class FT > | |
void | Pscf::Prdc::checkAllocateField (FT &field, IntVec< D > const &dimensions) |
Check allocation of a single field, allocate if necessary. | |
template<int D, class FT > | |
void | Pscf::Prdc::checkAllocateFields (DArray< FT > &fields, int nMonomer, IntVec< D > const &dimensions) |
Check allocation of an array of fields, allocate if necessary. | |
template<int D, class FT > | |
void | Pscf::Prdc::inspectFields (DArray< FT > const &fields, int &nMonomer, IntVec< D > &dimensions) |
Inspect dimensions of a DArray of fields, each of type FT. | |
template<int D, class AT > | |
void | Pscf::Prdc::checkAllocateArrays (DArray< AT > &arrays, int nMonomer, int capacity) |
Check allocation of a DArray of 1D arrays, allocate if necessary. | |
template<class AT > | |
void | Pscf::Prdc::inspectArrays (DArray< AT > const &arrays, int &nMonomer, int &capacity) |
Inspect dimensions of a DArray of 1D arrays, each of type AT. | |
template<int D> | |
void | Pscf::Prdc::readMeshDimensions (std::istream &in, IntVec< D > const &meshDimensions) |
Read mesh dimensions from a field file header. | |
template<int D> | |
void | Pscf::Prdc::writeMeshDimensions (std::ostream &out, IntVec< D > const &meshDimensions) |
Write mesh dimensions to a field file header. | |
template<int D, class AT > | |
void | Pscf::Prdc::readRGridData (std::istream &in, DArray< AT > &fields, int nMonomer, IntVec< D > const &dimensions) |
Read data for array of r-grid fields, with no header section. | |
template<int D, class AT > | |
void | Pscf::Prdc::readRGridData (std::istream &in, AT &field, IntVec< D > const &dimensions) |
Read data for a single r-grid field, with no header section. | |
template<int D, class AT > | |
void | Pscf::Prdc::writeRGridData (std::ostream &out, DArray< AT > const &fields, int nMonomer, IntVec< D > const &dimensions) |
Write data for array of r-grid fields, with no header section. | |
template<int D, class AT > | |
void | Pscf::Prdc::writeRGridData (std::ostream &out, AT const &field, IntVec< D > const &dimensions) |
Write data for a single r-grid field, with no header section. | |
template<int D, class AT > | |
void | Pscf::Prdc::readKGridData (std::istream &in, DArray< AT > &fields, int nMonomer, IntVec< D > const &dftDimensions) |
Read data for array of k-grid fields, with no header section. | |
template<int D, class AT > | |
void | Pscf::Prdc::readKGridData (std::istream &in, AT &field, IntVec< D > const &dftDimensions) |
Read data for a single k-grid field, with no header section. | |
template<int D, class AT > | |
void | Pscf::Prdc::writeKGridData (std::ostream &out, DArray< AT > const &fields, int nMonomer, IntVec< D > const &dftDimensions) |
Write data for array of k-grid fields, with no header section. | |
template<int D, class AT > | |
void | Pscf::Prdc::writeKGridData (std::ostream &in, AT const &field, IntVec< D > const &dftDimensions) |
Write data for a single k-grid field, with no header section. | |
int | Pscf::Prdc::readNBasis (std::istream &in) |
Read the number of basis functions from a basis field file header. | |
void | Pscf::Prdc::writeNBasis (std::ostream &out, int nBasis) |
Write the number of basis functions to a basis field file header. | |
template<int D> | |
void | Pscf::Prdc::readBasisData (std::istream &in, DArray< DArray< double > > &fields, UnitCell< D > const &unitCell, Mesh< D > const &mesh, Basis< D > const &basis, int nStarIn) |
Read a set of fields in basis format. | |
template<int D> | |
void | Pscf::Prdc::writeBasisData (std::ostream &out, DArray< DArray< double > > const &fields, Basis< D > const &basis) |
Write array of fields in basis format, without a header. | |
template<int D, class AT > | |
void | Pscf::Prdc::convertBasisToKGrid (DArray< double > const &components, AT &dft, Basis< D > const &basis, IntVec< D > const &dftDimensions) |
Convert a real field from symmetrized basis to Fourier grid. | |
template<int D, class AT > | |
void | Pscf::Prdc::convertKGridToBasis (AT const &in, DArray< double > &out, Basis< D > const &basis, IntVec< D > const &dftDimensions, bool checkSymmetry=true, double epsilon=1.0e-8) |
Convert a real field from Fourier grid to symmetrized basis. | |
template<int D, class AT > | |
bool | Pscf::Prdc::hasSymmetry (AT const &in, Basis< D > const &basis, IntVec< D > const &dftDimensions, double epsilon=1.0e-8, bool verbose=true) |
Check if a k-grid field has the declared space group symmetry. | |
template<int D, class AT > | |
void | Pscf::Prdc::replicateUnitCell (std::ostream &out, DArray< AT > const &fields, IntVec< D > const &meshDimensions, UnitCell< D > const &unitCell, IntVec< D > const &replicas) |
Write r-grid fields in a replicated unit cell to std::ostream. | |
template<int D, class AT > | |
void | Pscf::Prdc::expandRGridDimension (std::ostream &out, DArray< AT > const &fields, IntVec< D > const &meshDimensions, UnitCell< D > const &unitCell, int d, DArray< int > newGridDimensions) |
Expand the dimensionality of space from D to d. | |
Utilities for field IO operations.
void Pscf::Prdc::checkAllocateField | ( | FT & | field, |
IntVec< D > const & | dimensions ) |
Check allocation of a single field, allocate if necessary.
Template parameter FT is a field type, such as RField<D> or RFieldDft<D>, that has an allocate function that takes an IntVec<D> of mesh dimensions, and a dimensions function that returns an IntVec<D> of mesh dimensions.
On successful exit, the mesh dimensions for the field are equal to those given in parameter meshDimensions.
If the field is allocated on entry, the above condition is checked, and an Exception is thrown if is violated. If the fields is not allocated on entry, it is allocated with the correct dimensions.
field | field object of type FT |
dimensions | required mesh dimensions |
Definition at line 37 of file fieldIoUtil.tpp.
References UTIL_CHECK.
Referenced by Pscf::Prdc::FieldIoReal< D, RFRT, RFKT, FFTT >::convertBasisToRGrid(), Pscf::Prdc::FieldIoReal< D, RFRT, RFKT, FFTT >::convertRGridToBasis(), Pscf::Prdc::FieldIoReal< D, RFRT, RFKT, FFTT >::hasSymmetry(), Pscf::Rpc::FieldIo< D >::readFieldRGrid(), Pscf::Rpg::FieldIo< D >::readFieldRGrid(), and Pscf::Prdc::FieldIoReal< D, RField< D >, RFieldDft< D >, FFT< D > >::readFieldsRGrid().
void Pscf::Prdc::checkAllocateFields | ( | DArray< FT > & | fields, |
int | nMonomer, | ||
IntVec< D > const & | dimensions ) |
Check allocation of an array of fields, allocate if necessary.
Template parameter FT is a field type, such as RField<D> or RFieldDft<D>, that has an allocate function that takes an IntVec<D> of mesh dimensions, and a dimensions function that returns an IntVec<D> of mesh dimensions.
On successful exit, the capacity of the DArray fields is equal to nMonomer, and the mesh dimensions for each field are equal to those given in parameter meshDimensions.
If the fields array is allocated on entry, the above conditions are checked, and an Exception is thrown if any are not met. If the arrray is not allocated on entry, it is allocated with the required dimensions.
fields | DArray of fields of type FT (in/out) |
nMonomer | required number of monomer types (in) |
dimensions | required mesh dimensions (in) |
Definition at line 51 of file fieldIoUtil.tpp.
References Util::DArray< T >::allocate(), Util::Array< Data >::capacity(), Util::DArray< T >::isAllocated(), and UTIL_CHECK.
Referenced by Pscf::Rpc::FieldIo< D >::readFieldsKGrid(), Pscf::Rpg::FieldIo< D >::readFieldsKGrid(), Pscf::Rpc::FieldIo< D >::readFieldsRGrid(), Pscf::Rpg::FieldIo< D >::readFieldsRGrid(), Pscf::Rpc::FieldIo< D >::readFieldsRGridData(), and Pscf::Rpg::FieldIo< D >::readFieldsRGridData().
void Pscf::Prdc::inspectFields | ( | DArray< FT > const & | fields, |
int & | nMonomer, | ||
IntVec< D > & | dimensions ) |
Inspect dimensions of a DArray of fields, each of type FT.
Template parameter AT is an allocatable array type, such as Util::DArray<double> or Pscf::HostDArray<double>, that has an allocate function that takes an integer capacity as its only parameter.
An Exception is thrown if fields is not allocated, or if the fields do not all have the same positive list of dimensions.
fields | DArray of fields (in) |
nMonomer | number of fields, or monomer types (out) |
dimensions | dimensions mesh for each field (out) |
Definition at line 74 of file fieldIoUtil.tpp.
References Util::Array< Data >::capacity(), Util::DArray< T >::isAllocated(), and UTIL_CHECK.
Referenced by Pscf::Prdc::FieldIoReal< D, RFRT, RFKT, FFTT >::convertKGridToBasis(), Pscf::Prdc::FieldIoReal< D, RFRT, RFKT, FFTT >::convertRGridToBasis(), Pscf::Rpg::FieldIo< D >::expandRGridDimension(), Pscf::Rpc::FieldIo< D >::replicateUnitCell(), Pscf::Rpg::FieldIo< D >::replicateUnitCell(), Pscf::Prdc::FieldIoReal< D, RField< D >, RFieldDft< D >, FFT< D > >::writeFieldsBasis(), Pscf::Rpc::FieldIo< D >::writeFieldsKGrid(), Pscf::Rpg::FieldIo< D >::writeFieldsKGrid(), Pscf::Rpc::FieldIo< D >::writeFieldsRGrid(), and Pscf::Rpg::FieldIo< D >::writeFieldsRGrid().
void Pscf::Prdc::checkAllocateArrays | ( | DArray< AT > & | arrays, |
int | nMonomer, | ||
int | capacity ) |
Check allocation of a DArray of 1D arrays, allocate if necessary.
Template parameter AT is an allocatable array type, such as Util::DArray<double> or Pscf::HostDArray<double>, that has an allocate function that takes an integer capacity as its only parameter.
On successful exit, the capacity of the arrays container is equal to the parameter nMonomer, and the capacity for each element of type AT is equal to the parameter capacity.
If the container arrays is allocated on entry, the above conditions are checked, and an Exception is thrown if any are violated. If arrays is not allocated on entry, it is allocated with the required dimensions.
arrays | DArray of arrays, each of type AT (in/out) |
nMonomer | required number of arrays, or monomer types (in) |
capacity | required capacity of each array (in) |
void Pscf::Prdc::inspectArrays | ( | DArray< AT > const & | arrays, |
int & | nMonomer, | ||
int & | capacity ) |
Inspect dimensions of a DArray of 1D arrays, each of type AT.
An Exception is thrown if the arrays container is not allocated, or if the 1D arrays do not all have the same positive capacity.
arrays | DArray of arrays (in) |
nMonomer | number of arrays, or monomer types (out) |
capacity | capacity of each array (out) |
Definition at line 115 of file fieldIoUtil.tpp.
References Util::Array< Data >::capacity(), Util::DArray< T >::isAllocated(), and UTIL_CHECK.
Referenced by Pscf::Prdc::FieldIoReal< D, RFRT, RFKT, FFTT >::convertKGridToBasis(), Pscf::Prdc::FieldIoReal< D, RFRT, RFKT, FFTT >::convertRGridToBasis(), Pscf::Prdc::FieldIoReal< D, RField< D >, RFieldDft< D >, FFT< D > >::setFileMaster(), Pscf::Prdc::FieldIoReal< D, RFRT, RFKT, FFTT >::writeFieldsBasis(), and Pscf::Prdc::FieldIoReal< D, RField< D >, RFieldDft< D >, FFT< D > >::writeFieldsBasis().
void Pscf::Prdc::readMeshDimensions | ( | std::istream & | in, |
IntVec< D > const & | meshDimensions ) |
Read mesh dimensions from a field file header.
An Exception is thrown if the mesh dimensions in the file do not match those given by the input vector meshDimensions.
in | input stream |
meshDimensions | expected values for mesh dimensions |
Definition at line 133 of file fieldIoUtil.tpp.
References Util::Log::file(), and UTIL_THROW.
Referenced by Pscf::Rpc::FieldIo< D >::readFieldRGrid(), Pscf::Rpg::FieldIo< D >::readFieldRGrid(), Pscf::Rpc::FieldIo< D >::readFieldsKGrid(), Pscf::Rpg::FieldIo< D >::readFieldsKGrid(), Pscf::Rpc::FieldIo< D >::readFieldsRGrid(), and Pscf::Rpg::FieldIo< D >::readFieldsRGrid().
void Pscf::Prdc::writeMeshDimensions | ( | std::ostream & | out, |
IntVec< D > const & | meshDimensions ) |
Write mesh dimensions to a field file header.
out | output stream |
meshDimensions | vector of integer mesh dimensions |
Definition at line 159 of file fieldIoUtil.tpp.
Referenced by Pscf::Rpc::FieldIo< D >::writeFieldRGrid(), Pscf::Rpg::FieldIo< D >::writeFieldRGrid(), Pscf::Rpc::FieldIo< D >::writeFieldsKGrid(), Pscf::Rpg::FieldIo< D >::writeFieldsKGrid(), Pscf::Rpc::FieldIo< D >::writeFieldsRGrid(), and Pscf::Rpg::FieldIo< D >::writeFieldsRGrid().
void Pscf::Prdc::readRGridData | ( | std::istream & | in, |
DArray< AT > & | fields, | ||
int | nMonomer, | ||
IntVec< D > const & | dimensions ) |
Read data for array of r-grid fields, with no header section.
This function reads the data section of the rgrid-field format for multiple monomer types, with no header.
The template parameter AT must be an array type that provides an overloaded [] subscript operator.
in | input file stream |
fields | array of r-grid fields (r-space grid) (out) |
nMonomer | number of monomer types (in) |
dimensions | vector of mesh dimensions (in) |
Referenced by Pscf::Rpc::FieldIo< D >::readFieldRGrid(), Pscf::Rpg::FieldIo< D >::readFieldRGrid(), Pscf::Rpc::FieldIo< D >::readFieldsRGrid(), Pscf::Rpg::FieldIo< D >::readFieldsRGrid(), Pscf::Rpc::FieldIo< D >::readFieldsRGridData(), and Pscf::Rpg::FieldIo< D >::readFieldsRGridData().
void Pscf::Prdc::readRGridData | ( | std::istream & | in, |
AT & | field, | ||
IntVec< D > const & | dimensions ) |
Read data for a single r-grid field, with no header section.
This function reads the data section of an rgrid-field format for a single monomer type, with no header.
The template parameter AT must be an array type that provides an overloaded [] subscript operator.
in | input file stream |
field | array containing a single r-grid field (out) |
dimensions | vector of mesh dimensions (in) |
void Pscf::Prdc::writeRGridData | ( | std::ostream & | out, |
DArray< AT > const & | fields, | ||
int | nMonomer, | ||
IntVec< D > const & | dimensions ) |
Write data for array of r-grid fields, with no header section.
This function writes the data section of the rgrid-field format for a multiple monomer types, with no header section.
The template parameter AT must be an array type that provides an overloaded [] subscript operator.
out | output file stream |
fields | array of r-grid fields (r-space grid) (in) |
nMonomer | number of monomer types (in) |
dimensions | vector of mesh dimensions (in) |
Referenced by Pscf::Rpc::FieldIo< D >::writeFieldRGrid(), Pscf::Rpg::FieldIo< D >::writeFieldRGrid(), Pscf::Rpc::FieldIo< D >::writeFieldsRGrid(), and Pscf::Rpg::FieldIo< D >::writeFieldsRGrid().
void Pscf::Prdc::writeRGridData | ( | std::ostream & | out, |
AT const & | field, | ||
IntVec< D > const & | dimensions ) |
Write data for a single r-grid field, with no header section.
This function writes the data section of an rgrid-field format for a single monomer type, with no header.
The template parameter AT must be an array type that provides an overloaded [] subscript operator.
out | output file stream |
field | array containing a single r-grid field (out) |
dimensions | vector of mesh dimensions |
void Pscf::Prdc::readKGridData | ( | std::istream & | in, |
DArray< AT > & | fields, | ||
int | nMonomer, | ||
IntVec< D > const & | dftDimensions ) |
Read data for array of k-grid fields, with no header section.
This function reads the data section of the kgrid-field format for multiple monomer types, with no header.
The template parameter AT must be an array type that provides an overloaded [] subscript operator.
in | input file stream |
fields | array of k-grid fields (r-space grid) (out) |
nMonomer | number of monomer types (in) |
dftDimensions | dimensions of real DFT mesh (in) |
Referenced by Pscf::Rpc::FieldIo< D >::readFieldsKGrid(), and Pscf::Rpg::FieldIo< D >::readFieldsKGrid().
void Pscf::Prdc::readKGridData | ( | std::istream & | in, |
AT & | field, | ||
IntVec< D > const & | dftDimensions ) |
Read data for a single k-grid field, with no header section.
This function reads the data section of an kgrid-field format for a single monomer type, with no header.
The template parameter AT must be an array type that provides an overloaded [] subscript operator.
in | input file stream |
field | array containing a single k-grid field (out) |
dftDimensions | dimensions of real DFT mesh (in) |
void Pscf::Prdc::writeKGridData | ( | std::ostream & | out, |
DArray< AT > const & | fields, | ||
int | nMonomer, | ||
IntVec< D > const & | dftDimensions ) |
Write data for array of k-grid fields, with no header section.
This function writes the data section of a k-grid field file for a a multiple monomer type, with no header section.
The template parameter AT must be an array type that provides an overloaded [] subscript operator.
out | output file stream |
fields | array of k-grid fields (r-space grid) (in) |
nMonomer | number of monomer types (in) |
dftDimensions | dimensions of real DFT mesh (in) |
Referenced by Pscf::Rpc::FieldIo< D >::writeFieldsKGrid(), and Pscf::Rpg::FieldIo< D >::writeFieldsKGrid().
void Pscf::Prdc::writeKGridData | ( | std::ostream & | in, |
AT const & | field, | ||
IntVec< D > const & | dftDimensions ) |
Write data for a single k-grid field, with no header section.
This function writes the data section of a k-grid field file for a single monomer type, with no header.
The template parameter AT must be an array type that provides an overloaded [] subscript operator.
in | input file stream |
field | array containing a single k-grid field (in) |
dftDimensions | dimensions of real DFT mesh (in) |
int Pscf::Prdc::readNBasis | ( | std::istream & | in | ) |
Read the number of basis functions from a basis field file header.
in | input stream |
Definition at line 352 of file fieldIoUtil.tpp.
References UTIL_CHECK, and UTIL_THROW.
Referenced by Pscf::Prdc::FieldIoReal< D, RField< D >, RFieldDft< D >, FFT< D > >::setFileMaster().
void Pscf::Prdc::writeNBasis | ( | std::ostream & | out, |
int | nBasis ) |
Write the number of basis functions to a basis field file header.
out | output stream |
nBasis | number of basis functions |
Definition at line 378 of file fieldIoUtil.tpp.
void Pscf::Prdc::readBasisData | ( | std::istream & | in, |
DArray< DArray< double > > & | fields, | ||
UnitCell< D > const & | unitCell, | ||
Mesh< D > const & | mesh, | ||
Basis< D > const & | basis, | ||
int | nStarIn ) |
Read a set of fields in basis format.
The field header should be read before calling this function to obtain the number of basis functions in the input file, which is passed to this function as parameter nStarIn.
On input, the capacity of the fields array must equal the number of monomer types represented by data columns in the input file. The DArray<double> arrays associated with different monomer types must all of the same nonzero capacity, denoted by fieldCapacity. The number of basis functions that are processes is the smallar of nStarIn (the number available in the file) and fieldCapacity (the number for which there is room in the arrays).
in | input file stream |
fields | array of field components |
unitCell | associated crystallographic unit cell |
mesh | associated computational mesh |
basis | associated symmetry adapted basis |
nStarIn | number of stars declared in headers |
Definition at line 388 of file fieldIoUtil.tpp.
References Util::DArray< T >::allocate(), Pscf::Prdc::Basis< D >::Star::basisId, Pscf::Prdc::Basis< D >::Star::beginId, Pscf::Prdc::Basis< D >::Star::cancel, Util::Array< Data >::capacity(), Pscf::Prdc::Basis< D >::Wave::coeff, Pscf::Mesh< D >::dimensions(), Util::Log::file(), Pscf::imag(), Pscf::Prdc::Basis< D >::Star::invertFlag, Util::DArray< T >::isAllocated(), Pscf::Prdc::Basis< D >::isInitialized(), Pscf::Vec< D, T >::negate(), Pscf::real(), Pscf::Mesh< D >::shift(), Pscf::Prdc::Basis< D >::Star::size, Pscf::Prdc::Basis< D >::star(), Pscf::Prdc::Basis< D >::Wave::starId, UTIL_CHECK, UTIL_THROW, Pscf::Prdc::Basis< D >::wave(), Pscf::Prdc::Basis< D >::Star::waveBz, and Pscf::Prdc::Basis< D >::waveId().
void Pscf::Prdc::writeBasisData | ( | std::ostream & | out, |
DArray< DArray< double > > const & | fields, | ||
Basis< D > const & | basis ) |
Write array of fields in basis format, without a header.
The number of monomer types is given by the capacity of the fields array. On entry, the DArray<double> arrays associated with different monomer types must all of the same nonzero capacity, denoted by fieldCapacity. The number of basis functions written is the lesser fieldCapacity and the number of uncancelled basis functions in the basis.
out | output file stream |
fields | array of field components |
basis | associated symmetry adapted basis |
Definition at line 639 of file fieldIoUtil.tpp.
References Pscf::Prdc::Basis< D >::Star::cancel, Util::Array< Data >::capacity(), Pscf::Prdc::Basis< D >::isInitialized(), Pscf::Prdc::Basis< D >::nStar(), Pscf::Prdc::Basis< D >::Star::size, Pscf::Prdc::Basis< D >::star(), UTIL_CHECK, and Pscf::Prdc::Basis< D >::Star::waveBz.
void Pscf::Prdc::convertBasisToKGrid | ( | DArray< double > const & | components, |
AT & | dft, | ||
Basis< D > const & | basis, | ||
IntVec< D > const & | dftDimensions ) |
Convert a real field from symmetrized basis to Fourier grid.
components | coefficients of symmetry-adapted basis functions |
dft | discrete Fourier transform of a real field |
basis | associated symmetry adapted basis (in) |
dftDimensions | dimensions of real DFT mesh (in) |
Referenced by Pscf::Rpc::FieldIo< D >::convertBasisToKGrid(), Pscf::Rpg::FieldIo< D >::convertBasisToKGrid(), Pscf::Prdc::FieldIoReal< D, RField< D >, RFieldDft< D >, FFT< D > >::readFieldsRGrid(), and Pscf::Prdc::FieldIoReal< D, RField< D >, RFieldDft< D >, FFT< D > >::writeFieldsBasis().
void Pscf::Prdc::convertKGridToBasis | ( | AT const & | in, |
DArray< double > & | out, | ||
Basis< D > const & | basis, | ||
IntVec< D > const & | dftDimensions, | ||
bool | checkSymmetry = true, | ||
double | epsilon = 1.0e-8 ) |
Convert a real field from Fourier grid to symmetrized basis.
If the checkSymmetry parameter is true, this function checks if the input field satisfies the space group symmetry to within a tolerance given by the epsilon parameter, and prints a warning to Log::file() if it does not.
in | discrete Fourier transform (k-grid) of a field |
out | components of field in asymmetry-adapted Fourier basis |
basis | associated symmetry adapted basis (in) |
dftDimensions | dimensions of real DFT mesh (in) |
checkSymmetry | flag indicating whether to check symmetry |
epsilon | error tolerance for symmetry test (if any) |
Referenced by Pscf::Prdc::FieldIoReal< D, RFRT, RFKT, FFTT >::convertKGridToBasis(), Pscf::Rpc::FieldIo< D >::convertKGridToBasis(), Pscf::Rpg::FieldIo< D >::convertKGridToBasis(), and Pscf::Prdc::FieldIoReal< D, RFRT, RFKT, FFTT >::convertRGridToBasis().
bool Pscf::Prdc::hasSymmetry | ( | AT const & | in, |
Basis< D > const & | basis, | ||
IntVec< D > const & | dftDimensions, | ||
double | epsilon = 1.0e-8, | ||
bool | verbose = true ) |
Check if a k-grid field has the declared space group symmetry.
This function checks whether the discrete Fourier transform of a real field satisfies all the symmetries of a space group to within an error threshhold given by parameter epsilon. If the parameter verbose is true and the deviation from symmetry exceeds the error threshhold, errors are written to Log::file().
in | field in real space grid (r-grid) format |
basis | associated symmetry adapted basis |
dftDimensions | dimensions of real DFT mesh |
epsilon | error threshold used to test for symmetry |
verbose | if true, write error to Log::file() |
Referenced by Pscf::Prdc::FieldIoReal< D, RFRT, RFKT, FFTT >::hasSymmetry(), Pscf::Rpc::FieldIo< D >::hasSymmetry(), Pscf::Rpg::FieldIo< D >::hasSymmetry(), Pscf::Rpc::System< D >::readCommands(), Pscf::Rpg::System< D >::readCommands(), Pscf::Rpc::RGridTrajectoryReader< D >::readHeader(), and Pscf::Rpg::TrajectoryWriter< D >::writeHeader().
void Pscf::Prdc::replicateUnitCell | ( | std::ostream & | out, |
DArray< AT > const & | fields, | ||
IntVec< D > const & | meshDimensions, | ||
UnitCell< D > const & | unitCell, | ||
IntVec< D > const & | replicas ) |
Write r-grid fields in a replicated unit cell to std::ostream.
This function takes an input array of periodic fields and outputs them within an expanded unit cell in which the original input unit cell has been replicated a specified number of times in each direction. Results are written to an std::ostream output stream.
Element i of the IntVec<D> parameter named "replicas" contains the number of unit cell replicas along direction i.
out | output stream (i.e., output file) |
fields | array of RField (r-space) fields to be replicated |
meshDimensions | dimensions of original mesh for fields |
unitCell | original crystallographic unit cell |
replicas | number of unit cell replicas in each direction |
Referenced by Pscf::Prdc::FieldIoReal< D, RField< D >, RFieldDft< D >, FFT< D > >::convertBasisToRGrid(), Pscf::Rpc::System< D >::readCommands(), Pscf::Rpg::System< D >::readCommands(), Pscf::Rpc::FieldIo< D >::replicateUnitCell(), and Pscf::Rpg::FieldIo< D >::replicateUnitCell().
void Pscf::Prdc::expandRGridDimension | ( | std::ostream & | out, |
DArray< AT > const & | fields, | ||
IntVec< D > const & | meshDimensions, | ||
UnitCell< D > const & | unitCell, | ||
int | d, | ||
DArray< int > | newGridDimensions ) |
Expand the dimensionality of space from D to d.
The functions takes a list of fields defined in a D dimensional unit cell and creates and writes a set of fields in a d dimensional unit cell, for D < d <= 3, by adding (d-D) additional Bravais lattice vectors along directions orthogonal to the original D lattice vectors. The output fields, which are defined on a d dimensional mesh are taken to be independent of the coordinates associated with these d-D added directions. The resulting d dimensional fields are written to an output stream in r-grid field file format.
For example, this can be used to take a SCFT solution for a 1D lamellar structure and generate a corresponding 1D solution in 2D or 3D space. Similarly, a 2D hexagonal SCFT solution can be used to generate a hexagonal solution in 3D space.
The DArray<int> parameter newGridDimensions must have a capacity d-D, and each element contains the number of grid points in one added direction. The spacing between grid points in the added directions is taken to be the same as that associated with the first Bravais lattice vector of the D dimensional unit cell of the input fields.
out | output stream |
fields | input fields defined on a D dimensional grid |
meshDimensions | dimensions of mesh for input fields |
unitCell | unit cell for input fields |
d | dimensionality of expanded space (d > D) |
newGridDimensions | numbers of grid points in added directions |
Referenced by Pscf::Prdc::FieldIoReal< D, RFRT, RFKT, FFTT >::expandRGridDimension(), Pscf::Rpc::FieldIo< D >::expandRGridDimension(), Pscf::Rpg::FieldIo< D >::expandRGridDimension(), Pscf::Rpc::System< D >::readCommands(), and Pscf::Rpg::System< D >::readCommands().