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); }
184 virtual void Init(
const REAL a,
const REAL b,
const REAL c,
const REAL alpha,
185 const REAL beta,
const REAL gamma,
const string &SpaceGroupId,
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++.
const RefParType * gpRefParTypeObjCryst
Top RefParType for the ObjCryst++ library.
The crystallographic space group, and the cell choice.
Unit Cell class: Unit cell with spacegroup information.
CrystMatrix_REAL mBMatrix
B Matrix (Orthogonalization matrix for reciprocal space)
CrystVector_REAL mCellDim
a,b and c in Angstroems, angles (stored) in radians For cubic, rhomboedric UnitCells,...
CrystMatrix_REAL mOrthMatrixInvert
inverse of Eucl Matrix (i.e. inverse of de-orthogonalization matrix for direct 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.
CrystVector_REAL GetLatticePar() const
Lattice parameters (a,b,c,alpha,beta,gamma) as a 6-element vector in Angstroems and radians.
virtual void Print(ostream &os) const
Prints some info about the UnitCell.
void ChangeSpaceGroup(const string &spgId)
Change the spacegroup.
void MillerToOrthonormalCoords(REAL &x, REAL &y, REAL &z) const
Get Miller H,K, L indices from orthonormal coordinates in reciprocal space.
CrystMatrix_REAL mOrthMatrix
Eucl Matrix (Orthogonalization matrix for direct space)
const RefinableObjClock & GetClockMetricMatrix() const
last time the metric matrices were changed
REAL GetVolume() const
Volume of Unit Cell (in Angstroems)
void InitRefParList()
Prepare the refinable parameters list.
UnitCell()
Default Constructor.
RefinableObjClock mClockMetricMatrix
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 OrthonormalToFractionalCoords(REAL &x, REAL &y, REAL &z) const
Get fractional cartesian coordinates for a set of (x,y,z) orthonormal coordinates.
SpaceGroup mSpaceGroup
The space group of the UnitCell.
RefinableObjClock mClockLatticePar
Last time lattice parameters were changed.
virtual const string & GetClassName() const
Name for this class ("RefinableObj", "Crystal",...).
RefinableObjClock mClockLatticeParUpdate
void InitMatrices() const
const SpaceGroup & GetSpaceGroup() const
Access to the SpaceGroup object.
const CrystMatrix_REAL & GetOrthMatrix() const
Get the orthogonalization matrix (UnitCell::mOrthMatrix)for the UnitCell in real space.
void OrthonormalToMillerCoords(REAL &x, REAL &y, REAL &z) const
Get orthonormal coordinates given a set of H,K, L indices in reciprocal space.
RefObjOpt mConstrainLatticeToSpaceGroup
Option to override lattice parameters constraints from spacegroup choice.
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
virtual void InitOptions()
Init options.
void FractionalToOrthonormalCoords(REAL &x, REAL &y, REAL &z) const
Get orthonormal cartesian coordinates for a set of (x,y,z) fractional coordinates.
class of refinable parameter types.
We need to record exactly when refinable objects have been modified for the last time (to avoid re-co...
Generic Refinable Object.