PSCF v1.3
|
2D crystal unit cell. More...
#include <UnitCell.h>
Public Types | |
enum | LatticeSystem |
Enumeration of 2D lattice system types. More... |
Public Member Functions | |
UnitCell () | |
Constructor. | |
UnitCell< 2 > & | operator= (const UnitCell< 2 > &other) |
Assignment operator. | |
void | set (UnitCell< 2 >::LatticeSystem lattice) |
Set the lattice system, but not unit cell parameters. | |
void | set (UnitCell< 2 >::LatticeSystem lattice, FSArray< double, 6 > const ¶meters) |
Set the unit cell state (lattice system and parameters). | |
LatticeSystem | lattice () const |
Return lattice system enumeration value. | |
double | volume () const |
Get the generalized volume (i.e., area) of the unit cell,. | |
Public Member Functions inherited from Pscf::Prdc::UnitCellBase< D > | |
UnitCellBase () | |
Constructor. | |
~UnitCellBase () | |
Destructor. | |
void | setParameters (FSArray< double, 6 > const ¶meters) |
Set all the parameters of unit cell. | |
int | nParameter () const |
Get the number of parameters in the unit cell. | |
FSArray< double, 6 > | parameters () const |
Get the parameters of this unit cell. | |
double | parameter (int i) const |
Get a single parameter of this unit cell. | |
bool | isInitialized () const |
Has this unit cell been initialized? | |
const RealVec< D > & | rBasis (int i) const |
Get Bravais basis vector i, denoted by a_i. | |
const RealVec< D > & | kBasis (int i) const |
Get reciprocal basis vector i, denoted by b_i. | |
double | drBasis (int k, int i, int j) const |
Get component j of derivative of rBasis vector a_i w/respect to k. | |
double | dkBasis (int k, int i, int j) const |
Get component j of derivative of kBasis vector b_i w/respect to k. | |
double | drrBasis (int k, int i, int j) const |
Get derivative of dot product ai.aj with respect to parameter k. | |
double | dkkBasis (int k, int i, int j) const |
Get derivative of dot product bi.bj with respect to parameter k. | |
virtual double | ksq (IntVec< D > const &k) const |
Compute square magnitude of reciprocal lattice vector. | |
virtual double | dksq (IntVec< D > const &vec, int n) const |
Compute derivative of square wavevector w/respect to cell parameter. | |
void | setSignal (Signal< void > &signal) |
Associating an externally defined signal with this unit cell. | |
bool | hasSignal () const |
Does this object have an associated Signal<void>? | |
Signal< void > & | signal () |
Get the associated Signal by non-const reference. | |
Public Member Functions inherited from Pscf::Prdc::UnitCellBase< 2 > | |
UnitCellBase () | |
Constructor. | |
~UnitCellBase () | |
Destructor. | |
void | setParameters (FSArray< double, 6 > const ¶meters) |
Set all the parameters of unit cell. | |
int | nParameter () const |
Get the number of parameters in the unit cell. | |
FSArray< double, 6 > | parameters () const |
Get the parameters of this unit cell. | |
double | parameter (int i) const |
Get a single parameter of this unit cell. | |
bool | isInitialized () const |
Has this unit cell been initialized? | |
const RealVec< D > & | rBasis (int i) const |
Get Bravais basis vector i, denoted by a_i. | |
const RealVec< D > & | kBasis (int i) const |
Get reciprocal basis vector i, denoted by b_i. | |
double | drBasis (int k, int i, int j) const |
Get component j of derivative of rBasis vector a_i w/respect to k. | |
double | dkBasis (int k, int i, int j) const |
Get component j of derivative of kBasis vector b_i w/respect to k. | |
double | drrBasis (int k, int i, int j) const |
Get derivative of dot product ai.aj with respect to parameter k. | |
double | dkkBasis (int k, int i, int j) const |
Get derivative of dot product bi.bj with respect to parameter k. | |
virtual double | ksq (IntVec< D > const &k) const |
Compute square magnitude of reciprocal lattice vector. | |
virtual double | dksq (IntVec< D > const &vec, int n) const |
Compute derivative of square wavevector w/respect to cell parameter. | |
void | setSignal (Signal< void > &signal) |
Associating an externally defined signal with this unit cell. | |
bool | hasSignal () const |
Does this object have an associated Signal<void>? | |
Signal< void > & | signal () |
Get the associated Signal by non-const reference. |
Friends | |
template<int D> | |
std::istream & | operator>> (std::istream &in, UnitCell< D > &cell) |
istream input extractor for a UnitCell<D>. | |
template<int D> | |
std::ostream & | operator<< (std::ostream &out, UnitCell< D > const &cell) |
ostream output inserter for a UnitCell<D>. | |
template<class Archive, int D> | |
void | serialize (Archive &ar, UnitCell< D > &cell, const unsigned int version) |
Serialize to/from an archive. | |
template<int D> | |
void | readUnitCellHeader (std::istream &in, UnitCell< D > &cell) |
Read UnitCell<D> from a field file header (fortran PSCF format). | |
template<int D> | |
void | writeUnitCellHeader (std::ostream &out, UnitCell< D > const &cell) |
Write UnitCell<D> to a field file header (fortran PSCF format). |
Additional Inherited Members | |
Protected Member Functions inherited from Pscf::Prdc::UnitCellBase< D > | |
void | setLattice () |
Compute all protected data, given latticeSystem and parameters. | |
Protected Member Functions inherited from Pscf::Prdc::UnitCellBase< 2 > | |
void | setLattice () |
Compute all protected data, given latticeSystem and parameters. | |
Protected Attributes inherited from Pscf::Prdc::UnitCellBase< D > | |
FArray< RealVec< D >, D > | rBasis_ |
Array of Bravais lattice basis vectors. | |
FArray< RealVec< D >, D > | kBasis_ |
Array of reciprocal lattice basis vectors. | |
FArray< FMatrix< double, D, D >, 6 > | drBasis_ |
Array of derivatives of rBasis. | |
FArray< FMatrix< double, D, D >, 6 > | dkBasis_ |
Array of derivatives of kBasis. | |
FArray< FMatrix< double, D, D >, 6 > | drrBasis_ |
Array of derivatives of a_i.a_j. | |
FArray< FMatrix< double, D, D >, 6 > | dkkBasis_ |
Array of derivatives of b_i.b_j. | |
FArray< double, 6 > | parameters_ |
Parameters used to describe the unit cell. | |
int | nParameter_ |
Number of parameters required to specify unit cell. | |
bool | isInitialized_ |
Has this unit cell been fully initialized? | |
Protected Attributes inherited from Pscf::Prdc::UnitCellBase< 2 > | |
FArray< RealVec< D >, D > | rBasis_ |
Array of Bravais lattice basis vectors. | |
FArray< RealVec< D >, D > | kBasis_ |
Array of reciprocal lattice basis vectors. | |
FArray< FMatrix< double, D, D >, 6 > | drBasis_ |
Array of derivatives of rBasis. | |
FArray< FMatrix< double, D, D >, 6 > | dkBasis_ |
Array of derivatives of kBasis. | |
FArray< FMatrix< double, D, D >, 6 > | drrBasis_ |
Array of derivatives of a_i.a_j. | |
FArray< FMatrix< double, D, D >, 6 > | dkkBasis_ |
Array of derivatives of b_i.b_j. | |
FArray< double, 6 > | parameters_ |
Parameters used to describe the unit cell. | |
int | nParameter_ |
Number of parameters required to specify unit cell. | |
bool | isInitialized_ |
Has this unit cell been fully initialized? |
2D crystal unit cell.
Definition at line 248 of file UnitCell.h.
enum Pscf::Prdc::UnitCell< 2 >::LatticeSystem |
Enumeration of 2D lattice system types.
Definition at line 255 of file UnitCell.h.
Pscf::Prdc::UnitCell< 2 >::UnitCell | ( | ) |
Constructor.
Definition at line 21 of file UnitCell2.cpp.
References UnitCell().
Referenced by operator=(), set(), set(), UnitCell(), and volume().
UnitCell< 2 > & Pscf::Prdc::UnitCell< 2 >::operator= | ( | const UnitCell< 2 > & | other | ) |
Assignment operator.
Copies lattice type and unit cell parameters, and recomputes all data that depends on the unit cell parameters, but does not copy any associated Signal<> object.
other | UnitCell<2> object to be cloned. |
Definition at line 159 of file UnitCell2.cpp.
References Pscf::Prdc::UnitCellBase< D >::isInitialized_, Pscf::Prdc::UnitCellBase< D >::nParameter_, Pscf::Prdc::UnitCellBase< D >::parameters_, Pscf::Prdc::UnitCellBase< D >::setLattice(), UnitCell(), and UTIL_CHECK.
void Pscf::Prdc::UnitCell< 2 >::set | ( | UnitCell< 2 >::LatticeSystem | lattice | ) |
Set the lattice system, but not unit cell parameters.
Upon return, values of lattice and nParameter are set.
If cell.lattice() is not Null, the new lattice type must match match the existing lattice type, or an Exception is thrown. The lattice type may thus only be set once.
lattice | lattice system enumeration value |
Definition at line 178 of file UnitCell2.cpp.
References Pscf::Prdc::UnitCellBase< D >::isInitialized_, lattice(), UnitCell(), and UTIL_CHECK.
Referenced by set().
void Pscf::Prdc::UnitCell< 2 >::set | ( | UnitCell< 2 >::LatticeSystem | lattice, |
FSArray< double, 6 > const & | parameters ) |
Set the unit cell state (lattice system and parameters).
This function calls set(UnitCell<2>::LatticeSystem) internally. If cell.lattice() is not Null, the new lattice type must match match the existing lattice type, or an Exception is thrown. The lattice type may thus only be set once.
lattice | lattice system enumeration value |
parameters | array of unit cell parameters |
Definition at line 192 of file UnitCell2.cpp.
References lattice(), Pscf::Prdc::UnitCellBase< D >::nParameter_, Pscf::Prdc::UnitCellBase< D >::parameters(), Pscf::Prdc::UnitCellBase< D >::parameters_, set(), Pscf::Prdc::UnitCellBase< D >::setLattice(), UnitCell(), and UTIL_CHECK.
|
inline |
Return lattice system enumeration value.
This value is initialized to Null during construction.
Definition at line 306 of file UnitCell.h.
double Pscf::Prdc::UnitCell< 2 >::volume | ( | ) | const |
Get the generalized volume (i.e., area) of the unit cell,.
Definition at line 206 of file UnitCell2.cpp.
References Pscf::Prdc::UnitCellBase< D >::rBasis_, and UnitCell().
|
friend |
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.
in | input stream |
cell | UnitCell<D> to be read |
Definition at line 546 of file UnitCell.h.
|
friend |
ostream output inserter for a UnitCell<D>.
out | output stream |
cell | UnitCell<D> to be written |
Definition at line 560 of file UnitCell.h.
|
friend |
Serialize to/from an archive.
ar | input or output archive |
cell | UnitCell<D> object to be serialized |
version | archive version id |
Definition at line 519 of file UnitCell.h.
|
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.
in | input stream |
cell | UnitCell<D> to be read |
Definition at line 51 of file unitCellHeader.h.
|
friend |
Write UnitCell<D> to a field file header (fortran PSCF format).
out | output stream |
cell | UnitCell<D> to be written |
Definition at line 81 of file unitCellHeader.h.