PSCF v1.2

Classes

class  Pscf::Prdc::Basis< D >
 Symmetry-adapted Fourier basis for pseudo-spectral scft. More...
 
class  Pscf::Prdc::BFieldComparison
 Comparator for fields in symmetry-adapted basis format. More...
 
class  Pscf::Prdc::SpaceGroup< D >
 Crystallographic space group. More...
 
class  Pscf::Prdc::SpaceSymmetry< D >
 A SpaceSymmetry represents a crystallographic space group symmetry. More...
 
class  Pscf::Prdc::SymmetryGroup< Symmetry >
 Class template for a group of elements. More...
 
struct  Pscf::Prdc::TWave< D >
 Simple wave struct for use within Basis construction. More...
 
struct  Pscf::Prdc::TWaveNormComp< D >
 Comparator for TWave objects, based on TWave::sqNorm. More...
 
struct  Pscf::Prdc::TWaveDftComp< D >
 Comparator for TWave objects, based on TWave::indicesDft. More...
 
struct  Pscf::Prdc::TWaveBzComp< D >
 Comparator for TWave objects, based on TWave::indicesBz. More...
 
class  Pscf::Prdc::UnitCell< D >
 Base template for UnitCell<D> classes, D=1, 2 or 3. More...
 
class  Pscf::Prdc::UnitCell< 1 >
 1D crystal unit cell. More...
 
class  Pscf::Prdc::UnitCell< 2 >
 2D crystal unit cell. More...
 
class  Pscf::Prdc::UnitCell< 3 >
 3D crystal unit cell. More...
 
class  Pscf::Prdc::UnitCellBase< D >
 Base class template for a crystallographic unit cell. More...
 

Functions

template<int D>
void Pscf::Prdc::readFieldHeader (std::istream &in, int &ver1, int &ver2, UnitCell< D > &cell, std::string &groupName, int &nMonomer)
 Read common part of field header (fortran PSCF format).
 
template<int D>
void Pscf::Prdc::writeFieldHeader (std::ostream &out, int ver1, int ver2, UnitCell< D > const &cell, std::string const &groupName, int nMonomer)
 Write common part of field header (fortran PSCF format).
 
std::string Pscf::Prdc::makeGroupFileName (int D, std::string groupName)
 Generates the file name from a group name.
 
template<int D>
int Pscf::Prdc::convertFullParamIdToReduced (const int fullId, const typename UnitCell< D >::LatticeSystem lattice)
 Convert full lattice parameter index to a reduced index.
 
template<int D>
int Pscf::Prdc::convertReducedParamIdToFull (const int reducedId, const typename UnitCell< D >::LatticeSystem lattice)
 Convert reduced lattice parameter index to a full index.
 
template<int D>
IntVec< D > Pscf::Prdc::shiftToMinimum (IntVec< D > &v, IntVec< D > d, UnitCell< D > const &cell)
 Returns minimum magnitude image of DFT wavevector.
 
template<int D>
std::ostream & Pscf::Prdc::operator<< (std::ostream &out, SpaceGroup< D > const &g)
 Output stream inserter operator for a SpaceGroup<D>.
 
template<int D>
std::istream & Pscf::Prdc::operator>> (std::istream &in, SpaceGroup< D > &g)
 Input stream extractor operator for a SpaceGroup<D>.
 
template<int D>
void Pscf::Prdc::readGroup (std::string groupName, SpaceGroup< D > &group)
 Open and read a group file.
 
template<int D>
void Pscf::Prdc::writeGroup (std::string filename, SpaceGroup< D > const &group)
 Open and write a group file.
 
template<int D>
bool Pscf::Prdc::operator== (const SpaceSymmetry< D > &A, const SpaceSymmetry< D > &B)
 Are two SpaceSymmetry objects equivalent?
 
template<int D>
bool Pscf::Prdc::operator!= (const SpaceSymmetry< D > &A, const SpaceSymmetry< D > &B)
 Are two SpaceSymmetry objects not equivalent?
 
template<int D>
SpaceSymmetry< D > Pscf::Prdc::operator* (const SpaceSymmetry< D > &A, const SpaceSymmetry< D > &B)
 Return the product A*B of two symmetry objects.
 
template<int D>
IntVec< D > Pscf::Prdc::operator* (const SpaceSymmetry< D > &S, const IntVec< D > &V)
 Return the IntVec<D> product S*V of a rotation matrix and an IntVec<D>.
 
template<int D>
IntVec< D > Pscf::Prdc::operator* (const IntVec< D > &V, const SpaceSymmetry< D > &S)
 Return the IntVec<D> product V*S of an IntVec<D> and a rotation matrix.
 
template<int D>
std::ostream & Pscf::Prdc::operator<< (std::ostream &out, const SpaceSymmetry< D > &A)
 Output stream inserter for a SpaceSymmetry<D>
 
template<int D>
std::istream & Pscf::Prdc::operator>> (std::istream &in, SpaceSymmetry< D > &A)
 Input stream extractor for a SpaceSymmetry<D>
 
template<int D>
std::istream & Pscf::Prdc::operator>> (std::istream &in, UnitCell< D > &cell)
 istream input extractor for a UnitCell<D>.
 
template<int D>
std::ostream & Pscf::Prdc::operator<< (std::ostream &out, UnitCell< D > const &cell)
 ostream output inserter for a UnitCell<D>.
 
template<class Archive , int D>
void Pscf::Prdc::serialize (Archive &ar, UnitCell< D > &cell, const unsigned int version)
 Serialize to/from an archive.
 
template<int D>
void Pscf::Prdc::readUnitCellHeader (std::istream &in, UnitCell< D > &cell)
 Read UnitCell<D> from a field file header (fortran PSCF format).
 
template<int D>
void Pscf::Prdc::writeUnitCellHeader (std::ostream &out, UnitCell< D > const &cell)
 Write UnitCell<D> to a field file header (fortran PSCF format).
 
std::istream & Pscf::Prdc::operator>> (std::istream &in, UnitCell< 1 >::LatticeSystem &lattice)
 istream extractor for a 1D UnitCell<1>::LatticeSystem.
 
std::ostream & Pscf::Prdc::operator<< (std::ostream &out, UnitCell< 1 >::LatticeSystem lattice)
 ostream inserter for a 1D UnitCell<1>::LatticeSystem.
 
std::istream & Pscf::Prdc::operator>> (std::istream &in, UnitCell< 2 >::LatticeSystem &lattice)
 istream extractor for a 2D UnitCell<2>::LatticeSystem.
 
std::istream & Pscf::Prdc::operator>> (std::istream &in, UnitCell< 3 >::LatticeSystem &lattice)
 istream extractor for a 3D UnitCell<3>::LatticeSystem.
 
std::ostream & Pscf::Prdc::operator<< (std::ostream &out, UnitCell< 3 >::LatticeSystem lattice)
 ostream inserter for an 3D UnitCell<3>::LatticeSystem.
 

Detailed Description

Classes that describe crystallographic information.

Function Documentation

◆ readFieldHeader()

template<int D>
void Pscf::Prdc::readFieldHeader ( std::istream & in,
int & ver1,
int & ver2,
UnitCell< D > & cell,
std::string & groupName,
int & nMonomer )

Read common part of field header (fortran PSCF format).

If the group_name label and value are absent, then this function returns an empty groupName string, groupName == "".

Parameters
ininput stream
ver1major file format version number (output)
ver2major file format version number (output)
cellUnitCell<D> object (output)
groupNamestring identifier for space group (output)
nMonomernumber of monomers (output)

Definition at line 26 of file fieldHeader.tpp.

References Pscf::Prdc::readUnitCellHeader(), and UTIL_CHECK.

Referenced by Pscf::Rpc::System< D >::basisToKGrid(), Pscf::Rpg::System< D >::basisToKGrid(), Pscf::Rpc::System< D >::basisToRGrid(), Pscf::Rpg::System< D >::basisToRGrid(), Pscf::Rpc::System< D >::checkRGridFieldSymmetry(), Pscf::Rpg::System< D >::checkRGridFieldSymmetry(), Pscf::Rpc::System< D >::estimateWfromC(), Pscf::Rpg::System< D >::estimateWfromC(), Pscf::Rpc::System< D >::kGridToBasis(), Pscf::Rpg::System< D >::kGridToBasis(), Pscf::Rpc::System< D >::kGridToRGrid(), Pscf::Rpg::System< D >::kGridToRGrid(), 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(), Pscf::Rpg::FieldIo< D >::readFieldsRGrid(), Pscf::Rpc::Domain< D >::readRGridFieldHeader(), Pscf::Rpg::Domain< D >::readRGridFieldHeader(), Pscf::Rpc::System< D >::readWBasis(), Pscf::Rpg::System< D >::readWBasis(), Pscf::Rpc::System< D >::readWRGrid(), Pscf::Rpg::System< D >::readWRGrid(), Pscf::Rpc::System< D >::rGridToBasis(), Pscf::Rpg::System< D >::rGridToBasis(), Pscf::Rpc::System< D >::rGridToKGrid(), Pscf::Rpg::System< D >::rGridToKGrid(), Pscf::Rpc::System< D >::scaleFieldsBasis(), Pscf::Rpg::System< D >::scaleFieldsBasis(), and Pscf::Prdc::FieldIoReal< D, RField< D >, RFieldDft< D >, FFT< D > >::setFileMaster().

◆ writeFieldHeader()

template<int D>
void Pscf::Prdc::writeFieldHeader ( std::ostream & out,
int ver1,
int ver2,
UnitCell< D > const & cell,
std::string const & groupName,
int nMonomer )

Write common part of field header (fortran PSCF format).

If the groupName parameter is an empty string (groupName == ""), then this function does not write the group_name label or value.

Parameters
outoutput stream
ver1major file format version number (input)
ver2major file format version number (input)
cellUnitCell<D> object (input)
groupNamestring identifier for space group (input)
nMonomernumber of monomers (input)

Definition at line 69 of file fieldHeader.tpp.

References Pscf::Prdc::writeUnitCellHeader().

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().

◆ makeGroupFileName()

std::string Pscf::Prdc::makeGroupFileName ( int D,
std::string groupName )

Generates the file name from a group name.

Parameters
Ddimensionality of space (D=1,2 or 3)
groupNamestandard name of space group

Definition at line 26 of file groupFile.cpp.

References UTIL_THROW.

Referenced by Pscf::Prdc::readGroup().

◆ convertFullParamIdToReduced()

template<int D>
int Pscf::Prdc::convertFullParamIdToReduced ( const int fullId,
const typename UnitCell< D >::LatticeSystem lattice )

Convert full lattice parameter index to a reduced index.

Here, we define the "full" list of lattice parameters to be {a, b, c, alpha, beta, gamma}, and we define the "reduced" list of lattice parameters to be the list of independent parameters as defined by a particular lattice system (e.g., {a, c} for a tetragonal lattice). This function converts an index of a parameter in the full list, fullId, into the corresponding index in the reduced list, reducedId.

If fullId denotes a parameter that is able to vary but is not independent, then the index of the corresponding independent parameter in the reduced list is returned. For example, in a tetragonal lattice a == b, so a fullId of 1 would correspond to a reducedId of 0.

If fullId denotes a parameter that is rigid in a given lattice, then reducedId is set to -1. For example, all three angles are fixed at 90° in a tetragonal lattice, so a fullId value of 3, 4, or 5 would result in a reducedId of -1.

Parameters
fullIdthe value of fullId to convert
latticethe lattice system

Referenced by Pscf::Rpc::MaskGenFilm< D >::generate(), Pscf::Rpg::MaskGenFilm< D >::generate(), Pscf::Rpc::MaskGenFilm< D >::modifyStress(), Pscf::Rpg::MaskGenFilm< D >::modifyStress(), Pscf::Rpc::ExtGenFilm< D >::stressTerm(), Pscf::Rpc::MaskGenFilm< D >::stressTerm(), Pscf::Rpg::ExtGenFilm< D >::stressTerm(), and Pscf::Rpg::MaskGenFilm< D >::stressTerm().

◆ convertReducedParamIdToFull()

template<int D>
int Pscf::Prdc::convertReducedParamIdToFull ( const int reducedId,
const typename UnitCell< D >::LatticeSystem lattice )

Convert reduced lattice parameter index to a full index.

Here, we define the "full" list of lattice parameters to be {a, b, c, alpha, beta, gamma}, and we define the "reduced" list of lattice parameters to be the list of independent parameters as defined by a particular lattice system (e.g., {a, c} for a tetragonal lattice). This function converts an index of a parameter in the reduced list, reducedId, into the corresponding index in the full list, fullId.

Parameters
reducedIdthe value of reducedId to convert
latticethe lattice system

◆ shiftToMinimum()

template<int D>
IntVec< D > Pscf::Prdc::shiftToMinimum ( IntVec< D > & v,
IntVec< D > d,
UnitCell< D > const & cell )

Returns minimum magnitude image of DFT wavevector.

Parameters
vIntVec<D> containing integer indices of wavevector.
ddimensions of the discrete Fourier transform grid.
cellUnitCell

◆ operator<<() [1/5]

template<int D>
std::ostream & Pscf::Prdc::operator<< ( std::ostream & out,
SpaceGroup< D > const & g )

Output stream inserter operator for a SpaceGroup<D>.

Parameters
outoutput stream
gspace group

Definition at line 108 of file SpaceGroup.h.

◆ operator>>() [1/6]

template<int D>
std::istream & Pscf::Prdc::operator>> ( std::istream & in,
SpaceGroup< D > & g )

Input stream extractor operator for a SpaceGroup<D>.

Parameters
ininput stream
gspace group

Definition at line 129 of file SpaceGroup.h.

References UTIL_CHECK.

◆ readGroup()

template<int D>
void Pscf::Prdc::readGroup ( std::string groupName,
SpaceGroup< D > & group )

Open and read a group file.

Parameters
groupNamename of group, or group file (input)
groupspace group (output)

Definition at line 162 of file SpaceGroup.tpp.

References Util::Log::file(), Pscf::Prdc::SymmetryGroup< Symmetry >::makeCompleteGroup(), Pscf::Prdc::makeGroupFileName(), UTIL_CHECK, and UTIL_THROW.

◆ writeGroup()

template<int D>
void Pscf::Prdc::writeGroup ( std::string filename,
SpaceGroup< D > const & group )

Open and write a group file.

Parameters
filenameoutput file name
groupspace group

Definition at line 201 of file SpaceGroup.tpp.

◆ operator==()

template<int D>
bool Pscf::Prdc::operator== ( const SpaceSymmetry< D > & A,
const SpaceSymmetry< D > & B )

Are two SpaceSymmetry objects equivalent?

Parameters
Afirst symmetry
Bsecond symmetry
Returns
True if A == B, false otherwise

Definition at line 371 of file SpaceSymmetry.h.

◆ operator!=()

template<int D>
bool Pscf::Prdc::operator!= ( const SpaceSymmetry< D > & A,
const SpaceSymmetry< D > & B )
inline

Are two SpaceSymmetry objects not equivalent?

Parameters
Afirst symmetry
Bsecond symmetry
Returns
True if A != B, false otherwise

Definition at line 319 of file SpaceSymmetry.h.

◆ operator*() [1/3]

template<int D>
SpaceSymmetry< D > Pscf::Prdc::operator* ( const SpaceSymmetry< D > & A,
const SpaceSymmetry< D > & B )

Return the product A*B of two symmetry objects.

Parameters
Afirst symmetry
Bsecond symmetry
Returns
product A*B

Definition at line 392 of file SpaceSymmetry.h.

◆ operator*() [2/3]

template<int D>
IntVec< D > Pscf::Prdc::operator* ( const SpaceSymmetry< D > & S,
const IntVec< D > & V )

Return the IntVec<D> product S*V of a rotation matrix and an IntVec<D>.

The product is defined to be the matrix product of the rotation matrix and the integer vector S.R * V.

Parameters
Ssymmetry operation
Vinteger vector
Returns
product S*V

Definition at line 425 of file SpaceSymmetry.h.

◆ operator*() [3/3]

template<int D>
IntVec< D > Pscf::Prdc::operator* ( const IntVec< D > & V,
const SpaceSymmetry< D > & S )

Return the IntVec<D> product V*S of an IntVec<D> and a rotation matrix.

The product is defined to be the matrix product of the integer vector and the space group rotation matrix S.R * V.

Parameters
Vinteger vector
Ssymmetry operation
Returns
product V*S

Definition at line 442 of file SpaceSymmetry.h.

◆ operator<<() [2/5]

template<int D>
std::ostream & Pscf::Prdc::operator<< ( std::ostream & out,
const SpaceSymmetry< D > & A )

Output stream inserter for a SpaceSymmetry<D>

Parameters
outoutput stream
ASpaceSymmetry<D> object to be output
Returns
modified output stream

Definition at line 459 of file SpaceSymmetry.h.

◆ operator>>() [2/6]

template<int D>
std::istream & Pscf::Prdc::operator>> ( std::istream & in,
SpaceSymmetry< D > & A )

Input stream extractor for a SpaceSymmetry<D>

Parameters
ininput stream
ASpaceSymmetry<D> object to be input
Returns
modified input stream

Definition at line 479 of file SpaceSymmetry.h.

◆ operator>>() [3/6]

template<int D>
std::istream & Pscf::Prdc::operator>> ( std::istream & in,
UnitCell< D > & cell )

istream input extractor for a UnitCell<D>.

If cell.lattice() is not Null, the lattice type read from stream must match the existing lattice type, or an Exception is thrown.

Parameters
ininput stream
cellUnitCell<D> to be read
Returns
modified input stream

Definition at line 22 of file UnitCell.tpp.

◆ operator<<() [3/5]

template<int D>
std::ostream & Pscf::Prdc::operator<< ( std::ostream & out,
UnitCell< D > const & cell )

ostream output inserter for a UnitCell<D>.

Parameters
outoutput stream
cellUnitCell<D> to be written
Returns
modified output stream

Definition at line 36 of file UnitCell.tpp.

◆ serialize()

template<class Archive , int D>
void Pscf::Prdc::serialize ( Archive & ar,
UnitCell< D > & cell,
const unsigned int version )

Serialize to/from an archive.

Parameters
arinput or output archive
cellUnitCell<D> object to be serialized
versionarchive version id

Definition at line 50 of file UnitCell.tpp.

◆ readUnitCellHeader()

template<int D>
void Pscf::Prdc::readUnitCellHeader ( std::istream & in,
UnitCell< D > & cell )

Read UnitCell<D> from a field file header (fortran PSCF format).

If the unit cell has a non-null lattice system on entry, the value read from file must match this existing value, or this function throws an exception. If the lattice system is null on entry, the lattice system value is read from file. In either case, unit cell parameters (dimensions and angles) are updated using values read from file.

Parameters
ininput stream
cellUnitCell<D> to be read

Definition at line 61 of file UnitCell.tpp.

Referenced by Pscf::Prdc::readFieldHeader().

◆ writeUnitCellHeader()

template<int D>
void Pscf::Prdc::writeUnitCellHeader ( std::ostream & out,
UnitCell< D > const & cell )

Write UnitCell<D> to a field file header (fortran PSCF format).

Parameters
outoutput stream
cellUnitCell<D> to be written

Definition at line 91 of file UnitCell.tpp.

Referenced by Pscf::Prdc::writeFieldHeader().

◆ operator>>() [4/6]

std::istream & Pscf::Prdc::operator>> ( std::istream & in,
UnitCell< 1 >::LatticeSystem & lattice )

istream extractor for a 1D UnitCell<1>::LatticeSystem.

Parameters
ininput stream
latticeUnitCell<1>::LatticeSystem to be read
Returns
modified input stream

Definition at line 52 of file UnitCell1.cpp.

References UTIL_THROW.

◆ operator<<() [4/5]

std::ostream & Pscf::Prdc::operator<< ( std::ostream & out,
UnitCell< 1 >::LatticeSystem lattice )

ostream inserter for a 1D UnitCell<1>::LatticeSystem.

Parameters
outoutput stream
latticeUnitCell<1>::LatticeSystem to be written
Returns
modified output stream

Definition at line 69 of file UnitCell1.cpp.

References UTIL_THROW.

◆ operator>>() [5/6]

std::istream & Pscf::Prdc::operator>> ( std::istream & in,
UnitCell< 2 >::LatticeSystem & lattice )

istream extractor for a 2D UnitCell<2>::LatticeSystem.

Parameters
ininput stream
latticeUnitCell<2>::LatticeSystem to be read
Returns
modified input stream

Definition at line 157 of file UnitCell2.cpp.

References UTIL_THROW.

◆ operator>>() [6/6]

std::istream & Pscf::Prdc::operator>> ( std::istream & in,
UnitCell< 3 >::LatticeSystem & lattice )

istream extractor for a 3D UnitCell<3>::LatticeSystem.

Parameters
ininput stream
latticeUnitCell<3>::LatticeSystem to be read
Returns
modified input stream

Definition at line 326 of file UnitCell3.cpp.

References UTIL_THROW.

◆ operator<<() [5/5]

std::ostream & Pscf::Prdc::operator<< ( std::ostream & out,
UnitCell< 3 >::LatticeSystem lattice )

ostream inserter for an 3D UnitCell<3>::LatticeSystem.

Parameters
outoutput stream
latticeUnitCell<3>::LatticeSystem to be written
Returns
modified output stream

Definition at line 361 of file UnitCell3.cpp.

References UTIL_THROW.