PSCF v1.1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Pscf::UnitCellBase< D > Class Template Referenceabstract

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

#include <UnitCellBase.h>

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

Public Member Functions

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

Protected Member Functions

void setLattice ()
 Compute all private data, given latticeSystem and parameters. More...
 

Protected Attributes

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

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

Base class template for a crystallographic unit cell.

Definition at line 29 of file UnitCellBase.h.

Constructor & Destructor Documentation

◆ UnitCellBase()

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

Constructor.

Definition at line 322 of file UnitCellBase.h.

◆ ~UnitCellBase()

template<int D>
Pscf::UnitCellBase< D >::~UnitCellBase

Destructor.

Definition at line 331 of file UnitCellBase.h.

Member Function Documentation

◆ setParameters()

template<int D>
void Pscf::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 338 of file UnitCellBase.h.

References Util::FSArray< Data, Capacity >::size(), and UTIL_CHECK.

◆ ksq()

template<int D>
double Pscf::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 352 of file UnitCellBase.h.

References Pscf::Vec< D, T >::multiply().

Referenced by Pscf::Pspg::WaveList< D >::computeMinimumImages().

◆ dksq()

template<int D>
double Pscf::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 371 of file UnitCellBase.h.

◆ nParameter()

template<int D>
int Pscf::UnitCellBase< D >::nParameter
inline

◆ parameters()

template<int D>
FSArray< double, 6 > Pscf::UnitCellBase< D >::parameters
inline

Get the parameters of this unit cell.

Definition at line 251 of file UnitCellBase.h.

References Util::FSArray< Data, Capacity >::append().

◆ parameter()

template<int D>
double Pscf::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 265 of file UnitCellBase.h.

◆ rBasis()

template<int D>
const RealVec< D > & Pscf::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 273 of file UnitCellBase.h.

◆ kBasis()

template<int D>
const RealVec< D > & Pscf::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 281 of file UnitCellBase.h.

◆ drBasis()

template<int D>
double Pscf::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 289 of file UnitCellBase.h.

◆ dkBasis()

template<int D>
double Pscf::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 297 of file UnitCellBase.h.

◆ drrBasis()

template<int D>
double Pscf::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 313 of file UnitCellBase.h.

◆ dkkBasis()

template<int D>
double Pscf::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 305 of file UnitCellBase.h.

Referenced by Pscf::Pspg::WaveList< D >::computedKSq().

◆ isInitialized()

template<int D>
bool Pscf::UnitCellBase< D >::isInitialized ( ) const
inline

◆ setLattice()

template<int D>
void Pscf::UnitCellBase< D >::setLattice
protected

Compute all private data, given latticeSystem and parameters.

Calls initializeToZero, setBasis, computeDerivatives internally.

Definition at line 460 of file UnitCellBase.h.

Member Data Documentation

◆ rBasis_

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

Array of Bravais lattice basis vectors.

Definition at line 149 of file UnitCellBase.h.

◆ kBasis_

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

Array of reciprocal lattice basis vectors.

Definition at line 154 of file UnitCellBase.h.

◆ drBasis_

template<int D>
FArray<FMatrix<double, D, D>, 6> Pscf::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 162 of file UnitCellBase.h.

◆ dkBasis_

template<int D>
FArray<FMatrix<double, D, D>, 6> Pscf::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 170 of file UnitCellBase.h.

◆ drrBasis_

template<int D>
FArray<FMatrix<double, D, D>, 6> Pscf::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 179 of file UnitCellBase.h.

◆ dkkBasis_

template<int D>
FArray<FMatrix<double, D, D>, 6> Pscf::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 188 of file UnitCellBase.h.

◆ parameters_

template<int D>
FArray<double, 6> Pscf::UnitCellBase< D >::parameters_
protected

Parameters used to describe the unit cell.

Definition at line 193 of file UnitCellBase.h.

Referenced by Pscf::UnitCell< 1 >::operator=(), Pscf::UnitCell< 2 >::operator=(), and Pscf::UnitCell< 3 >::operator=().

◆ nParameter_

template<int D>
int Pscf::UnitCellBase< D >::nParameter_
protected

Number of parameters required to specify unit cell.

Definition at line 198 of file UnitCellBase.h.

Referenced by Pscf::UnitCell< 1 >::operator=(), Pscf::UnitCell< 2 >::operator=(), and Pscf::UnitCell< 3 >::operator=().

◆ isInitialized_

template<int D>
bool Pscf::UnitCellBase< D >::isInitialized_
protected

Has this unit cell been fully initialized?

Definition at line 203 of file UnitCellBase.h.

Referenced by Pscf::UnitCellBase< D >::isInitialized().


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