19 #ifndef _OBJCRYST_ZSCATTERER_H_
20 #define _OBJCRYST_ZSCATTERER_H_
22 #include "ObjCryst/CrystVector/CrystVector.h"
24 #include "ObjCryst/ObjCryst/General.h"
26 #include "ObjCryst/ObjCryst/ScatteringPower.h"
27 #include "ObjCryst/ObjCryst/Scatterer.h"
28 #include "ObjCryst/RefinableObj/GlobalOptimObj.h"
62 const int spgSymPosIndex=0)
const;
65 const int spgSymPosIndex=0)
const;
67 const int spgSymPosIndex=0)
const;
69 const int spgSymPosIndex=0)
const;
72 virtual void InitRefParList();
90 const long atomBond=0,
const REAL bondLength=1,
91 const long atomAngle=0,
const REAL bondAngle=M_PI,
92 const long atomDihedral=0,
const REAL dihedralAngle=M_PI,
93 const REAL popu=1.,
const string &name=
"");
95 const string& GetClassName()
const;
96 const string& GetName()
const;
97 void SetName(
const string&);
134 void XMLOutput(ostream &os,
int indent=0)
const;
156 void WXNotifyDelete();
174 void RecordConformation();
175 void SetZAtomWeight(
const CrystVector_REAL weight);
176 void MinimizeChange(
long nbTrial=10000);
180 CrystVector_REAL mXCoord0,mYCoord0,mZCoord0;
181 CrystVector_REAL mAtomWeight;
202 const REAL x=0.,
const REAL y=0.,
const REAL z=0.,
203 const REAL phi=0.,
const REAL chi=0.,
const REAL psi=0.);
217 const long atomBond,
const REAL bondLength,
218 const long atomAngle,
const REAL bondAngle,
219 const long atomDihedral,
const REAL dihedralAngle,
279 virtual void GLInitDisplayList(
const bool onlyIndependentAtoms=
false,
280 const REAL xMin=-.1,
const REAL xMax=1.1,
281 const REAL yMin=-.1,
const REAL yMax=1.1,
282 const REAL zMin=-.1,
const REAL zMax=1.1,
283 const bool displayEnantiomer=
false,
284 const bool displayNames=
false,
285 const bool hideHydrogens=
false,
286 const REAL fadeDistance=0,
287 const bool fullMoleculeInLimits=
false)
const;
300 virtual void XMLOutput(ostream &os,
int indent=0)
const;
304 CrystVector_uint & groupIndex,
305 unsigned int &firstGroup)
const;
309 const CrystVector_REAL&
GetXCoord()
const;
311 const CrystVector_REAL&
GetYCoord()
const;
313 const CrystVector_REAL&
GetZCoord()
const;
355 std::size_t
size()
const;
360 vector<ZAtom*>::const_iterator
begin()
const;
365 vector<ZAtom*>::const_iterator
end()
const;
459 mutable CrystVector_REAL
mXCoord,mYCoord,mZCoord;
476 enum RegularPolyhedraType { TETRAHEDRON, OCTAHEDRON, SQUARE_PLANE, CUBE, ANTIPRISM_TETRAGONAL,
477 PRISM_TETRAGONAL_MONOCAP, PRISM_TETRAGONAL_DICAP,
478 PRISM_TRIGONAL,PRISM_TRIGONAL_TRICAPPED,
479 ICOSAHEDRON, TRIANGLE_PLANE};
511 const REAL x,
const REAL y,
const REAL z,
514 const REAL ligandPopu=1,
515 const REAL phi=0.,
const REAL chi=0.,
const REAL psi=0.);
532 RegularPolyhedraType mPolyhedraType;
536 #include "ObjCryst/ObjCryst/Crystal.h"
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++.
RadiationType
Type of radiation used.
const RefParType * gpRefParTypeObjCryst
Top RefParType for the ObjCryst++ library.
Crystal class: Unit cell, spacegroup, scatterers.
Class to store POV-Ray output options.
Generic type of scatterer: can be an atom, or a more complex assembly of atoms.
Class to compute structure factors for a set of reflections and a Crystal.
Abstract Base Class to describe the scattering power of any Scatterer component in a crystal.
list of scattering positions in a crystal, associated with the corresponding occupancy and a pointer ...
virtual CrystVector_REAL GetTemperatureFactor(const ScatteringData &data, const int spgSymPosIndex=0) const
Get the temperature factor for all reflections of a given ScatteringData object.
virtual REAL GetForwardScatteringFactor(const RadiationType) const
Get the scattering factor at (0,0,0).
virtual CrystMatrix_REAL GetResonantScattFactReal(const ScatteringData &data, const int spgSymPosIndex=0) const
Get the real part of the resonant scattering factor.
ZScatterer * mpZScatterer
a copy of the ZScatterer associated to this object
void Init()
Initialization of the object, used by all constructors, and operator=.
virtual CrystMatrix_REAL GetResonantScattFactImag(const ScatteringData &data, const int spgSymPosIndex=0) const
Get the imaginary part of the resonant scattering factor.
virtual REAL GetRadius() const
Return the physical radius of this type of scatterer (for 3D display purposes).
virtual CrystVector_REAL GetScatteringFactor(const ScatteringData &data, const int spgSymPosIndex=0) const
Get the Scattering factor for all reflections of a given ScatteringData object.
Class for individual atoms in a ZScatterer Object.
long GetZAngleAtom() const
Index of the 2nd atom used to define the atom in the Z-Matrix (the one from which the angle is calcul...
const REAL & GetZDihedralAngle() const
Const access to the dihedral angle parameter.
long GetZDihedralAngleAtom() const
Index of the 3rd atom used to define the atom in the Z-Matrix (the one from which the dihedral angle ...
void SetZDihedralAngle(const REAL)
Access to the dihedral angle parameter.
const ScatteringPower * mpScattPow
The ScatteringPower corresponding to this atom.
const ZScatterer & GetZScatterer() const
Get the ZScatterer associated to this ZAtom.
void SetScatteringPower(const ScatteringPower *)
Set the ScatteringPower.
void SetOccupancy(const REAL)
Access to the dihedral angle parameter.
long mAtomBond
The index (in the ZScatterer) of the atoms which are used to define the position of this atom.
void SetZAngle(const REAL)
Access to the angle parameter.
string mName
Name for this atom.
ZScatterer * mpScatt
the ZScatterer in which this atom is included.
REAL mBondLength
Bond length, angle and dihedral angle.
void SetZBondLength(const REAL)
Access to bondlength parameter.
long GetZBondAtom() const
Index of the 1st atom used to define the atom in the Z-Matrix (the one from which the bondlength is c...
const REAL & GetZBondLength() const
Const access to bondlength parameter.
const REAL & GetZAngle() const
Const access to the angle parameter.
const ScatteringPower * GetScatteringPower() const
ScatteringPower for this atom.
const REAL & GetOccupancy() const
Const access to the ocupancy parameter.
Class to minimize conformation changes for random moves.
virtual REAL GetLogLikelihood() const
Get -log(likelihood) of the current configuration for the object.
ZScatterer: the basic type of complex scatterers, where atom positions are defined using a standard "...
void ImportFenskeHallZMatrix(istream &is, bool named=false)
Import "Fenske-Hall" ZMatrix file (fhz in the babel program http://www.eyesopen.com/babel....
REAL GetZAtomX(const int i) const
Get the X fractionnal coordinate of atom i.
void SetZAngle(const int i, const REAL)
Access to the angle parameter, for the i-th row in the Z-Matrix.
virtual void GlobalOptRandomMove(const REAL mutationAmplitude, const RefParType *type=gpRefParTypeObjCryst)
Make a random move of the current configuration.
void SetCenterAtomIndex(const unsigned int)
Set the index of the central atom (around which the rotation is made)
ZScatterer(const string &name, Crystal &cryst, const REAL x=0., const REAL y=0., const REAL z=0., const REAL phi=0., const REAL chi=0., const REAL psi=0.)
ZScatterer constructor.
std::size_t size() const
STL access to registry of Zatom size.
virtual ZScatterer * CreateCopy() const
const ObjRegistry< ZAtom > & GetZAtomRegistry() const
Access to the registry of ZAtoms.
GlobalScatteringPower * mpGlobalScattPow
the global scattering power used, if mUseGlobalScattPow=true
REAL mPhi
Angles giving the orientation of the ZScatterer (stored in radian)
long GetZBondAtom(const int i) const
Index of the 1st atom used to define the i-th atom in the Z-Matrix (the one from which the bondlength...
REAL GetZAtomZ(const int i) const
Get the Z fractionnal coordinate of atom i.
virtual void InitRefParList()
Prepare refinable parameters for the scatterer object.
void ExportFenskeHallZMatrix(ostream &os)
Export to Fenske-Hall ZMatrix file.
RefinableObjClock mClockCoord
Last time the cartesian coordinates were computed.
long mCenterAtomIndex
Index of the atom used as a pivot (the scatterer is rotated around this atom).
virtual int GetNbComponent() const
Number of components in the scatterer (eg number of point scatterers)
CrystVector_REAL mXCoord
Storage for Cartesian coordinates.
const CrystVector_REAL & GetXCoord() const
Get the list of all ZAtom cartesian x coordinates.
REAL GetPhi() const
Access to phi parameter (overall orientation of the scatterer)
void SetZDihedralAngle(const int i, const REAL)
Access to the dihedral angle parameter, for the i-th row in the Z-Matrix.
virtual void EndOptimization()
This should be called by any optimization class at the end of an optimization.
virtual string GetComponentName(const int i) const
Name for the i-th component of this scatterer.
REAL GetPsi() const
Access to psi parameter (overall orientation of the scatterer)
void SetPhi(const REAL)
Access to phi parameter (overall orientation of the scatterer)
long GetZDihedralAngleAtom(const int i) const
Index of the 3rd atom used to define the i-th atom in the Z-Matrix (the one from which the dihedral a...
REAL GetZAtomY(const int i) const
Get the Y fractionnal coordinate of atom i.
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream.
ObjRegistry< ZAtom > mZAtomRegistry
Registry for ZAtoms in this Scatterer.
REAL GetChi() const
Access to chi parameter (overall orientation of the scatterer)
REAL GetZAngle(const int i) const
Const access to the angle parameter, for the i-th row in the Z-Matrix.
virtual void GetGeneGroup(const RefinableObj &obj, CrystVector_uint &groupIndex, unsigned int &firstGroup) const
Get the gene group assigned to each parameter.
bool mUseGlobalScattPow
Does the ZScatterer use a global scattering power ?
const CrystVector_REAL & GetZCoord() const
Get the list of all ZAtom cartesian x coordinates.
CrystMatrix_long m3DDisplayIndex
For 3D display of the structure, bonds, triangular and quadric faces can be displayed.
virtual void XMLOutput(ostream &os, int indent=0) const
Output to stream in well-formed XML.
ScatteringComponentList mScattCompList
The list of scattering components.
void UpdateCoordinates() const
Update the atom coordinates (in real units, in Angstroems).
const CrystVector_REAL & GetYCoord() const
Get the list of all ZAtom cartesian x coordinates.
CrystVector_int mComponentIndex
Index of atoms in the ScatteringComponentList.
unsigned int GetCenterAtomIndex() const
Get the index of the central atom (around which the rotation is made)
virtual const string & GetClassName() const
Name for this class ("RefinableObj", "Crystal",...).
void Print() const
Print a single line of information about this scatterer.
vector< ZAtom * >::const_iterator begin() const
low-level access to the underlying vector of ZAtom begin().
void AddAtom(const string &name, const ScatteringPower *pow, const long atomBond, const REAL bondLength, const long atomAngle, const REAL bondAngle, const long atomDihedral, const REAL dihedralAngle, const REAL popu=1.)
Add an atom to the Zscatterer.
virtual ostream & POVRayDescription(ostream &os, const CrystalPOVRayOptions &options) const
void SetChi(const REAL)
Access to chi parameter (overall orientation of the scatterer)
vector< ZAtom * >::const_iterator end() const
low-level access to the underlying vector of ZAtom end().
void SetZBondLength(const int i, const REAL)
Access to bondlength parameter, for the i-th row in the Z-Matrix.
void UpdateScattCompList() const
Update the scattering component list, ie compute all atom positions from the bonds/angles/dihedral an...
long mNbDummyAtom
Number of "dummy" atoms in the structure.
REAL GetZDihedralAngle(const int i) const
Const access to the dihedral angle parameter, for the i-th row in the Z-Matrix.
REAL GetZBondLength(const int i) const
Const access to bondlength parameter, for the i-th row in the Z-Matrix.
CrystMatrix_REAL mPhiChiPsiMatrix
Rotation matrix for the orientation of the scatterer.
void SetPsi(const REAL)
Access to psi parameter (overall orientation of the scatterer)
long mNbAtom
Total number of atoms in the structure.
long GetZAngleAtom(const int i) const
Index of the 2nd atom used to define the i-th atom in the Z-Matrix (the one from which the angle is c...
virtual void SetUseGlobalScatteringPower(const bool useIt)
use a Global scattering power for this scatterer ?
virtual const ScatteringComponentList & GetScatteringComponentList() const
Get the list of all scattering components for this scatterer.
ZPolyhedron: a Scatterer to describe polyhedras such as octahedron, tetrahedron, square plane,...
virtual ZPolyhedron * CreateCopy() const
ZPolyhedron(const RegularPolyhedraType type, Crystal &cryst, const REAL x, const REAL y, const REAL z, const string &name, const ScatteringPower *centralAtomPow, const ScatteringPower *periphAtomPow, const REAL centralPeriphDist, const REAL ligandPopu=1, const REAL phi=0., const REAL chi=0., const REAL psi=0.)
ZPolyhedron constructor.
Base object for Monte-Carlo Global Optimization methods.
class to input or output a well-formatted xml beginning or ending tag.
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.
Abstract base class for all objects in wxCryst.
wxCryst class for ZScatterer objects