#include <Crystal.h>
Inheritance diagram for ObjCryst::Crystal::
Public Methods | |||
Crystal () | |||
Default Constructor. | |||
Crystal (const double a, const double b, const double c, const string &SpaceGroupId) | |||
Crystal Constructor (orthorombic). More... | |||
Crystal (const double a, const double b, const double c, const double alpha, const double beta, const double gamma, const string &SpaceGroupId) | |||
Crystal Constructor (triclinic). More... | |||
Crystal (const Crystal &oldCryst) | |||
Crystal copy constructor. | |||
~Crystal () | |||
Crystal destructor. | |||
virtual const string | GetClassName () const | ||
Name for this class ("RefinableObj", "Crystal",...). This is only useful to distinguish different classes when picking up objects from the RefinableObj Global Registry. | |||
void | AddScatterer (Scatterer *scatt) | ||
Add a scatterer to the crystal. More... | |||
void | RemoveScatterer (Scatterer *scatt) | ||
Remove a Scatterer. This also deletes the scatterer. | |||
long | GetNbScatterer () const | ||
Number of scatterers in the crystal. | |||
Scatterer & | GetScatt (const string &scattName) | ||
Provides an access to the scatterers. More... | |||
const Scatterer & | GetScatt (const string &scattName) const | ||
Provides a const access to the scatterers. More... | |||
Scatterer & | GetScatt (const long scattIndex) | ||
Provides an access to the scatterers. More... | |||
const Scatterer & | GetScatt (const long scattIndex) const | ||
Provides a const access to the scatterers. More... | |||
ObjRegistry< Scatterer > & | GetScattererRegistry () | ||
Get the registry of scatterers. | |||
ObjRegistry< ScatteringPower > & | GetScatteringPowerRegistry () | ||
Get the registry of ScatteringPower included in this Crystal. | |||
const ObjRegistry< ScatteringPower > & | GetScatteringPowerRegistry () const | ||
Get the registry of ScatteringPower included in this Crystal. | |||
void | AddScatteringPower (ScatteringPower *scattPow) | ||
Add a ScatteringPower for this Crystal. It must be allocated in the heap, and not used by any other Crystal. | |||
void | RemoveScatteringPower (ScatteringPower *scattPow) | ||
Remove a ScatteringPower for this Crystal. (the Scattering power is deleted). This function should check that it is not used any more before removing it. | |||
ScatteringPower & | GetScatteringPower (const string &name) | ||
Find a ScatteringPower from its name. Names must be unique in a given Crystal. | |||
virtual const ScatteringComponentList & | GetScatteringComponentList () const | ||
Get the list of all scattering components. More... | |||
CrystVector_double | GetLatticePar () const | ||
Lattice parameters (a,b,c,alpha,beta,gamma) as a 6-element vector in Angstroems and radians. | |||
double | 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 CrystMatrix_double & | GetBMatrix () const | ||
Get the 'B' matrix (Crystal::mBMatrix)for the crystal (orthogonalization matrix for the given lattice, in the reciprocal space). More... | |||
CrystVector_double | GetOrthonormalCoords (const double x, const double y, const double z) const | ||
Get orthonormal cartesian coordinates for a set of (x,y,z) fractional coordinates. More... | |||
void | FractionalToOrthonormalCoords (double &x, double &y, double &z) const | ||
Get orthonormal cartesian coordinates for a set of (x,y,z) fractional coordinates. More... | |||
void | OrthonormalToFractionalCoords (double &x, double &y, double &z) const | ||
Get fractional cartesian coordinates for a set of (x,y,z) orthonormal coordinates. More... | |||
void | Print (ostream &os=cout) const | ||
Prints some info about the crystal
| |||
const SpaceGroup & | GetSpaceGroup () const | ||
Access to the crystal SpaceGroup object. | |||
SpaceGroup & | GetSpaceGroup () | ||
Access to the crystal SpaceGroup object. | |||
CrystMatrix_double | GetMinDistanceTable (const double minDistance=0.1) const | ||
Minimum interatomic distance between all scattering components (atoms) in the crystal. More... | |||
void | PrintMinDistanceTable (const double minDistance=0.1, ostream &os=cout) const | ||
Print the minimum distance table between all scattering centers (atoms) in the crystal. More... | |||
ostream & | POVRayDescription (ostream &os, bool onlyIndependentAtoms=false) const | ||
XMLOutput POV-Ray Description for this Crystal. More... | |||
virtual void | GLInitDisplayList (const bool onlyIndependentAtoms=false, const double xMin=-.1, const double xMax=1.1, const double yMin=-.1, const double yMax=1.1, const double zMin=-.1, const double zMax=1.1) const | ||
Create an OpenGL DisplayList of the crystal. More... | |||
void | CalcDynPopCorr (const double overlapDist=1., const double mergeDist=.0) const | ||
Compute the 'Dynamical population correction for all atoms. Atoms which are considered "equivalent" (ie currently with the same Z number) and which are overlapping see their Dynamical occupancy changed so that when they fully overlap, they are equivalent to 1 atom. More... | |||
void | ResetDynPopCorr () const | ||
Reset Dynamical Population Correction factors (ie set it to 1). | |||
void | SetUseDynPopCorr (const int use) | ||
Set the use of dynamical population correction (Crystal::mUseDynPopCorr). More... | |||
double | GetBumpMergeCostFunction () const | ||
Get the Anti-bumping/pro-Merging cost function. More... | |||
void | SetBumpMergeDistance (const ScatteringPower &scatt1, const ScatteringPower &scatt2, const double dist=1.5) | ||
Set the Anti-bumping distance between two scattering types. | |||
void | SetBumpMergeDistance (const ScatteringPower &scatt1, const ScatteringPower &scatt2, const double dist, const bool allowMerge) | ||
Set the Anti-bumping distance between two scattering types. | |||
const RefinableObjClock & | GetClockLatticePar () const | ||
When were lattice parameters last changed ? | |||
const RefinableObjClock & | GetClockScattererList () const | ||
When was the list of scatterers last changed ? | |||
unsigned int | GetNbCostFunction () const | ||
Number of Cost functions. | |||
const string & | GetCostFunctionName (const unsigned int) const | ||
Get a Cost function name from its id#. | |||
const string & | GetCostFunctionDescription (const unsigned int) const | ||
Get the (short) description of a cost function. | |||
virtual double | GetCostFunctionValue (const unsigned int) | ||
Get the current value of a cost function this should be const... | |||
virtual void | XMLOutput (ostream &os, int indent=0) const | ||
Output to stream in well-formed XML. More... | |||
virtual void | XMLInput (istream &is, const XMLCrystTag &tag) | ||
Input From stream. More... | |||
virtual void | GlobalOptRandomMove (const double mutationAmplitude) | ||
Make a random move of the current configuration. More... | |||
virtual void | CIFOutput (ostream &os) const | ||
output Crystal structure as a cif file (EXPERIMENTAL !). More... | |||
Private Methods | |||
void | Init (const double a, const double b, const double c, const double alpha, const double beta, const double gamma, const string &SpaceGroupId, const string &name) | ||
Init all Crystal parameters. More... | |||
int | FindScatterer (const string &scattName) const | ||
Find a scatterer (its index # in mpScatterrer[]) with a given name
| |||
void | InitMatrices () const | ||
\internal.Init the (de)orthogonalization matrices. They are re-computed only if parameters have changed since last call. | |||
void | UpdateLatticePar () | ||
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... | |||
void | InitRefParList () | ||
Prepare the refinable parameters list. More... | |||
void | CalcDistTable (const bool fast, const double asymUnitMargin=4) const | ||
Compute the distance Table (mDistTable) for all scattering components. More... | |||
Private Attributes | |||
CrystVector_double | mCellDim | ||
a,b and c in Angstroems, angles (stored) in radians For cubic, rhomboedric crystals, only the 'a' parameter is relevant. For quadratic and hexagonal crystals, only a and c parameters are relevant. The MUTABLE is temporary ! It should not be ! | |||
SpaceGroup | mSpaceGroup | ||
The space group of the crystal. | |||
ObjRegistry< Scatterer > | mScattererRegistry | ||
The registry of scatterers for this crystal. | |||
CrystMatrix_double | mBMatrix | ||
B Matrix (Orthogonalization matrix for reciprocal space) ![]()
![]() . More... | |||
CrystMatrix_double | mOrthMatrix | ||
Eucl Matrix (Orthogonalization matrix for direct space) ![]()
![]() . More... | |||
CrystMatrix_double | mOrthMatrixInvert | ||
inverse of Eucl Matrix (de-orthogonalization matrix for direct space). | |||
CrystMatrix_double | mDistTableSq | ||
Distance table (squared) between all scattering components in the crystal. More... | |||
CrystVector_long | mDistTableIndex | ||
Index of scattering components for the Distance table. More... | |||
ScatteringComponentList | mScattCompList | ||
The list of all scattering components in the crystal. | |||
RefinableObjClock | mLatticeClock | ||
Clock for lattice paramaters. | |||
RefObjOpt | mUseDynPopCorr | ||
Use Dynamical population correction (ScatteringComponent::mDynPopCorr) during Structure factor calculation ? | |||
CrystMatrix_double | mBumpDistanceMatrix | ||
Matrix of "bumping" (squared) distances. | |||
CrystMatrix_bool | mAllowMerge | ||
Allow merging of atoms in the bump/merge function(should be true for identical atoms)? | |||
ObjRegistry< ScatteringPower > | mScatteringPowerRegistry | ||
The registry of ScatteringPower for this Crystal. | |||
RefinableObjClock | mClockScattererList | ||
Last time the list of Scatterers was changed. | |||
RefinableObjClock | mClockLatticePar | ||
Last time lattice parameters were changed. | |||
RefinableObjClock | mClockMetricMatrix | ||
Last time metric matrices were computed. | |||
RefinableObjClock | mClockScattCompList | ||
Last time the ScatteringComponentList was generated. | |||
RefinableObjClock | mClockNeighborTable | ||
Last time the Neighbor Table was generated. | |||
RefinableObjClock | mClockLatticeParUpdate | ||
Last time the lattice parameters whre updated. | |||
RefinableObjClock | mClockDynPopCorr | ||
Last time the dynamical population correction was computed. |
A Crystal object has several main characteristics : (1) a unit cell, (2) a Spacegroup and (3) a list of Scatterer. Also stored in the Crystal is a list of the ScttaringPower used by all the scatterers of this crystal.
The crystal is capable of giving a list of all scattering components (ie the list of all unique scattering 'points' (ScatteringComponent, ie atoms) in the unit cell, each associated to a ScatteringPower).
When those scattering components are on a special position or overlapping with another component of the same type, it is possible to correct dynamically the occupancy of this/these components to effectively have only one component instead of several due to the overlapping. This method is interesting for global optimization where atoms must not be "locked" on a special position. If this "Dynamical Occupancy Correction" is used then no occupancy should be corrected for special positions, since this will be done dynamically.
A crystal structure can be viewed in 3D using OpenGL.
Currently only 3D crystal structures can be handled, with no magnetic structure (that may be done later) and no incommensurate structure.
|
Crystal Constructor (orthorombic).
|
|
Crystal Constructor (triclinic).
|
|
Add a scatterer to the crystal.
|
|
output Crystal structure as a cif file (EXPERIMENTAL !).
|
|
Compute the distance Table (mDistTable) for all scattering components. \internal
|
|
Compute the 'Dynamical population correction for all atoms. Atoms which are considered "equivalent" (ie currently with the same Z number) and which are overlapping see their Dynamical occupancy changed so that when they fully overlap, they are equivalent to 1 atom.
\warning. Do not call this function, which will turn private. This is called by only Crystal::GetScatteringComponentList() |
|
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* |
|
Create an OpenGL DisplayList of the crystal.
|
|
Get the 'B' matrix (Crystal::mBMatrix)for the crystal (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". |
|
Get the Anti-bumping/pro-Merging cost function. Only works (ie returnes a non-null value) if you have added antibump distances using Crystal::SetBumpMergeDistance().
|
|
Minimum interatomic distance between all scattering components (atoms) in the crystal. This will return a symmetrical matrix with NbComp rows and cols, where NbComp is the number of independent scattering components in the unit cell. All distances are given in Angstroems. Note that the distance of a given atom with 'itself' is not generally equal to 0 (except full special position), but equal to the min distance with its symmetrics.
|
|
Get orthonormal cartesian coordinates for a set of (x,y,z) fractional coordinates. Results are given in Amgstroems. The convention is taken following : e1 is chosen along a, e2 in the (a,b) plane, then e3 is along c* |
|
Provides a const access to the scatterers.
|
|
Provides an access to the scatterers.
|
|
Provides a const access to the scatterers.
|
|
Provides an access to the scatterers.
|
|
Get the list of all scattering components.
|
|
Make a random move of the current configuration. This is for global optimization algorithms. the moves for each parameter are less than their global optimization step, multiplied by the mutation amplitude. \warning: this makes a random move for the parameter declared for this object, and it is the duty of the object to decide whether the included objects should be moved and how. (eg an algorithm should only call for a move with the top object, and this object decides how he and his sub-objects moves). By default (RefinableObj implementation) all included objects are moved recursively.
Reimplemented from ObjCryst::RefinableObj. |
|
Init all Crystal parameters.
|
|
Prepare the refinable parameters list. This is called once when creating the crystal. OBSOLETE ? |
|
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* |
|
XMLOutput POV-Ray Description for this Crystal.
|
|
Prints some info about the crystal
|
|
Print the minimum distance table between all scattering centers (atoms) in the crystal.
|
|
Set the use of dynamical population correction (Crystal::mUseDynPopCorr). Atoms which are considered "equivalent" (ie currently with the same Z number) and which are overlapping see their Dynamical occupancy changed so that when they fully overlap, they are equivalent to 1 atom. The Dynamical Occupancy correction will be performed in Crystal::GetScatteringComponentList() automatically. This seriously affects the speed of the calculation, since computing interatomic distances is lenghty.
|
|
Input From stream.
Reimplemented from ObjCryst::RefinableObj. |
|
Output to stream in well-formed XML.
Reimplemented from ObjCryst::RefinableObj. |
|
B Matrix (Orthogonalization matrix for reciprocal space) ![]()
![]() .
|
|
Index of scattering components for the Distance table. These are the index of the scattering components corresponding to each row in Crystal::mDistTableSq. |
|
Distance table (squared) between all scattering components in the crystal. Matrix, in Angstroems^2 (the square root is not computed for optimization purposes), with as many columns as there are components in Crystal::mScattCompList, and as many rows as necessary (to include symmetrics in and nearby the Asymmetric Unit). See Crystal::CalcDistTable() The order of columns follows the order in Crystal::mScattCompList. The order of rows is given in Crystal::mDistTableIndex |
|
Eucl Matrix (Orthogonalization matrix for direct space) ![]()
![]() .
|