PSCF v1.3
Pscf::Prdc::UnitCellBase< D > Class Template Referenceabstract

Base class template for a crystallographic unit cell. More...

#include <UnitCellBase.h>

Inheritance diagram for Pscf::Prdc::UnitCellBase< D >:
Pscf::Prdc::UnitCell< 1 > Pscf::Prdc::UnitCell< 2 > Pscf::Prdc::UnitCell< 3 > Pscf::Prdc::UnitCell< D >

Public Member Functions

 UnitCellBase ()
 Constructor.
 ~UnitCellBase ()
 Destructor.
Unit Cell Parameters
void setParameters (FSArray< double, 6 > const &parameters)
 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?

Detailed Description

template<int D>
class Pscf::Prdc::UnitCellBase< D >

Base class template for a crystallographic unit cell.

Definition at line 34 of file UnitCellBase.h.

Constructor & Destructor Documentation

◆ UnitCellBase()

template<int D>
Pscf::Prdc::UnitCellBase< D >::UnitCellBase ( )

Constructor.

Definition at line 26 of file UnitCellBase.tpp.

References isInitialized_, and nParameter_.

◆ ~UnitCellBase()

template<int D>
Pscf::Prdc::UnitCellBase< D >::~UnitCellBase ( )

Destructor.

Definition at line 36 of file UnitCellBase.tpp.

Member Function Documentation

◆ setParameters()

template<int D>
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
parametersarray of unit cell parameters

Definition at line 44 of file UnitCellBase.tpp.

References parameters().

◆ nParameter()

◆ parameters()

◆ parameter()

template<int D>
double Pscf::Prdc::UnitCellBase< D >::parameter ( int i) const
inline

Get a single parameter of this unit cell.

Parameters
iarray index of the desired parameter

Definition at line 315 of file UnitCellBase.h.

References parameters_.

◆ isInitialized()

template<int D>
bool Pscf::Prdc::UnitCellBase< D >::isInitialized ( ) const
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().

◆ rBasis()

template<int D>
const RealVec< D > & Pscf::Prdc::UnitCellBase< D >::rBasis ( int i) const
inline

Get Bravais basis vector i, denoted by a_i.

Parameters
iarray index of the desired Bravais basis vector

Definition at line 323 of file UnitCellBase.h.

References rBasis_.

◆ kBasis()

template<int D>
const RealVec< D > & Pscf::Prdc::UnitCellBase< D >::kBasis ( int i) const
inline

Get reciprocal basis vector i, denoted by b_i.

Parameters
iarray index of the desired reciprocal basis vector

Definition at line 331 of file UnitCellBase.h.

References kBasis_.

◆ drBasis()

template<int D>
double Pscf::Prdc::UnitCellBase< D >::drBasis ( int k,
int i,
int j ) const
inline

Get component j of derivative of rBasis vector a_i w/respect to k.

Parameters
kindex of cell parameter
iindex of the desired basis vector a_i
jindex of a Cartesian component of a_i

Definition at line 339 of file UnitCellBase.h.

References drBasis_.

◆ dkBasis()

template<int D>
double Pscf::Prdc::UnitCellBase< D >::dkBasis ( int k,
int i,
int j ) const
inline

Get component j of derivative of kBasis vector b_i w/respect to k.

Parameters
kindex of cell parameter
iarray index of the desired reciprocal basis vector b_i
jindex of a Cartesian component of b_i

Definition at line 347 of file UnitCellBase.h.

References dkBasis_.

◆ drrBasis()

template<int D>
double Pscf::Prdc::UnitCellBase< D >::drrBasis ( int k,
int i,
int j ) const
inline

Get derivative of dot product ai.aj with respect to parameter k.

Parameters
kindex of cell parameter
iarray index of 1st Bravais basis vector a_i
jarray index of 2nd Bravais basis vector a_i

Definition at line 363 of file UnitCellBase.h.

References drrBasis_.

◆ dkkBasis()

template<int D>
double Pscf::Prdc::UnitCellBase< D >::dkkBasis ( int k,
int i,
int j ) const
inline

Get derivative of dot product bi.bj with respect to parameter k.

Parameters
kindex of cell parameter
iarray index of 1st reciprocal basis vector b_i
jarray index of 2nd reciprocal basis vector b_i

Definition at line 355 of file UnitCellBase.h.

References dkkBasis_.

Referenced by dksq().

◆ ksq()

template<int D>
double Pscf::Prdc::UnitCellBase< D >::ksq ( IntVec< D > const & k) const
virtual

Compute square magnitude of reciprocal lattice vector.

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

◆ dksq()

template<int D>
double Pscf::Prdc::UnitCellBase< D >::dksq ( IntVec< D > const & vec,
int n ) const
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.

Parameters
vecvector of components of a reciprocal lattice vector
nindex of a unit cell parameter

Definition at line 90 of file UnitCellBase.tpp.

References dkkBasis().

◆ setSignal()

template<int D>
void Pscf::Prdc::UnitCellBase< D >::setSignal ( Signal< void > & signal)

Associating an externally defined signal with this unit cell.

Parameters
signalSignal triggered by unit cell modification

Definition at line 108 of file UnitCellBase.tpp.

References signal().

◆ hasSignal()

template<int D>
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()

template<int D>
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().

◆ setLattice()

template<int D>
void Pscf::Prdc::UnitCellBase< D >::setLattice ( )
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().

Member Data Documentation

◆ rBasis_

template<int D>
FArray<RealVec<D>, D> Pscf::Prdc::UnitCellBase< D >::rBasis_
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().

◆ kBasis_

template<int D>
FArray<RealVec<D>, D> Pscf::Prdc::UnitCellBase< D >::kBasis_
protected

Array of reciprocal lattice basis vectors.

Definition at line 195 of file UnitCellBase.h.

Referenced by kBasis(), and ksq().

◆ drBasis_

template<int D>
FArray<FMatrix<double, D, D>, 6> Pscf::Prdc::UnitCellBase< D >::drBasis_
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().

◆ dkBasis_

template<int D>
FArray<FMatrix<double, D, D>, 6> Pscf::Prdc::UnitCellBase< D >::dkBasis_
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().

◆ drrBasis_

template<int D>
FArray<FMatrix<double, D, D>, 6> Pscf::Prdc::UnitCellBase< D >::drrBasis_
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().

◆ dkkBasis_

template<int D>
FArray<FMatrix<double, D, D>, 6> Pscf::Prdc::UnitCellBase< D >::dkkBasis_
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().

◆ parameters_

◆ nParameter_

◆ isInitialized_


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