22 #ifndef _OBJCRYST_UNITCELL_H_
23 #define _OBJCRYST_UNITCELL_H_
25 #include "ObjCryst/CrystVector/CrystVector.h"
27 #include "ObjCryst/ObjCryst/General.h"
28 #include "ObjCryst/RefinableObj/RefinableObj.h"
29 #include "ObjCryst/ObjCryst/SpaceGroup.h"
34 extern const RefParType *gpRefParTypeUnitCell;
35 extern const RefParType *gpRefParTypeUnitCellLength;
36 extern const RefParType *gpRefParTypeUnitCellAngle;
45 gpRefParTypeUnitCellLength=
new RefParType (gpRefParTypeUnitCell,
"Unit Cell Length");
46 gpRefParTypeUnitCellAngle=
new RefParType (gpRefParTypeUnitCell,
"Unit Cell Angle");
53 delete gpRefParTypeUnitCell;
54 delete gpRefParTypeUnitCellLength;
55 delete gpRefParTypeUnitCellAngle;
56 gpRefParTypeUnitCell=0;
57 gpRefParTypeUnitCellLength=0;
58 gpRefParTypeUnitCellAngle=0;
80 UnitCell(
const REAL a,
const REAL b,
const REAL c,
81 const string &SpaceGroupId);
87 UnitCell(
const REAL a,
const REAL b,
const REAL c,
const REAL alpha,
88 const REAL beta,
const REAL gamma,
const string &SpaceGroupId);
157 virtual void Print(ostream &os)
const;
159 virtual void Print()
const { this->Print(cout); }
178 virtual void Init(
const REAL a,
const REAL b,
const REAL c,
const REAL alpha,
179 const REAL beta,
const REAL gamma,
const string &SpaceGroupId,
265 #endif //_OBJCRYST_UNITCELL_H_
CrystVector_REAL GetLatticePar() const
Lattice parameters (a,b,c,alpha,beta,gamma) as a 6-element vector in Angstroems and radians...
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.
CrystMatrix_REAL mBMatrixInvert
inverse of B Matrix (i.e. inverse of orthogonalization matrix for direct space)
const CrystMatrix_REAL & GetBMatrix() const
Get the 'B' matrix (UnitCell::mBMatrix)for the UnitCell (orthogonalization matrix for the given latti...
const RefinableObjClock & GetClockLatticePar() const
last time the Lattice parameters were changed
void OrthonormalToFractionalCoords(REAL &x, REAL &y, REAL &z) const
Get fractional cartesian coordinates for a set of (x,y,z) orthonormal coordinates.
UnitCell()
Default Constructor.
We need to record exactly when refinable objects have been modified for the last time (to avoid re-co...
void FractionalToOrthonormalCoords(REAL &x, REAL &y, REAL &z) const
Get orthonormal cartesian coordinates for a set of (x,y,z) fractional coordinates.
RefinableObjClock mClockLatticePar
Last time lattice parameters were changed.
RefObjOpt mConstrainLatticeToSpaceGroup
Option to override lattice parameters constraints from spacegroup choice.
void MillerToOrthonormalCoords(REAL &x, REAL &y, REAL &z) const
Get Miller H,K, L indices from orthonormal coordinates in reciprocal space.
virtual const string & GetClassName() const
Name for this class ("RefinableObj", "Crystal",...).
Generic Refinable Object.
SpaceGroup mSpaceGroup
The space group of the UnitCell.
const SpaceGroup & GetSpaceGroup() const
Access to the SpaceGroup object.
const RefinableObjClock & GetClockMetricMatrix() const
last time the metric matrices were changed
void OrthonormalToMillerCoords(REAL &x, REAL &y, REAL &z) const
Get orthonormal coordinates given a set of H,K, L indices in reciprocal space.
void InitMatrices() const
The crystallographic space group, and the cell choice.
RefinableObjClock mClockMetricMatrix
REAL GetVolume() const
Volume of Unit Cell (in Angstroems)
CrystVector_REAL mCellDim
a,b and c in Angstroems, angles (stored) in radians For cubic, rhomboedric UnitCells, only the 'a' parameter is relevant.
RefinableObjClock mClockLatticeParUpdate
CrystMatrix_REAL mOrthMatrixInvert
inverse of Eucl Matrix (i.e. inverse of de-orthogonalization matrix for direct space) ...
virtual void Print(ostream &os) const
Prints some info about the UnitCell.
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++.
Unit Cell class: Unit cell with spacegroup information.
const CrystMatrix_REAL & GetOrthMatrix() const
Get the orthogonalization matrix (UnitCell::mOrthMatrix)for the UnitCell in real space.
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.
CrystMatrix_REAL mOrthMatrix
Eucl Matrix (Orthogonalization matrix for direct space) .
CrystMatrix_REAL mBMatrix
B Matrix (Orthogonalization matrix for reciprocal space) .
class of refinable parameter types.
virtual void InitOptions()
Init options.
const RefParType * gpRefParTypeObjCryst
Top RefParType for the ObjCryst++ library.
void InitRefParList()
Prepare the refinable parameters list.