PSCF v1.1
Public Types | Public Member Functions | Friends | List of all members
Pscf::UnitCell< 3 > Class Reference

3D crystal unit cell. More...

#include <UnitCell.h>

Inheritance diagram for Pscf::UnitCell< 3 >:
Pscf::UnitCellBase< 3 >

Public Types

enum  LatticeSystem
 Enumeration of the 7 possible 3D Bravais lattice systems. More...
 

Public Member Functions

 UnitCell ()
 Constructor. More...
 
UnitCell< 3 > & operator= (const UnitCell< 3 > &other)
 Assignment operator. More...
 
void set (UnitCell< 3 >::LatticeSystem lattice)
 Set the lattice system, but not unit cell parameters. More...
 
void set (UnitCell< 3 >::LatticeSystem lattice, FSArray< double, 6 > const &parameters)
 Set the unit cell state. More...
 
LatticeSystem lattice () const
 Return lattice system enumeration value. More...
 
- Public Member Functions inherited from Pscf::UnitCellBase< 3 >
 UnitCellBase ()
 Constructor. More...
 
 ~UnitCellBase ()
 Destructor. More...
 
void setParameters (FSArray< double, 6 > const &parameters)
 Set all the parameters of unit cell. More...
 
virtual double ksq (IntVec< D > const &k) const
 Compute square magnitude of reciprocal lattice vector. More...
 
virtual double dksq (IntVec< D > const &vec, int n) const
 Compute derivative of square wavevector w/respect to cell parameter. More...
 
int nParameter () const
 Get the number of parameters in the unit cell. More...
 
FSArray< double, 6 > parameters () const
 Get the parameters of this unit cell. More...
 
double parameter (int i) const
 Get a single parameter of this unit cell. More...
 
const RealVec< D > & rBasis (int i) const
 Get Bravais basis vector i, denoted by a_i. More...
 
const RealVec< D > & kBasis (int i) const
 Get reciprocal basis vector i, denoted by b_i. More...
 
double drBasis (int k, int i, int j) const
 Get component j of derivative of rBasis vector a_i w/respect to k. More...
 
double dkBasis (int k, int i, int j) const
 Get component j of derivative of kBasis vector b_i w/respect to k. More...
 
double drrBasis (int k, int i, int j) const
 Get derivative of dot product ai.aj with respect to parameter k. More...
 
double dkkBasis (int k, int i, int j) const
 Get derivative of dot product bi.bj with respect to parameter k. More...
 
bool isInitialized () const
 Has this unit cell been initialized? More...
 

Friends

template<int D>
std::istream & operator>> (std::istream &, UnitCell< D > &)
 istream input extractor for a UnitCell<D>. More...
 
template<int D>
std::ostream & operator<< (std::ostream &, UnitCell< D > const &)
 ostream output inserter for a UnitCell<D>. More...
 
template<class Archive , int D>
void serialize (Archive &, UnitCell< D > &, const unsigned int)
 Serialize to/from an archive. More...
 
template<int D>
void readUnitCellHeader (std::istream &, UnitCell< D > &)
 Read UnitCell<D> from a field file header (fortran PSCF format). More...
 
template<int D>
void writeUnitCellHeader (std::ostream &, UnitCell< D > const &)
 Write UnitCell<D> to a field file header (fortran PSCF format). More...
 

Additional Inherited Members

- Protected Member Functions inherited from Pscf::UnitCellBase< 3 >
void setLattice ()
 Compute all private data, given latticeSystem and parameters. More...
 
- Protected Attributes inherited from Pscf::UnitCellBase< 3 >
FArray< RealVec< D >, D > rBasis_
 Array of Bravais lattice basis vectors. More...
 
FArray< RealVec< D >, D > kBasis_
 Array of reciprocal lattice basis vectors. More...
 
FArray< FMatrix< double, D, D >, 6 > drBasis_
 Array of derivatives of rBasis. More...
 
FArray< FMatrix< double, D, D >, 6 > dkBasis_
 Array of derivatives of kBasis. More...
 
FArray< FMatrix< double, D, D >, 6 > drrBasis_
 Array of derivatives of a_i.a_j. More...
 
FArray< FMatrix< double, D, D >, 6 > dkkBasis_
 Array of derivatives of b_i.b_j. More...
 
FArray< double, 6 > parameters_
 Parameters used to describe the unit cell. More...
 
int nParameter_
 Number of parameters required to specify unit cell. More...
 
bool isInitialized_
 Has this unit cell been fully initialized? More...
 

Detailed Description

3D crystal unit cell.

Definition at line 398 of file UnitCell.h.

Member Enumeration Documentation

◆ LatticeSystem

enum Pscf::UnitCell< 3 >::LatticeSystem

Enumeration of the 7 possible 3D Bravais lattice systems.

Allowed non-null values are: Cubic, Tetragonal, Orthorhombic, Monoclinic, Triclinic, Rhombohedral, and Hexagonal.

Definition at line 408 of file UnitCell.h.

Constructor & Destructor Documentation

◆ UnitCell()

Pscf::UnitCell< 3 >::UnitCell ( )

Constructor.

Definition at line 19 of file UnitCell3.cpp.

Member Function Documentation

◆ operator=()

UnitCell< 3 > & Pscf::UnitCell< 3 >::operator= ( const UnitCell< 3 > &  other)

Assignment operator.

Parameters
otherUnitCell<3> object to be cloned.

Definition at line 396 of file UnitCell3.cpp.

References Pscf::UnitCellBase< D >::nParameter_, Pscf::UnitCellBase< D >::parameters_, and UTIL_CHECK.

◆ set() [1/2]

void Pscf::UnitCell< 3 >::set ( UnitCell< 3 >::LatticeSystem  lattice)

Set the lattice system, but not unit cell parameters.

Upon return, values of lattice and nParameter are set.

Parameters
latticelattice system enumeration value

Definition at line 412 of file UnitCell3.cpp.

◆ set() [2/2]

void Pscf::UnitCell< 3 >::set ( UnitCell< 3 >::LatticeSystem  lattice,
FSArray< double, 6 > const &  parameters 
)

Set the unit cell state.

Parameters
latticelattice system enumeration value
parametersarray of unit cell parameters

Definition at line 422 of file UnitCell3.cpp.

◆ lattice()

LatticeSystem Pscf::UnitCell< 3 >::lattice ( ) const
inline

Return lattice system enumeration value.

This value is initialized to Null during construction.

Definition at line 446 of file UnitCell.h.

Friends And Related Function Documentation

◆ operator>>

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

istream input extractor for a UnitCell<D>.

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

Definition at line 22 of file UnitCell.tpp.

◆ operator<<

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

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 serialize ( Archive &  ar,
UnitCell< D > &  cell,
const unsigned int  version 
)
friend

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 readUnitCellHeader ( std::istream &  in,
UnitCell< D > &  cell 
)
friend

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.

◆ writeUnitCellHeader

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

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.


The documentation for this class was generated from the following files: