FOX/ObjCryst++  1.10.X (development)
ObjCryst::ZPolyhedron Class Reference

ZPolyhedron: a Scatterer to describe polyhedras such as octahedron, tetrahedron, square plane, etc... More...

+ Inheritance diagram for ObjCryst::ZPolyhedron:
+ Collaboration diagram for ObjCryst::ZPolyhedron:

Public Member Functions

 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. More...
 
 ZPolyhedron (const ZPolyhedron &)
 Copy Constructor.
 
virtual ZPolyhedronCreateCopy () const
 
- Public Member Functions inherited from ObjCryst::ZScatterer
 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. More...
 
 ZScatterer (const ZScatterer &old)
 Copy constructor. More...
 
virtual const string & GetClassName () const
 Name for this class ("RefinableObj", "Crystal",...). More...
 
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. More...
 
virtual int GetNbComponent () const
 Number of components in the scatterer (eg number of point scatterers)
 
virtual const
ScatteringComponentList
GetScatteringComponentList () const
 Get the list of all scattering components for this scatterer. More...
 
virtual string GetComponentName (const int i) const
 Name for the i-th component of this scatterer. More...
 
void Print () const
 Print a single line of information about this scatterer.
 
REAL GetPhi () const
 Access to phi parameter (overall orientation of the scatterer)
 
REAL GetChi () const
 Access to chi parameter (overall orientation of the 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)
 
void SetChi (const REAL)
 Access to chi parameter (overall orientation of the scatterer)
 
void SetPsi (const REAL)
 Access to psi parameter (overall orientation of the scatterer)
 
REAL GetZAtomX (const int i) const
 Get the X fractionnal coordinate of atom i.
 
REAL GetZAtomY (const int i) const
 Get the Y fractionnal coordinate of atom i.
 
REAL GetZAtomZ (const int i) const
 Get the Z fractionnal coordinate of atom i.
 
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 is calculated)
 
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 calculated)
 
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 angle is calculated)
 
REAL GetZBondLength (const int i) const
 Const access to bondlength parameter, for the i-th row in the Z-Matrix.
 
REAL GetZAngle (const int i) const
 Const access to the angle parameter, for the i-th row in the Z-Matrix.
 
REAL GetZDihedralAngle (const int i) const
 Const access to the dihedral angle parameter, for the i-th row in the Z-Matrix.
 
void SetZBondLength (const int i, const REAL)
 Access to bondlength parameter, for the i-th row in the Z-Matrix.
 
void SetZAngle (const int i, const REAL)
 Access to the angle parameter, for the i-th row in the Z-Matrix.
 
void SetZDihedralAngle (const int i, const REAL)
 Access to the dihedral angle parameter, for the i-th row in the Z-Matrix.
 
const ObjRegistry< ZAtom > & GetZAtomRegistry () const
 Access to the registry of ZAtoms.
 
virtual ostream & POVRayDescription (ostream &os, const CrystalPOVRayOptions &options) const
 
virtual void GLInitDisplayList (const bool onlyIndependentAtoms=false, const REAL xMin=-.1, const REAL xMax=1.1, const REAL yMin=-.1, const REAL yMax=1.1, const REAL zMin=-.1, const REAL zMax=1.1, const bool displayEnantiomer=false, const bool displayNames=false, const bool hideHydrogens=false) const
 
virtual void SetUseGlobalScatteringPower (const bool useIt)
 use a Global scattering power for this scatterer ? More...
 
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 GetGeneGroup (const RefinableObj &obj, CrystVector_uint &groupIndex, unsigned int &firstGroup) const
 Get the gene group assigned to each parameter. More...
 
virtual void GlobalOptRandomMove (const REAL mutationAmplitude, const RefParType *type=gpRefParTypeObjCryst)
 Make a random move of the current configuration. More...
 
const CrystVector_REAL & GetXCoord () const
 Get the list of all ZAtom cartesian x coordinates.
 
const CrystVector_REAL & GetYCoord () const
 Get the list of all ZAtom cartesian x coordinates.
 
const CrystVector_REAL & GetZCoord () const
 Get the list of all ZAtom cartesian x coordinates.
 
virtual void EndOptimization ()
 This should be called by any optimization class at the end of an optimization. More...
 
void ImportFenskeHallZMatrix (istream &is, bool named=false)
 Import "Fenske-Hall" ZMatrix file (fhz in the babel program http://www.eyesopen.com/babel.html\ example: use "./babel -ipdb foo.pdb -ofhz foo.fhz -d", to convert a pdb file to a Z-Matrix file (the -d removes hydrogen atoms) More...
 
void ExportFenskeHallZMatrix (ostream &os)
 Export to Fenske-Hall ZMatrix file. More...
 
void SetCenterAtomIndex (const unsigned int)
 Set the index of the central atom (around which the rotation is made)
 
unsigned int GetCenterAtomIndex () const
 Get the index of the central atom (around which the rotation is made)
 
- Public Member Functions inherited from ObjCryst::Scatterer
 Scatterer ()
 Constructor.
 
 Scatterer (const Scatterer &old)
 Copy Constructor.
 
virtual ~Scatterer ()
 Destructor.
 
REAL GetX () const
 X coordinate (fractionnal) of the scatterer (for complex scatterers, this corresponds to the position of one atom of the Scatterer, ideally it should be near the center of the Scatterer. More...
 
REAL GetY () const
 Y coordinate (fractionnal) of the scatterer (for complex scatterers, this corresponds to the position of one atom of the Scatterer, ideally it should be near the center of the Scatterer. More...
 
REAL GetZ () const
 Z coordinate (fractionnal) of the scatterer (for complex scatterers, this corresponds to the position of one atom of the Scatterer, ideally it should be near the center of the Scatterer. More...
 
REAL GetOccupancy () const
 Get the occupancy of the scatterer (0. More...
 
virtual void SetX (const REAL x)
 X coordinate (fractionnal) of the scatterer (for complex scatterers, this corresponds to the position of one atom of the Scatterer, ideally it should be near the center of the Scatterer. More...
 
virtual void SetY (const REAL y)
 Y coordinate (fractionnal) of the scatterer (for complex scatterers, this corresponds to the position of one atom of the Scatterer, ideally it should be near the center of the Scatterer. More...
 
virtual void SetZ (const REAL z)
 Z coordinate (fractionnal) of the scatterer (for complex scatterers, this corresponds to the position of one atom of the Scatterer, ideally it should be near the center of the Scatterer. More...
 
virtual void SetOccupancy (const REAL occupancy)
 Change the occupancy of the scatterer (0. More...
 
 operator string () const
 Conversion function. More...
 
virtual const string & GetColour () const
 Colour associated to this scatterer (using POVRay names) More...
 
virtual const float * GetColourRGB () const
 Colour associated to this scatterer, 3 RGB Coordinates.
 
const RefinableObjClockGetClockScatterer () const
 Last time anything in the scatterer was changed (atoms, positions, scattering power)
 
RefinableObjClockGetClockScatterer ()
 Last time anything in the scatterer was changed (atoms, positions, scattering power)
 
void SetCrystal (Crystal &)
 Set the crystal in which is included this Scatterer.
 
const CrystalGetCrystal () const
 In which crystal is this Scatterer included ?
 
CrystalGetCrystal ()
 In which crystal is this Scatterer included ?
 
- Public Member Functions inherited from ObjCryst::RefinableObj
 RefinableObj ()
 Constructor.
 
 RefinableObj (const bool internalUseOnly)
 Constructor. More...
 
 RefinableObj (const RefinableObj &old)
 Defined not implemented... More...
 
virtual ~RefinableObj ()
 Destructor.
 
virtual const string & GetName () const
 Name of the object.
 
virtual void SetName (const string &name)
 Name of the object.
 
void operator= (const RefinableObj &old)
 Defined not implemented... More...
 
void PrepareForRefinement () const
 Find which parameters are used and not fixed, for a refinement /optimization. More...
 
void FixAllPar ()
 Fix All parameters.
 
void UnFixAllPar ()
 UnFix All parameters.
 
void SetParIsFixed (const long parIndex, const bool fix)
 Fix/un-fix one parameter from its #.
 
void SetParIsFixed (const string &parName, const bool fix)
 Fix/un-fix one parameter from its name.
 
void SetParIsFixed (const RefParType *type, const bool fix)
 Fix/un-fix one family of parameters.
 
void SetParIsUsed (const string &parName, const bool use)
 Set whether a parameter is used.
 
void SetParIsUsed (const RefParType *type, const bool use)
 Set whether a family of parameters is used.
 
long GetNbPar () const
 Total number of refinable parameter in the object. More...
 
long GetNbParNotFixed () const
 Total number of non-fixed parameters. Is initialized by PrepareForRefinement()
 
RefinableParGetPar (const long i)
 Access all parameters in the order they were inputted.
 
const RefinableParGetPar (const long i) const
 Access all parameters in the order they were inputted.
 
RefinableParGetPar (const string &name)
 Access all parameters from their name.
 
const RefinableParGetPar (const string &name) const
 Access all parameters from their name.
 
RefinableParGetPar (const REAL *)
 Access parameter from its adress.
 
const RefinableParGetPar (const REAL *) const
 Access parameter from its adress.
 
RefinableParGetParNotFixed (const long i)
 Access all parameters in the order they were inputted, skipping fixed parameters. More...
 
const RefinableParGetParNotFixed (const long i) const
 Access all parameters in the order they were inputed, skipping fixed parameters. More...
 
void AddPar (const RefinablePar &newRefPar)
 Add a refinable parameter. More...
 
void AddPar (RefinablePar *newRefPar)
 Add a refinable parameter. More...
 
void AddPar (RefinableObj &newRefParList, const bool copyParam=false)
 Add all the parameters in another RefinableObj. More...
 
vector< RefinablePar * >::iterator RemovePar (RefinablePar *refPar)
 Remove a refinable parameter. More...
 
unsigned long CreateParamSet (const string name="") const
 Save the current set of refined values in a new set. More...
 
void ClearParamSet (const unsigned long id) const
 Erase the param set with the given id, releasing memory.
 
void SaveParamSet (const unsigned long id) const
 Save the current set of refined values over a previously-created set of saved values. More...
 
void RestoreParamSet (const unsigned long id)
 Restore a saved set of values. More...
 
const CrystVector_REAL & GetParamSet (const unsigned long setId) const
 Access one save refpar set. More...
 
CrystVector_REAL & GetParamSet (const unsigned long setId)
 Access one save refpar set. More...
 
REAL GetParamSet_ParNotFixedHumanValue (const unsigned long setId, const long parNumber) const
 Access the (human) value of one refined parameter in a saved set of parameters. More...
 
const void EraseAllParamSet ()
 Erase all saved refpar sets. More...
 
const string & GetParamSetName (const unsigned long setId) const
 Get the name associated to a refpar set. More...
 
void SetLimitsAbsolute (const string &parName, const REAL min, const REAL max)
 Change the limits for a given parameter, giving absolute new limits.
 
void SetLimitsAbsolute (const RefParType *type, const REAL min, const REAL max)
 Change the limits for a category of parameters, giving absolute new limits.
 
void SetLimitsRelative (const string &parName, const REAL min, const REAL max)
 Change the limits for a given parameter, giving relative new limits (eg giving -.1 and +.1 will set new limits at the current value + min and current value + max) Thus min should logically be <0 and max >0. More...
 
void SetLimitsRelative (const RefParType *type, const REAL min, const REAL max)
 Change the limits for a category of parameters, giving relative new limits (eg giving -.1 and +.1 will set new limits at the current value + min and current value + max). More...
 
void SetLimitsProportional (const string &parName, const REAL min, const REAL max)
 Change the limits for a given parameter, proportionnaly to the current value. More...
 
void SetLimitsProportional (const RefParType *type, const REAL min, const REAL max)
 Change the limits for a category of parameters, proportionnaly to their current value. More...
 
void SetGlobalOptimStep (const RefParType *type, const REAL step)
 Change the maximum step to use during Global Optimization algorithms.
 
ObjRegistry< RefinableObj > & GetSubObjRegistry ()
 Access to the registry of RefinableObj used by this object.
 
const ObjRegistry< RefinableObj > & GetSubObjRegistry () const
 Access to the registry of RefinableObj used by this object.
 
virtual void RegisterClient (RefinableObj &) const
 Register a new object using this object. More...
 
virtual void DeRegisterClient (RefinableObj &) const
 Deregister an object (which not any more) using this object.
 
virtual const ObjRegistry
< RefinableObj > & 
GetClientRegistry () const
 Get the list of clients.
 
virtual ObjRegistry
< RefinableObj > & 
GetClientRegistry ()
 Get the list of clients.
 
bool IsBeingRefined () const
 Is the object being refined ? (Can be refined by one algorithm at a time only.)
 
virtual void BeginOptimization (const bool allowApproximations=false, const bool enableRestraints=false)
 This should be called by any optimization class at the begining of an optimization. More...
 
virtual void SetApproximationFlag (const bool allow)
 Enable or disable numerical approximations. More...
 
virtual void RandomizeConfiguration ()
 Randomize Configuration (before a global optimization). More...
 
void BeginGlobalOptRandomMove ()
 Raise a flag, to be sure not to make a random change more than once in each RefinableObj. More...
 
virtual REAL GetLogLikelihood () const
 Get -log(likelihood) of the current configuration for the object. More...
 
virtual unsigned int GetNbLSQFunction () const
 Number of LSQ functions.
 
virtual const CrystVector_REAL & GetLSQCalc (const unsigned int) const
 Get the current calculated value for the LSQ function.
 
virtual const CrystVector_REAL & GetLSQObs (const unsigned int) const
 Get the observed values for the LSQ function.
 
virtual const CrystVector_REAL & GetLSQWeight (const unsigned int) const
 Get the weight values for the LSQ function.
 
virtual const CrystVector_REAL & GetLSQDeriv (const unsigned int, RefinablePar &)
 Get the first derivative values for the LSQ function, for a given parameter. More...
 
virtual std::map< RefinablePar
*, CrystVector_REAL > & 
GetLSQ_FullDeriv (const unsigned int, std::set< RefinablePar * > &vPar)
 Get the first derivative for the LSQ function for each parameter supplied in a list. More...
 
void ResetParList ()
 Re-init the list of refinable parameters, removing all parameters. More...
 
virtual void UpdateDisplay () const
 If there is an interface, this should be automatically be called each time there is a 'new, significant' configuration to report. More...
 
unsigned int GetNbOption () const
 Number of Options for this object.
 
RefObjOptGetOption (const unsigned int i)
 Access to the options.
 
const RefObjOptGetOption (const unsigned int i) const
 const access to the options
 
void SetDeleteRefParInDestructor (const bool b)
 Set this object not to delete its list of parameters when destroyed. More...
 
const RefinableObjClockGetRefParListClock () const
 What was the last time a RefinablePar was added/removed ? More...
 
virtual REAL GetRestraintCost () const
 Get the restraint cost (overall penalty of all restraints) More...
 
void AddRestraint (Restraint *pNewRestraint)
 Add a new restraint. More...
 
vector< Restraint * >::iterator RemoveRestraint (Restraint *pRestraint)
 Remove a restraint from the list of known restraints. More...
 
virtual void TagNewBestConfig () const
 During a global optimization, tells the object that the current config is the latest "best" config. More...
 
const RefinableObjClockGetClockMaster () const
 This clocks records any change in the object. See refinableObj::mClockMaster.
 

Private Attributes

RegularPolyhedraType mPolyhedraType
 

Additional Inherited Members

- Protected Member Functions inherited from ObjCryst::ZScatterer
void UpdateCoordinates () const
 Update the atom coordinates (in real units, in Angstroems). More...
 
void UpdateScattCompList () const
 Update the scattering component list, ie compute all atom positions from the bonds/angles/dihedral angles, and convert the coordinates to fractionnal coordinates of the Crystal.
 
- Protected Member Functions inherited from ObjCryst::Scatterer
virtual void InitRGBColour ()
 Get RGB Colour coordinates from Colour Name. More...
 
const RefinableObjClockGetClockScattCompList () const
 Last time the ScatteringComponentList was generated.
 
- Protected Member Functions inherited from ObjCryst::RefinableObj
long FindPar (const string &name) const
 Find a refinable parameter with a given name.
 
long FindPar (const REAL *) const
 Find a refinable parameter from the adress of its value.
 
void AddSubRefObj (RefinableObj &)
 
void RemoveSubRefObj (RefinableObj &)
 
void AddOption (RefObjOpt *opt)
 
virtual void Prepare ()
 
map< unsigned long, pair
< CrystVector_REAL, string >
>::iterator 
FindParamSet (unsigned long id) const
 Find a parameter set with a given id (and check if it is there)
 
- Protected Attributes inherited from ObjCryst::ZScatterer
CrystMatrix_long m3DDisplayIndex
 For 3D display of the structure, bonds, triangular and quadric faces can be displayed. More...
 
ScatteringComponentList mScattCompList
 The list of scattering components.
 
long mNbAtom
 Total number of atoms in the structure.
 
- Protected Attributes inherited from ObjCryst::Scatterer
CrystVector_REAL mXYZ
 coordinates of the scatterer (or of its center..)
 
REAL mOccupancy
 Occupancy : 0 <= occ <= 1 For a multi-atom scatterer (polyhedron,..), this is the overall occupancy of the scatterer (affects all components of the scatterer).
 
string mColourName
 Colour for this scatterer (from POVRay)
 
float mColourRGB [3]
 Colour for this scatterer using RGB.
 
RefinableObjClock mClockScatterer
 Last time anything (number of atoms, positions, scattering power) was changed.
 
RefinableObjClock mClockScattCompList
 
CrystalmpCryst
 The crystal in which the Scatterer is This is needed so that we can know which scattering powers are available in the crystal, and also to convert fractionnal to orthonormal coordinates (for some scatterers only). More...
 
- Protected Attributes inherited from ObjCryst::RefinableObj
string mName
 Name for this RefinableObject. Should be unique, at least in the same scope.+.
 
vector< RefinablePar * > mvpRefPar
 Vector of pointers to the refinable parameters.
 
vector< Restraint * > mvpRestraint
 Vector of pointers to the restraints for this object. More...
 
map< unsigned long, pair
< CrystVector_REAL, string > > 
mvpSavedValuesSet
 Map of (index,pointers to arrays) used to save sets of values for all parameters. More...
 
long mNbRefParNotFixed
 Total of not-fixed parameters.
 
CrystVector_long mRefparNotFixedIndex
 Index of not-fixed parameters.
 
int mOptimizationDepth
 Is the object being refined or optimized ? if mOptimizationDepth=0, no optimization is taking place. More...
 
ObjRegistry< RefinableObjmSubObjRegistry
 Registry of RefinableObject needed for this object (owned by this object or not)
 
ObjRegistry< RefinableObjmClientObjRegistry
 Registry of RefinableObject using this object. More...
 
ObjRegistry< RefObjOptmOptionRegistry
 List of options for this object. More...
 
bool mDeleteRefParInDestructor
 If true (the default), then all RefinablePar will be deleted when the the object is deleted. More...
 
RefinableObjClock mRefParListClock
 Last time the RefinableParList was modified (a parameter added or removed).
 
bool mRandomMoveIsDone
 
CrystVector_REAL mLSQDeriv
 Temporary array used to return derivative values of the LSQ function for given parameters. More...
 
std::map< unsigned int,
std::map< RefinablePar
*, CrystVector_REAL > > 
mLSQ_FullDeriv
 Temporary map to return the derivative of the LSQ function versus a list of parameters. More...
 
RefinableObjClock mClockMaster
 Master clock, which is changed whenever the object has been altered. More...
 

Detailed Description

ZPolyhedron: a Scatterer to describe polyhedras such as octahedron, tetrahedron, square plane, etc...

These are ZScatterer objects, so that even if they are initialized with constraints, these can be removed to make any configuration.

Definition at line 471 of file ZScatterer.h.

Constructor & Destructor Documentation

ObjCryst::ZPolyhedron::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.

Parameters
type: OCTAHEDRON, TETRAHEDRON,...
cryst: a crystal is necessary to transform the orthornormal coordinates (in which the relative atom positions are computed) to fractional ones.
x,y,z: fractional coordinates of the center of the polyhedra
name: name of the Polyhedra ('WO6','TaSe4_a', 'Tetra01'...). The name can have any format but spaces should be avoided, since it will generate problems when reading the names from a file. And there must not be identical name for two scatterers in a given crystal object.
periphAtomPow,centralAtomPowthe ScatteringPower corresponding to the central and peripheral atoms, respectively.
centralPeriphDistthe distance, in angstroems, from the central to the peripheral atoms
ligandPopu: the relative population of ligand atoms, equal to 1/n if ligand atoms are shared by n polyhedra. If you are using the 'Dynamical Polpulation Correction', then keep this parameter to 1.
phi,chi,psiinitial angles for this polyhedron

Definition at line 2175 of file ZScatterer.cpp.

Member Function Documentation

ZPolyhedron * ObjCryst::ZPolyhedron::CreateCopy ( ) const
virtual

so-called Virtual copy constructor, needed to make copies of arrays of Scatterers

Reimplemented from ObjCryst::ZScatterer.

Definition at line 2758 of file ZScatterer.cpp.


The documentation for this class was generated from the following files: