Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ObjCryst::UnitCell Class Reference

Unit Cell class: Unit cell with spacegroup information. More...

Inheritance diagram for ObjCryst::UnitCell:

Inheritance graph
[legend]
Collaboration diagram for ObjCryst::UnitCell:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 UnitCell ()
 Default Constructor.

 UnitCell (const REAL a, const REAL b, const REAL c, const string &SpaceGroupId)
 UnitCell Constructor (orthorombic).

 UnitCell (const REAL a, const REAL b, const REAL c, const REAL alpha, const REAL beta, const REAL gamma, const string &SpaceGroupId)
 UnitCell Constructor (triclinic).

 UnitCell (const UnitCell &oldCryst)
 UnitCell copy constructor.

 ~UnitCell ()
 Destructor.

virtual const string & GetClassName () const
 Name for this class ("RefinableObj", "Crystal",...).

CrystVector_REAL GetLatticePar () const
 Lattice parameters (a,b,c,alpha,beta,gamma) as a 6-element vector in Angstroems and radians.

REAL GetLatticePar (const int whichPar) const
 Return one of the 6 Lattice parameters, 0<= whichPar <6 (a,b,c,alpha,beta,gamma), returned in Angstroems and radians.

const RefinableObjClockGetClockLatticePar () const
 last time the Lattice parameters were changed

const CrystMatrix_REAL & GetBMatrix () const
 Get the 'B' matrix (UnitCell::mBMatrix)for the UnitCell (orthogonalization matrix for the given lattice, in the reciprocal space).

const CrystMatrix_REAL & GetOrthMatrix () const
 Get the orthogonalization matrix (UnitCell::mOrthMatrix)for the UnitCell in real space.

const RefinableObjClockGetClockMetricMatrix () const
 last time the metric matrices were changed

CrystVector_REAL GetOrthonormalCoords (const REAL x, const REAL y, const REAL z) const
 Get orthonormal cartesian coordinates for a set of (x,y,z) fractional coordinates.

void FractionalToOrthonormalCoords (REAL &x, REAL &y, REAL &z) const
 Get orthonormal cartesian coordinates for a set of (x,y,z) fractional coordinates.

void OrthonormalToFractionalCoords (REAL &x, REAL &y, REAL &z) const
 Get fractional cartesian coordinates for a set of (x,y,z) orthonormal coordinates.

void MillerToOrthonormalCoords (REAL &x, REAL &y, REAL &z) const
 Get Miller H,K, L indices from orthonormal coordinates in reciprocal space.

void OrthonormalToMillerCoords (REAL &x, REAL &y, REAL &z) const
 Get orthonormal coordinates given a set of H,K, L indices in reciprocal space.

virtual void Print (ostream &os=cout) const
 Prints some info about the UnitCell.

const SpaceGroupGetSpaceGroup () const
 Access to the SpaceGroup object.

SpaceGroupGetSpaceGroup ()
 Access to the SpaceGroup object.

REAL GetVolume () const
 Volume of Unit Cell (in Angstroems).


Protected Member Functions

virtual void Init (const REAL a, const REAL b, const REAL c, const REAL alpha, const REAL beta, const REAL gamma, const string &SpaceGroupId, const string &name)
 Init all UnitCell parameters.

void InitRefParList ()
 Prepare the refinable parameters list.


Private Member Functions

virtual void InitOptions ()
 Init options.

void InitMatrices () const
void UpdateLatticePar ()

Private Attributes

CrystVector_REAL mCellDim
 a,b and c in Angstroems, angles (stored) in radians For cubic, rhomboedric UnitCells, only the 'a' parameter is relevant.

SpaceGroup mSpaceGroup
 The space group of the UnitCell.

CrystMatrix_REAL mBMatrix
 B Matrix (Orthogonalization matrix for reciprocal space)

\[ B= \left[ \begin {array}{ccc} a^* & b^*\cos(\gamma^*) & c^*\cos(\beta^*) \\ 0 & b^*\sin(\gamma^*) & -c^*\sin(\beta^*)\cos(\alpha) \\ 0 & 0 & \frac{1}{c}\end{array} \right]\]

\[ \left[ \begin{array}{c} k_x \\ k_y \\ k_z \end{array} \right]_{orthonormal} = B \times \left[ \begin{array}{c} h \\ k \\ l \end{array}\right]_{integer} \]

.

CrystMatrix_REAL mBMatrixInvert
 inverse of B Matrix (i.e. inverse of orthogonalization matrix for direct space)

CrystMatrix_REAL mOrthMatrix
 Eucl Matrix (Orthogonalization matrix for direct space)

\[ M_{orth}= \left[ \begin {array}{ccc} a & b\cos(\gamma) & c\cos(\beta) \\ 0 & b\sin(\gamma) & -c\sin(\beta)\cos(\alpha^*) \\ 0 & 0 & \frac{1}{c^*}\end{array} \right]\]

\[ \left[ \begin{array}{c} x \\ y \\ z \end{array} \right]_{orthonormal} = M_{orth} \times \left[ \begin{array}{c} x \\ y \\ z \end{array} \right]_{fractional coords}\]

.

CrystMatrix_REAL mOrthMatrixInvert
 inverse of Eucl Matrix (i.e. inverse of de-orthogonalization matrix for direct space)

RefinableObjClock mClockLatticePar
 Last time lattice parameters were changed.

RefinableObjClock mClockMetricMatrix
 Last time metric matrices were computed.

RefinableObjClock mClockLatticeParUpdate
 Last time the lattice parameters whre updated.

RefObjOpt mConstrainLatticeToSpaceGroup
 Option to override lattice parameters constraints from spacegroup choice.


Detailed Description

Unit Cell class: Unit cell with spacegroup information.


Constructor & Destructor Documentation

ObjCryst::UnitCell::UnitCell  ) 
 

Default Constructor.

ObjCryst::UnitCell::UnitCell const REAL  a,
const REAL  b,
const REAL  c,
const string &  SpaceGroupId
 

UnitCell Constructor (orthorombic).

Parameters:
a,b,c : unit cell dimension, in angstroems
SpaceGroupId: space group symbol or number

ObjCryst::UnitCell::UnitCell const REAL  a,
const REAL  b,
const REAL  c,
const REAL  alpha,
const REAL  beta,
const REAL  gamma,
const string &  SpaceGroupId
 

UnitCell Constructor (triclinic).

Parameters:
a,b,c : unit cell dimension, in angstroems
alpha,beta,gamma : unit cell angles, in radians.
SpaceGroupId: space group symbol or number

ObjCryst::UnitCell::UnitCell const UnitCell oldCryst  ) 
 

UnitCell copy constructor.

ObjCryst::UnitCell::~UnitCell  ) 
 

Destructor.


Member Function Documentation

void ObjCryst::UnitCell::FractionalToOrthonormalCoords REAL &  x,
REAL &  y,
REAL &  z
const
 

Get orthonormal cartesian coordinates for a set of (x,y,z) fractional coordinates.

X,y and z input are changed to Amgstroems values The convention is taken following : e1 is chosen along a, e2 in the (a,b) plane, then e3 is along c*

const CrystMatrix_REAL& ObjCryst::UnitCell::GetBMatrix  )  const
 

Get the 'B' matrix (UnitCell::mBMatrix)for the UnitCell (orthogonalization matrix for the given lattice, in the reciprocal space).

The convention is taken following Giacovazzo, "Fundamentals of Crystallography", p.69 "e1 is chosen along a*, e2 in the (a*,b*) plane, then e3 is along c".

virtual const string& ObjCryst::UnitCell::GetClassName  )  const [virtual]
 

Name for this class ("RefinableObj", "Crystal",...).

This is only useful to distinguish different classes when picking up objects from the RefinableObj Global Registry

Reimplemented from ObjCryst::RefinableObj.

Reimplemented in ObjCryst::Crystal.

const RefinableObjClock& ObjCryst::UnitCell::GetClockLatticePar  )  const
 

last time the Lattice parameters were changed

const RefinableObjClock& ObjCryst::UnitCell::GetClockMetricMatrix  )  const
 

last time the metric matrices were changed

REAL ObjCryst::UnitCell::GetLatticePar const int  whichPar  )  const
 

Return one of the 6 Lattice parameters, 0<= whichPar <6 (a,b,c,alpha,beta,gamma), returned in Angstroems and radians.

CrystVector_REAL ObjCryst::UnitCell::GetLatticePar  )  const
 

Lattice parameters (a,b,c,alpha,beta,gamma) as a 6-element vector in Angstroems and radians.

const CrystMatrix_REAL& ObjCryst::UnitCell::GetOrthMatrix  )  const
 

Get the orthogonalization matrix (UnitCell::mOrthMatrix)for the UnitCell in real space.

CrystVector_REAL ObjCryst::UnitCell::GetOrthonormalCoords const REAL  x,
const REAL  y,
const REAL  z
const
 

Get orthonormal cartesian coordinates for a set of (x,y,z) fractional coordinates.

Results are given in Angstroems. The convention is taken following : e1 is chosen along a, e2 in the (a,b) plane, then e3 is along c*

SpaceGroup& ObjCryst::UnitCell::GetSpaceGroup  ) 
 

Access to the SpaceGroup object.

const SpaceGroup& ObjCryst::UnitCell::GetSpaceGroup  )  const
 

Access to the SpaceGroup object.

REAL ObjCryst::UnitCell::GetVolume  )  const
 

Volume of Unit Cell (in Angstroems).

virtual void ObjCryst::UnitCell::Init const REAL  a,
const REAL  b,
const REAL  c,
const REAL  alpha,
const REAL  beta,
const REAL  gamma,
const string &  SpaceGroupId,
const string &  name
[protected, virtual]
 

Init all UnitCell parameters.

Parameters:
a,b,c : unit cell dimension, in angstroems
alpha,beta,gamma : unit cell angles
SpcGroup: space group number (1..230)
name: name for the UnitCell, : '(TaSe4)2I'

Reimplemented in ObjCryst::Crystal.

void ObjCryst::UnitCell::InitMatrices  )  const [private]
 

For internal use only.

.Init the (de)orthogonalization matrices. They are re-computed only if parameters have changed since last call.

virtual void ObjCryst::UnitCell::InitOptions  )  [private, virtual]
 

Init options.

Need only be done once per UnitCell.

Reimplemented in ObjCryst::Crystal.

void ObjCryst::UnitCell::InitRefParList  )  [protected]
 

Prepare the refinable parameters list.

This is called once when creating the UnitCell.

void ObjCryst::UnitCell::MillerToOrthonormalCoords REAL &  x,
REAL &  y,
REAL &  z
const
 

Get Miller H,K, L indices from orthonormal coordinates in reciprocal space.

Result is stored into x,y and z

void ObjCryst::UnitCell::OrthonormalToFractionalCoords REAL &  x,
REAL &  y,
REAL &  z
const
 

Get fractional cartesian coordinates for a set of (x,y,z) orthonormal coordinates.

Result is stored into x,y and z The convention is taken following : e1 is chosen along a, e2 in the (a,b) plane, then e3 is along c*

void ObjCryst::UnitCell::OrthonormalToMillerCoords REAL &  x,
REAL &  y,
REAL &  z
const
 

Get orthonormal coordinates given a set of H,K, L indices in reciprocal space.

Result is stored into x,y and z

virtual void ObjCryst::UnitCell::Print ostream &  os = cout  )  const [virtual]
 

Prints some info about the UnitCell.

Parameters:
os the stream to which the information is outputed (default=cout)

Reimplemented in ObjCryst::Crystal.

void ObjCryst::UnitCell::UpdateLatticePar  )  [private]
 

For internal use only.

Update cell parameters for tetragonal, trigonal, hexagonal, cubic lattices. Also set angular parameters for those group which need it. This is needed during Refinement, since for example in a quadratic spg, only a is refined and we need to have b=a...


Member Data Documentation

CrystMatrix_REAL ObjCryst::UnitCell::mBMatrix [mutable, private]
 

B Matrix (Orthogonalization matrix for reciprocal space)

\[ B= \left[ \begin {array}{ccc} a^* & b^*\cos(\gamma^*) & c^*\cos(\beta^*) \\ 0 & b^*\sin(\gamma^*) & -c^*\sin(\beta^*)\cos(\alpha) \\ 0 & 0 & \frac{1}{c}\end{array} \right]\]

\[ \left[ \begin{array}{c} k_x \\ k_y \\ k_z \end{array} \right]_{orthonormal} = B \times \left[ \begin{array}{c} h \\ k \\ l \end{array}\right]_{integer} \]

.

Note:
this matrix is and must remain upper triangular. this is assumed for some optimizations.

CrystMatrix_REAL ObjCryst::UnitCell::mBMatrixInvert [mutable, private]
 

inverse of B Matrix (i.e. inverse of orthogonalization matrix for direct space)

CrystVector_REAL ObjCryst::UnitCell::mCellDim [private]
 

a,b and c in Angstroems, angles (stored) in radians For cubic, rhomboedric UnitCells, only the 'a' parameter is relevant.

For quadratic and hexagonal UnitCells, only a and c parameters are relevant. The MUTABLE is temporary ! It should not be !

RefinableObjClock ObjCryst::UnitCell::mClockLatticePar [private]
 

Last time lattice parameters were changed.

RefinableObjClock ObjCryst::UnitCell::mClockLatticeParUpdate [mutable, private]
 

Last time the lattice parameters whre updated.

RefinableObjClock ObjCryst::UnitCell::mClockMetricMatrix [mutable, private]
 

Last time metric matrices were computed.

RefObjOpt ObjCryst::UnitCell::mConstrainLatticeToSpaceGroup [private]
 

Option to override lattice parameters constraints from spacegroup choice.

Warning:
EXPERIMENTAL
Normally lattice parameters are constrained by the space group choice (e.g. a=b=c and angles =90° for cubic spacegroups). Using this option allows you to override this, and choose any lattice parameter. THis works as long as symmetry operations are applied to fractionnal coordinates.

This is useful duting global optimization when searching the structure in a UnitCell which has (or is expected to have) a known pseudo-crystallographic symmetry, to reduce dramatically the number of parameters. Of course for final refinement the 'real' symmetry should be imposed.

CrystMatrix_REAL ObjCryst::UnitCell::mOrthMatrix [mutable, private]
 

Eucl Matrix (Orthogonalization matrix for direct space)

\[ M_{orth}= \left[ \begin {array}{ccc} a & b\cos(\gamma) & c\cos(\beta) \\ 0 & b\sin(\gamma) & -c\sin(\beta)\cos(\alpha^*) \\ 0 & 0 & \frac{1}{c^*}\end{array} \right]\]

\[ \left[ \begin{array}{c} x \\ y \\ z \end{array} \right]_{orthonormal} = M_{orth} \times \left[ \begin{array}{c} x \\ y \\ z \end{array} \right]_{fractional coords}\]

.

Note:
this matrix is and must remain upper triangular. this is assumed for some optimizations.

CrystMatrix_REAL ObjCryst::UnitCell::mOrthMatrixInvert [mutable, private]
 

inverse of Eucl Matrix (i.e. inverse of de-orthogonalization matrix for direct space)

SpaceGroup ObjCryst::UnitCell::mSpaceGroup [private]
 

The space group of the UnitCell.


The documentation for this class was generated from the following file:
Generated on Tue Nov 14 15:05:27 2006 for ObjCryst++ by doxygen 1.3.6