PSCF v1.3
|
Base class template for a crystallographic unit cell. More...
#include <UnitCellBase.h>
Public Member Functions | |
UnitCellBase () | |
Constructor. | |
~UnitCellBase () | |
Destructor. | |
Unit Cell Parameters | |
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? | |
Bravais Lattice Data | |
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. | |
Wavevector Properties | |
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. | |
Signal Interface | |
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. |
Protected Member Functions | |
void | setLattice () |
Compute all protected data, given latticeSystem and parameters. |
Protected Attributes | |
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? |
Base class template for a crystallographic unit cell.
Definition at line 34 of file UnitCellBase.h.
Pscf::Prdc::UnitCellBase< D >::UnitCellBase | ( | ) |
Constructor.
Definition at line 26 of file UnitCellBase.tpp.
References isInitialized_, and nParameter_.
Pscf::Prdc::UnitCellBase< D >::~UnitCellBase | ( | ) |
Destructor.
Definition at line 36 of file UnitCellBase.tpp.
void Pscf::Prdc::UnitCellBase< D >::setParameters | ( | FSArray< double, 6 > const & | parameters | ) |
Set all the parameters of unit cell.
The lattice system must already be set to a non-null value.
parameters | array of unit cell parameters |
Definition at line 44 of file UnitCellBase.tpp.
References parameters().
|
inline |
Get the number of parameters in the unit cell.
Definition at line 307 of file UnitCellBase.h.
References nParameter_.
Referenced by Pscf::Prdc::Cpu::WaveList< D >::allocate(), Pscf::Prdc::MixtureReal< D, PT, ST >::associate(), Pscf::Rpg::Block< D >::associate(), Pscf::Prdc::FieldIoReal< D, RFT, KFT, FFT >::readFieldHeader(), Pscf::Prdc::UnitCell< 1 >::readUnitCellHeader, Pscf::Prdc::replicateUnitCell(), Pscf::Prdc::replicateUnitCell(), and Pscf::Prdc::replicateUnitCell().
FSArray< double, 6 > Pscf::Prdc::UnitCellBase< D >::parameters | ( | ) | const |
Get the parameters of this unit cell.
Definition at line 58 of file UnitCellBase.tpp.
References nParameter_, parameters(), and parameters_.
Referenced by parameters(), Pscf::Prdc::replicateUnitCell(), Pscf::Prdc::replicateUnitCell(), Pscf::Prdc::replicateUnitCell(), Pscf::Prdc::UnitCell< 1 >::set(), Pscf::Prdc::UnitCell< 2 >::set(), Pscf::Prdc::UnitCell< 3 >::set(), and setParameters().
|
inline |
Get a single parameter of this unit cell.
i | array index of the desired parameter |
Definition at line 315 of file UnitCellBase.h.
References parameters_.
|
inline |
Has this unit cell been initialized?
A unit cell is initialized after both the lattice type and the lattice parameters have been set.
Definition at line 371 of file UnitCellBase.h.
References isInitialized_.
Referenced by Pscf::Prdc::FieldIoReal< D, RFT, KFT, FFT >::readFieldHeader().
|
inline |
Get Bravais basis vector i, denoted by a_i.
i | array index of the desired Bravais basis vector |
Definition at line 323 of file UnitCellBase.h.
References rBasis_.
|
inline |
Get reciprocal basis vector i, denoted by b_i.
i | array index of the desired reciprocal basis vector |
Definition at line 331 of file UnitCellBase.h.
References kBasis_.
|
inline |
Get component j of derivative of rBasis vector a_i w/respect to k.
k | index of cell parameter |
i | index of the desired basis vector a_i |
j | index of a Cartesian component of a_i |
Definition at line 339 of file UnitCellBase.h.
References drBasis_.
|
inline |
Get component j of derivative of kBasis vector b_i w/respect to k.
k | index of cell parameter |
i | array index of the desired reciprocal basis vector b_i |
j | index of a Cartesian component of b_i |
Definition at line 347 of file UnitCellBase.h.
References dkBasis_.
|
inline |
Get derivative of dot product ai.aj with respect to parameter k.
k | index of cell parameter |
i | array index of 1st Bravais basis vector a_i |
j | array index of 2nd Bravais basis vector a_i |
Definition at line 363 of file UnitCellBase.h.
References drrBasis_.
|
inline |
Get derivative of dot product bi.bj with respect to parameter k.
k | index of cell parameter |
i | array index of 1st reciprocal basis vector b_i |
j | array index of 2nd reciprocal basis vector b_i |
Definition at line 355 of file UnitCellBase.h.
References dkkBasis_.
Referenced by dksq().
|
virtual |
Compute square magnitude of reciprocal lattice vector.
k | vector of components of a reciprocal lattice vector |
Definition at line 71 of file UnitCellBase.tpp.
References kBasis_, and Pscf::Vec< D, T >::multiply().
Referenced by Pscf::Rpc::FourthOrderParameter< D >::compute(), Pscf::Rpc::IntraCorrelation< D >::computeIntraCorrelations(), Pscf::Rpg::IntraCorrelation< D >::computeIntraCorrelations(), and Pscf::Rpc::BinaryStructureFactorGrid< D >::setup().
|
virtual |
Compute derivative of square wavevector w/respect to cell parameter.
This function computes and returns a derivative with respect to unit cell parameter number n of the square of a reciprocal lattice vector with integer coefficients given by the elements of vec.
vec | vector of components of a reciprocal lattice vector |
n | index of a unit cell parameter |
Definition at line 90 of file UnitCellBase.tpp.
References dkkBasis().
void Pscf::Prdc::UnitCellBase< D >::setSignal | ( | Signal< void > & | signal | ) |
Associating an externally defined signal with this unit cell.
signal | Signal triggered by unit cell modification |
Definition at line 108 of file UnitCellBase.tpp.
References signal().
bool Pscf::Prdc::UnitCellBase< D >::hasSignal | ( | ) | const |
Does this object have an associated Signal<void>?
Definition at line 112 of file UnitCellBase.tpp.
Referenced by setLattice().
Signal< void > & Pscf::Prdc::UnitCellBase< D >::signal | ( | ) |
Get the associated Signal by non-const reference.
Definition at line 116 of file UnitCellBase.tpp.
References UTIL_CHECK.
Referenced by setSignal().
|
protected |
Compute all protected data, given latticeSystem and parameters.
All functions that reset unit cell parameters must call this function to reset depenent data, including stream insertion operators.
Calls initializeToZero, setBasis, & computeDerivatives functions internally. Also sets isInitialized flag true and notifies any observers.
Definition at line 196 of file UnitCellBase.tpp.
References hasSignal(), and isInitialized_.
Referenced by Pscf::Prdc::UnitCell< 1 >::operator=(), Pscf::Prdc::UnitCell< 2 >::operator=(), Pscf::Prdc::UnitCell< 3 >::operator=(), Pscf::Prdc::UnitCell< 1 >::operator>>, Pscf::Prdc::UnitCell< 1 >::readUnitCellHeader, Pscf::Prdc::UnitCell< 1 >::set(), Pscf::Prdc::UnitCell< 2 >::set(), and Pscf::Prdc::UnitCell< 3 >::set().
|
protected |
Array of Bravais lattice basis vectors.
Definition at line 190 of file UnitCellBase.h.
Referenced by rBasis(), Pscf::Prdc::UnitCell< 1 >::volume(), Pscf::Prdc::UnitCell< 2 >::volume(), and Pscf::Prdc::UnitCell< 3 >::volume().
|
protected |
Array of reciprocal lattice basis vectors.
Definition at line 195 of file UnitCellBase.h.
|
protected |
Array of derivatives of rBasis.
Element drBasis_[k](i,j) is the derivative with respect to parameter k of component j of Bravais basis vector i.
Definition at line 203 of file UnitCellBase.h.
Referenced by drBasis().
|
protected |
Array of derivatives of kBasis.
Element dkBasis_[k](i,j) is the derivative with respect to parameter k of component j of reciprocal basis vector i.
Definition at line 211 of file UnitCellBase.h.
Referenced by dkBasis().
|
protected |
Array of derivatives of a_i.a_j.
Element drrBasis_[k](i,j) is the derivative with respect to parameter k of the dot product (a_i.a_j) of Bravais lattice basis vectors a_i and a_j.
Definition at line 220 of file UnitCellBase.h.
Referenced by drrBasis().
|
protected |
Array of derivatives of b_i.b_j.
Element dkkBasis_[k](i,j) is the derivative with respect to parameter k of the dot product (b_i.b_j) of reciprocal lattice basis vectors b_i and b_j.
Definition at line 229 of file UnitCellBase.h.
Referenced by dkkBasis().
|
protected |
Parameters used to describe the unit cell.
Definition at line 234 of file UnitCellBase.h.
Referenced by Pscf::Prdc::UnitCell< 1 >::operator<<, Pscf::Prdc::UnitCell< 1 >::operator=(), Pscf::Prdc::UnitCell< 2 >::operator=(), Pscf::Prdc::UnitCell< 3 >::operator=(), Pscf::Prdc::UnitCell< 1 >::operator>>, parameter(), parameters(), Pscf::Prdc::UnitCell< 1 >::readUnitCellHeader, Pscf::Prdc::UnitCell< 1 >::serialize, Pscf::Prdc::UnitCell< 1 >::set(), Pscf::Prdc::UnitCell< 2 >::set(), Pscf::Prdc::UnitCell< 3 >::set(), and Pscf::Prdc::UnitCell< 1 >::writeUnitCellHeader.
|
protected |
Number of parameters required to specify unit cell.
Definition at line 239 of file UnitCellBase.h.
Referenced by nParameter(), Pscf::Prdc::UnitCell< 1 >::operator<<, Pscf::Prdc::UnitCell< 1 >::operator=(), Pscf::Prdc::UnitCell< 2 >::operator=(), Pscf::Prdc::UnitCell< 3 >::operator=(), Pscf::Prdc::UnitCell< 1 >::operator>>, parameters(), Pscf::Prdc::UnitCell< 1 >::readUnitCellHeader, Pscf::Prdc::UnitCell< 1 >::serialize, Pscf::Prdc::UnitCell< 1 >::set(), Pscf::Prdc::UnitCell< 2 >::set(), Pscf::Prdc::UnitCell< 3 >::set(), UnitCellBase(), and Pscf::Prdc::UnitCell< 1 >::writeUnitCellHeader.
|
protected |
Has this unit cell been fully initialized?
Definition at line 244 of file UnitCellBase.h.
Referenced by isInitialized(), Pscf::Prdc::UnitCell< 1 >::operator=(), Pscf::Prdc::UnitCell< 2 >::operator=(), Pscf::Prdc::UnitCell< 3 >::operator=(), Pscf::Prdc::UnitCell< 1 >::readUnitCellHeader, Pscf::Prdc::UnitCell< 1 >::set(), Pscf::Prdc::UnitCell< 2 >::set(), Pscf::Prdc::UnitCell< 3 >::set(), setLattice(), and UnitCellBase().