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

Molecule : class for complex scatterer descriptions using cartesian coordinates with bond length/angle restraints, and moves either of individual atoms or using torsion bonds. More...

+ Inheritance diagram for ObjCryst::Molecule:
+ Collaboration diagram for ObjCryst::Molecule:

Classes

struct  FlipGroup
 When 3(A1..1n) or more atoms are connected to a same atom A, it defines a 'flip' group, where it is possible to rotate bonds to their symmetric with respect to one plane defined by atoms Ai-A-Aj. More...
 
struct  RotorGroup
 Defines a group of atoms which can be rotated around an axis defined by two other atoms. More...
 
struct  StretchModeGroup
 Group of concurrent StretchModes (affecting common restraints) A given stretch mode can only belong to one group. More...
 

Public Member Functions

 Molecule (Crystal &cryst, const string &name="")
 Constructor. More...
 
 Molecule (const Molecule &old)
 Copy constructor. More...
 
 ~Molecule ()
 Destructor. More...
 
virtual MoleculeCreateCopy () const
 
virtual const string & GetClassName () const
 Name for this class ("RefinableObj", "Crystal",...). More...
 
virtual void SetName (const string &name)
 Name of the object.
 
std::string GetFormula () const
 Formula with atoms in alphabetic order.
 
virtual void Print () const
 Print some info about the scatterer (ideally this should be one line...).
 
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 UpdateDisplay () const
 If there is an interface, this should be automatically be called each time there is a 'new, significant' configuration to report. More...
 
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 EndOptimization ()
 This should be called by any optimization class at the end of an optimization. More...
 
virtual void RandomizeConfiguration ()
 Randomize Configuration (before a global optimization). More...
 
virtual void GlobalOptRandomMove (const REAL mutationAmplitude, const RefParType *type)
 Make a random move of the current configuration. 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 n, RefinablePar &par)
 Get the first derivative values for the LSQ function, for a given parameter. More...
 
virtual void TagNewBestConfig () const
 During a global optimization, tells the object that the current config is the latest "best" config. 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...
 
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
 
void AddAtom (const REAL x, const REAL y, const REAL z, const ScatteringPower *pPow, const string &name, const bool updateDisplay=true)
 Add an atom. More...
 
vector< MolAtom * >::iterator RemoveAtom (MolAtom &, const bool del=true)
 Remove an atom. More...
 
void AddNonFlipAtom (MolAtom &atom)
 
void removeNonFlipAtom (MolAtom &atom)
 
vector< MolAtom * > getNonFlipAtomList ()
 
void AddBond (MolAtom &atom1, MolAtom &atom2, const REAL length, const REAL sigma, const REAL delta, const REAL bondOrder=1., const bool updateDisplay=true)
 Add a bond. More...
 
vector< MolBond * >::iterator RemoveBond (const MolBond &, const bool del=true)
 Remove a bond. More...
 
vector< MolBond * >::const_iterator FindBond (const MolAtom &, const MolAtom &) const
 Searches whether a bond between two atoms already exists. More...
 
vector< MolBond * >::iterator FindBond (const MolAtom &, const MolAtom &)
 Searches whether a bond between two atoms already exists. More...
 
void AddBondAngle (MolAtom &atom1, MolAtom &atom2, MolAtom &atom3, const REAL angle, const REAL sigma, const REAL delta, const bool updateDisplay=true)
 Add a bond angle restraint. More...
 
vector< MolBondAngle * >::iterator RemoveBondAngle (const MolBondAngle &, const bool del=true)
 Remove a BondAngle. More...
 
vector< MolBondAngle * >
::const_iterator 
FindBondAngle (const MolAtom &at1, const MolAtom &at0, const MolAtom &at2) const
 Searches whether a bond between three atoms already exists, searching for either (at1,at2,at3) and (at3,at2,at1), as these are equivalent. More...
 
void AddDihedralAngle (MolAtom &atom1, MolAtom &atom2, MolAtom &atom3, MolAtom &atom4, const REAL angle, const REAL sigma, const REAL delta, const bool updateDisplay=true)
 Add a dihedral angle restraint. More...
 
vector< MolDihedralAngle * >
::iterator 
RemoveDihedralAngle (const MolDihedralAngle &, const bool del=true)
 Remove a dihedral angle. More...
 
vector< MolDihedralAngle * >
::const_iterator 
FindDihedralAngle (const MolAtom &at1, const MolAtom &at2, const MolAtom &at3, const MolAtom &at4) const
 Searches whether a dihedral between four atoms already exists, searching for either (at1,at2,at3,at4) and (at4,at3,at2,at1), as these are equivalent. More...
 
void AddRigidGroup (const RigidGroup &, const bool updateDisplay=true)
 Add a rigid group of atoms. More...
 
std::vector< RigidGroup * >
::iterator 
RemoveRigidGroup (const RigidGroup &group, const bool updateDisplay=true, const bool del=true)
 Remove a rigid group of atoms. More...
 
MolAtomGetAtom (unsigned int i)
 
const MolAtomGetAtom (unsigned int i) const
 
MolAtomGetAtom (const string &name)
 
const MolAtomGetAtom (const string &name) const
 
vector< MolAtom * >
::reverse_iterator 
FindAtom (const string &name)
 Search a MolAtom from its name. More...
 
vector< MolAtom * >
::const_reverse_iterator 
FindAtom (const string &name) const
 Search a MolAtom from its name. More...
 
void OptimizeConformation (const long nbTrial=10000, const REAL stopCost=0.)
 Minimize configuration from internal restraints (bond lengths, angles and dihedral angles). More...
 
void OptimizeConformationSteepestDescent (const REAL maxStep=0.1, const unsigned nbStep=1)
 Optimize the conformation from internal restraints (bond lengths, angles and dihedral angles), using a steepest descent algorithm. More...
 
void MolecularDynamicsEvolve (std::map< MolAtom *, XYZ > &v0, const unsigned nbStep, const REAL dt, const std::vector< MolBond * > &vb, const std::vector< MolBondAngle * > &va, const std::vector< MolDihedralAngle * > &vd, std::map< RigidGroup *, std::pair< XYZ, XYZ > > &vr, REAL nrj0=0)
 Change the conformation of the molecule using molecular dynamics principles. More...
 
const std::vector< MolAtom * > & GetAtomList () const
 
const std::vector< MolBond * > & GetBondList () const
 
const std::vector
< MolBondAngle * > & 
GetBondAngleList () const
 
const std::vector
< MolDihedralAngle * > & 
GetDihedralAngleList () const
 
std::vector< MolAtom * > & GetAtomList ()
 
std::vector< MolBond * > & GetBondList ()
 
std::vector< MolBondAngle * > & GetBondAngleList ()
 
std::vector< MolDihedralAngle * > & GetDihedralAngleList ()
 
std::list
< StretchModeBondLength > & 
GetStretchModeBondLengthList ()
 
std::list< StretchModeBondAngle > & GetStretchModeBondAngleList ()
 
std::list< StretchModeTorsion > & GetStretchModeTorsionList ()
 
const std::list
< StretchModeBondLength > & 
GetStretchModeBondLengthList () const
 
const std::list
< StretchModeBondAngle > & 
GetStretchModeBondAngleList () const
 
const std::list
< StretchModeTorsion > & 
GetStretchModeTorsionList () const
 
const std::vector< RigidGroup * > & GetRigidGroupList () const
 List of rigid group of atoms. More...
 
std::vector< RigidGroup * > & GetRigidGroupList ()
 List of rigid group of atoms. More...
 
void RotateAtomGroup (const MolAtom &at1, const MolAtom &at2, const set< MolAtom * > &atoms, const REAL angle, const bool keepCenter=true)
 Rotate a group of atoms around an axis defined by two atoms. More...
 
void RotateAtomGroup (const MolAtom &at, const REAL vx, const REAL vy, const REAL vz, const set< MolAtom * > &atoms, const REAL angle, const bool keepCenter=true)
 Rotate a group of atoms around an axis defined by one atom and a vector. More...
 
void TranslateAtomGroup (const set< MolAtom * > &atoms, const REAL dx, const REAL dy, const REAL dz, const bool keepCenter=true)
 Translate a group of atoms in a given direction. More...
 
void RestraintStatus (ostream &os) const
 Print the status of all restraints (bond length, angles...)
 
void RestraintExport (ostream &os) const
 Print the restraints (bond length, angles...) as whole labels and number in column text format which accessible to other programs.
 
const map< MolAtom *, set
< MolAtom * > > & 
GetConnectivityTable ()
 Get the connectivity table.
 
RefinableObjClockGetBondListClock ()
 get the clock associated to the list of bonds
 
const RefinableObjClockGetBondListClock () const
 get the clock associated to the list of bonds
 
RefinableObjClockGetAtomPositionClock ()
 Get the clock associated to the atomic positions.
 
const RefinableObjClockGetAtomPositionClock () const
 Get the clock associated to the atomic positions.
 
RefinableObjClockGetRigidGroupClock ()
 Get the clock associated to the list of rigid groups (clicked also whenever a rigid group is modified)
 
const RefinableObjClockGetRigidGroupClock () const
 Get the clock associated to the list of rigid groups (clicked also whenever a rigid group is modified)
 
void RigidifyWithDihedralAngles ()
 Add dihedral angles so as to rigidify the Molecule. More...
 
REAL BondLengthRandomChange (const StretchModeBondLength &mode, const REAL amplitude, const bool respectRestraint=true)
 Stretch a bond, while respecting the Restraint (if any). More...
 
REAL BondAngleRandomChange (const StretchModeBondAngle &mode, const REAL amplitude, const bool respectRestraint=true)
 change a bond angle, while respecting the Restraint (if any). More...
 
REAL DihedralAngleRandomChange (const StretchModeTorsion &mode, const REAL amplitude, const bool respectRestraint=true)
 Change a dihedral angle, while respecting the Restraint (if any). More...
 
const MolAtomGetCenterAtom () const
 Get the atom defining the origin of the Molecule Equal to 0 if no atom as been set. More...
 
void SetCenterAtom (const MolAtom &at)
 Get the atom defining the origin of the Molecule Equal to 0 if no atom as been set. More...
 
const std::vector< MolZAtom > & AsZMatrix (const bool keeporder) const
 Molecule as Z-matrix. More...
 
void SetDeleteSubObjInDestructor (const bool b)
 Set whether to delete the MolAtoms, MolBonds, MolBondAngles and MolDihedralAngles in the destructor. More...
 
virtual void InitRefParList ()
 
void BuildRingList ()
 Build the list of rings in the molecule. More...
 
void BuildConnectivityTable () const
 Build the Connectivity table. More...
 
void BuildRotorGroup ()
 Build the groups of atoms that will be rotated during global optimization. More...
 
void TuneGlobalOptimRotationAmplitude ()
 Tune the rotation amplitude for free torsions and for the overall Molecule Rotation. More...
 
void BuildFlipGroup ()
 Build the groups of atoms that can be flipped. More...
 
void BuildStretchModeBondLength ()
 Build the groups of atoms moved when stretching a bond length, while respecting the Molecule restraints.
 
void BuildStretchModeBondAngle ()
 Build the groups of atoms moved when changing a bond angle, while respecting the Molecule restraints.
 
void BuildStretchModeTorsion ()
 Build the groups of atoms moved when changing a dihedral angle, while respecting the Molecule restraints.
 
void BuildStretchModeTwist ()
 Build the groups of atoms used to twist internally the Molecule, e.g. More...
 
void BuildStretchModeGroups ()
 Separate StretchMode that break more than their assigned restraint from others. More...
 
void BuildMDAtomGroups ()
 Find groups of atoms that cannot be moved relatively to each other using the free or non-free stretch modes. More...
 
void UpdateScattCompList () const
 Update the Molecule::mScattCompList from the cartesian coordinates of all atoms, and the orientation parameters.
 
void InitOptions ()
 Build options for this object.
 
void ResetRigidGroupsPar () const
 Set the orientation & translation parameters of all rigid groups to 0, after correcting the atomic positions. More...
 
void FlipAtomGroup (const FlipGroup &, const bool keepCenter=true)
 Flip a group of atom. See Molecule::FlipGroup.
 
- 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.
 
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 SetApproximationFlag (const bool allow)
 Enable or disable numerical approximations. More...
 
void BeginGlobalOptRandomMove ()
 Raise a flag, to be sure not to make a random change more than once in each RefinableObj. 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...
 
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
 
virtual void GetGeneGroup (const RefinableObj &obj, CrystVector_uint &groupIndex, unsigned int &firstGroup) const
 Get the gene group assigned to each parameter. More...
 
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...
 
const RefinableObjClockGetClockMaster () const
 This clocks records any change in the object. See refinableObj::mClockMaster.
 

Public Attributes

ScatteringComponentList mScattCompList
 The list of scattering components. More...
 
vector< MolAtom * > mvNonFlipAtom
 
vector< MolAtom * > mvpAtom
 The list of atoms. More...
 
vector< MolBond * > mvpBond
 The list of bonds. More...
 
vector< MolBondAngle * > mvpBondAngle
 The list of bond angles. More...
 
vector< MolDihedralAngle * > mvpDihedralAngle
 The list of dihedral angles. More...
 
map< MolAtom *, std::vector
< MolBond * > > 
mvAtomBond
 List of Bonds for each atom. More...
 
std::vector< RigidGroup * > mvRigidGroup
 Rigid groups of atoms. More...
 
list< MolRingmvRing
 The list of rings. More...
 
Quaternion mQuat
 The unit quaternion defining the orientation. More...
 
bool mDeleteSubObjInDestructor
 Base Rotation amplitude (in radians) for the Molecule, so that the average atomic displacement is equal to 0.1 A. More...
 
REAL mBaseRotationAmplitude
 
RefinableObjClock mClockAtomList
 
RefinableObjClock mClockBondList
 
RefinableObjClock mClockBondAngleList
 
RefinableObjClock mClockDihedralAngleList
 
RefinableObjClock mClockRigidGroup
 
RefinableObjClock mClockAtomPosition
 
RefinableObjClock mClockAtomScattPow
 
RefinableObjClock mClockOrientation
 
RefinableObjClock mClockLogLikelihood
 
RefinableObjClock mClockConnectivityTable
 
RefinableObjClock mClockRingList
 
RefinableObjClock mClockRotorGroup
 
RefinableObjClock mClockFlipGroup
 
RefinableObjClock mClockStretchModeBondLength
 
RefinableObjClock mClockStretchModeBondAngle
 
RefinableObjClock mClockStretchModeTorsion
 
RefinableObjClock mClockStretchModeTwist
 
RefinableObjClock mClockMDAtomGroup
 
unsigned long mLocalParamSet
 
unsigned long mRandomConformChangeNbTest
 
unsigned long mRandomConformChangeNbAccept
 
REAL mRandomConformChangeTemp
 
REAL mLastLogLike
 
bool mIsSelfOptimizing
 
RefObjOpt mFlexModel
 OPtion for the different types of flexibility possible for this molecule: rigid body, free atoms + restraints, torsion angles... More...
 
RefObjOpt mFlipModel
 
RefObjOpt mAutoOptimizeConformation
 Option to automatically optimize the starting conformation, if the total restraint cost is too high. More...
 
RefObjOpt mOptimizeOrientation
 Option to optimize the Molecule's orientation. More...
 
RefObjOpt mMoleculeCenter
 Option to choose the center of rotation of the Molecule for the global orientation either as the geometrical center, or as a given atom.
 
const MolAtommpCenterAtom
 Atom chosen as center of rotation, if mRotationCenter is set to use an atom rather than the geometrical center.
 
map< MolAtom *, set< MolAtom * > > mConnectivityTable
 Connectivity table: for each atom, keep the list of atoms bonded to it. More...
 
list< RotorGroupmvRotorGroupTorsion
 List of RotorGroups corresponding to free torsion bonds. More...
 
list< RotorGroupmvRotorGroupTorsionSingleChain
 List of RotorGroups corresponding to free torsion bonds, but with only one chain of atoms listed. More...
 
list< RotorGroupmvRotorGroupInternal
 List of RotorGroups for internal rotations. More...
 
list< FlipGroupmvFlipGroup
 The list of FlipGroups.
 
list< StretchModeBondLengthmvStretchModeBondLength
 List of StretchModeBondLength.
 
list< StretchModeBondAnglemvStretchModeBondAngle
 List of StretchModeBondLength.
 
list< StretchModeTorsionmvStretchModeTorsion
 List of StretchModeBondLength.
 
list< StretchModeTwistmvStretchModeTwist
 List of StretchModeTwist.
 
std::list< StretchMode * > mvpStretchModeFree
 Groups of StretchMode not breaking any restraint (unless the one they are associated to)
 
std::list< StretchMode * > mvpStretchModeNotFree
 Groups of StretchMode breaking restraints (beyond the one they are associated to)
 
list< MDAtomGroupmvMDAtomGroup
 Groups of atoms that should be moved according to molecular dynamics principles.
 
std::set< MolAtom * > mvMDFullAtomGroup
 Full list of atoms that can be moved using molecular dynamics This excludes any atom part of a rigid group.
 
REAL mMDMoveFreq
 Frequency of using molecular dynamics move during GlobalOptRandomMove()
 
REAL mMDMoveEnergy
 Relative energy of molecule during molecular dynamics move Default: 40, 10 (slow conformation change), 200 (large changes)
 
std::vector< MolZAtommAsZMatrix
 The Molecule, as a lightweight ZMatrix, for export purposes.
 
REAL mLogLikelihood
 The current log(likelihood)
 
REAL mLogLikelihoodScale
 Scale (multiplier) for the log(likelihood) More...
 
CrystVector_REAL mLSQCalc
 Current LSQ Calc - one value for each restraint (bond distance, angle or dihedral angle)
 
CrystVector_REAL mLSQObs
 Current LSQ Calc - one value for each restraint (bond distance, angle or dihedral angle ideal values)
 
CrystVector_REAL mLSQWeight
 Current LSQ Calc - one value for each restraint(bond distance, angle or dihedral angle sigmas)
 

Additional Inherited Members

- 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::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

Molecule : class for complex scatterer descriptions using cartesian coordinates with bond length/angle restraints, and moves either of individual atoms or using torsion bonds.

This can also be used for non-organic compounds (polyhedras etc...)

Note
the parametrization is very different from ZScatterer: we keep a list of x,y,z which do not use limits (they must not), but the coordinates must be restrained or constrained from the expected bond lengths, angles and dihedral angles. The list of parameters is re-created in BeginOptimization() (except for the global x y z parameters for the global position of the Molecule, in fractionnal coordinates).
: all atoms must be somehow connected

Definition at line 731 of file Molecule.h.

Constructor & Destructor Documentation

ObjCryst::Molecule::Molecule ( Crystal cryst,
const string &  name = "" 
)

Constructor.

Definition at line 1894 of file Molecule.cpp.

ObjCryst::Molecule::Molecule ( const Molecule old)

Copy constructor.

Definition at line 1982 of file Molecule.cpp.

ObjCryst::Molecule::~Molecule ( )

Destructor.

Definition at line 2075 of file Molecule.cpp.

Member Function Documentation

void ObjCryst::Molecule::AddAtom ( const REAL  x,
const REAL  y,
const REAL  z,
const ScatteringPower pPow,
const string &  name,
const bool  updateDisplay = true 
)

Add an atom.

Definition at line 3786 of file Molecule.cpp.

void ObjCryst::Molecule::AddBond ( MolAtom atom1,
MolAtom atom2,
const REAL  length,
const REAL  sigma,
const REAL  delta,
const REAL  bondOrder = 1.,
const bool  updateDisplay = true 
)

Add a bond.

Definition at line 3923 of file Molecule.cpp.

void ObjCryst::Molecule::AddBondAngle ( MolAtom atom1,
MolAtom atom2,
MolAtom atom3,
const REAL  angle,
const REAL  sigma,
const REAL  delta,
const bool  updateDisplay = true 
)

Add a bond angle restraint.

Definition at line 3976 of file Molecule.cpp.

void ObjCryst::Molecule::AddDihedralAngle ( MolAtom atom1,
MolAtom atom2,
MolAtom atom3,
MolAtom atom4,
const REAL  angle,
const REAL  sigma,
const REAL  delta,
const bool  updateDisplay = true 
)

Add a dihedral angle restraint.

Definition at line 4022 of file Molecule.cpp.

void ObjCryst::Molecule::AddRigidGroup ( const RigidGroup group,
const bool  updateDisplay = true 
)

Add a rigid group of atoms.

See Molecule::mvRigidGroup

Definition at line 4073 of file Molecule.cpp.

const vector< MolZAtom > & ObjCryst::Molecule::AsZMatrix ( const bool  keeporder) const

Molecule as Z-matrix.

Parameters
keeporderif true, the order of the atoms is exactly the same as in the Molecule.

Definition at line 5116 of file Molecule.cpp.

void ObjCryst::Molecule::BeginOptimization ( const bool  allowApproximations = false,
const bool  enableRestraints = false 
)
virtual

This should be called by any optimization class at the begining of an optimization.

This will also check that everything is ready, eg call the RefinableObj::Prepare() function. This also affects all sub-objects.

Note
this may be called several time for some objects which are used by several other objects, or for nested optimizations (e.g. least-squares optimizations inside a global one).
EndOptimization() must be called at the end of the optimization, the same number of time BeginOptimization() was called !
Parameters
allowApproximationsif true, then the object can use faster but less precise functions during the optimization. This is useful for global optimization not using derivatives.
enableRestraintsxrefitem deprecated 28.

Reimplemented from ObjCryst::RefinableObj.

Definition at line 2385 of file Molecule.cpp.

REAL ObjCryst::Molecule::BondAngleRandomChange ( const StretchModeBondAngle mode,
const REAL  amplitude,
const bool  respectRestraint = true 
)

change a bond angle, while respecting the Restraint (if any).

Returns
the actual change in bond angle.
Parameters
the desired angular change. This will be the actual change if there is no restraint or if the restraint is constant in this range.

Definition at line 4931 of file Molecule.cpp.

REAL ObjCryst::Molecule::BondLengthRandomChange ( const StretchModeBondLength mode,
const REAL  amplitude,
const bool  respectRestraint = true 
)

Stretch a bond, while respecting the Restraint (if any).

Returns
the actual change in bond length.
Parameters
the desired change in bond length. This will be the actual change if there is no restraint or if the restraint is constant in this range.

Definition at line 4887 of file Molecule.cpp.

void ObjCryst::Molecule::BuildConnectivityTable ( ) const

Build the Connectivity table.

Definition at line 5299 of file Molecule.cpp.

void ObjCryst::Molecule::BuildFlipGroup ( )

Build the groups of atoms that can be flipped.

This is not const because we temporarily modify the molecule conformation to test which FlipGroups are forbidden by restraints (but it should be const).

Definition at line 7040 of file Molecule.cpp.

void ObjCryst::Molecule::BuildMDAtomGroups ( )

Find groups of atoms that cannot be moved relatively to each other using the free or non-free stretch modes.

Usually these will correspond to atoms inside a flexible ring.

These atoms (if they are not in a rigid group) are stored in a MDAtomGroup so that they can still move using molecular dynamics.

this should be called after BuildStretchModeGroups(), to make sure the list of free/non-free stretch mode has been built.

Definition at line 7368 of file Molecule.cpp.

void ObjCryst::Molecule::BuildRingList ( )

Build the list of rings in the molecule.

The list is only rebuilt if the bond or atom list has changed,so it should be safe to call again this function.

Note
So far this is a const method as the ring list just reflects the bond list and therefore is mutable (see Molecule::mvRing)... but maybe this could change...

Definition at line 5259 of file Molecule.cpp.

void ObjCryst::Molecule::BuildRotorGroup ( )

Build the groups of atoms that will be rotated during global optimization.

This is not const because we temporarily modify the molecule conformation to test which RotorGroups are forbidden by restraints (but it should be const).

Definition at line 5337 of file Molecule.cpp.

void ObjCryst::Molecule::BuildStretchModeGroups ( )

Separate StretchMode that break more than their assigned restraint from others.

See Molecule::mvpStretchModeFree and Molecule::mvpStretchModeNotFree

Definition at line 7213 of file Molecule.cpp.

void ObjCryst::Molecule::BuildStretchModeTwist ( )

Build the groups of atoms used to twist internally the Molecule, e.g.

by rotating one chain of atoms between 2 given atoms.

Definition at line 6595 of file Molecule.cpp.

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

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

Implements ObjCryst::Scatterer.

Definition at line 2100 of file Molecule.cpp.

REAL ObjCryst::Molecule::DihedralAngleRandomChange ( const StretchModeTorsion mode,
const REAL  amplitude,
const bool  respectRestraint = true 
)

Change a dihedral angle, while respecting the Restraint (if any).

Returns
the actual change in bond angle.
Parameters
the desired angular change. This will be the actual change if there is no restraint or if the restraint is constant in this range.

Definition at line 4988 of file Molecule.cpp.

void ObjCryst::Molecule::EndOptimization ( )
virtual

This should be called by any optimization class at the end of an optimization.

This also affects all sub-objects.

Note
this may be called several time for some objects which are used by several other objects.

Reimplemented from ObjCryst::RefinableObj.

Definition at line 2512 of file Molecule.cpp.

vector< MolAtom * >::reverse_iterator ObjCryst::Molecule::FindAtom ( const string &  name)

Search a MolAtom from its name.

Search begins at the end, and the first match is returned. returns mvAtom.rend() if no atom matches

Definition at line 7630 of file Molecule.cpp.

vector< MolAtom * >::const_reverse_iterator ObjCryst::Molecule::FindAtom ( const string &  name) const

Search a MolAtom from its name.

Search begins at the end, and the first match is returned. returns mvAtom.rend() if no atom matches

Definition at line 7643 of file Molecule.cpp.

vector< MolBond * >::const_iterator ObjCryst::Molecule::FindBond ( const MolAtom at1,
const MolAtom at2 
) const

Searches whether a bond between two atoms already exists.

If no bond is found, returns Molecule::mvpAtom.end().

Definition at line 3955 of file Molecule.cpp.

vector< MolBond * >::iterator ObjCryst::Molecule::FindBond ( const MolAtom at1,
const MolAtom at2 
)

Searches whether a bond between two atoms already exists.

If no bond is found, returns Molecule::mvpAtom.end().

Definition at line 3965 of file Molecule.cpp.

vector< MolBondAngle * >::const_iterator ObjCryst::Molecule::FindBondAngle ( const MolAtom at1,
const MolAtom at0,
const MolAtom at2 
) const

Searches whether a bond between three atoms already exists, searching for either (at1,at2,at3) and (at3,at2,at1), as these are equivalent.

If no bond angle is found, returns Molecule::mvpBondAngle.end().

Definition at line 4007 of file Molecule.cpp.

vector< MolDihedralAngle * >::const_iterator ObjCryst::Molecule::FindDihedralAngle ( const MolAtom at1,
const MolAtom at2,
const MolAtom at3,
const MolAtom at4 
) const

Searches whether a dihedral between four atoms already exists, searching for either (at1,at2,at3,at4) and (at4,at3,at2,at1), as these are equivalent.

If no dihedral angle is found, returns Molecule::mvpDihedralAngle.end().

Definition at line 4056 of file Molecule.cpp.

const MolAtom * ObjCryst::Molecule::GetCenterAtom ( ) const

Get the atom defining the origin of the Molecule Equal to 0 if no atom as been set.

Definition at line 5029 of file Molecule.cpp.

const string & ObjCryst::Molecule::GetClassName ( ) const
virtual

Name for this class ("RefinableObj", "Crystal",...).

This is only useful to distinguish different classes when picking up objects from the RefinableObj Global Registry

Reimplemented from ObjCryst::Scatterer.

Definition at line 2106 of file Molecule.cpp.

string ObjCryst::Molecule::GetComponentName ( const int  i) const
virtual

Name for the i-th component of this scatterer.

If the component is an Atom, Then the name is that of the atom. Else, it is the name of the scatterer plus the component number in the scatterer plus the name of the ScatteringPower.

Note
It would be better to return a reference, but we don't want to keep a name for all components... Weeelll, needs some more thinking... see what performance hit results (if any).
Bug:
does not take into account dummy atoms !!

Implements ObjCryst::Scatterer.

Definition at line 3183 of file Molecule.cpp.

REAL ObjCryst::Molecule::GetLogLikelihood ( ) const
virtual

Get -log(likelihood) of the current configuration for the object.

By default (no likelihood evaluation available), this is equal to 0.

This call should not be recursive, it is the task of the algorithm to get the sum of likelihoods for all objects invlolved.

Note
contrary to the old "Cost Function" approach, with log(Likelihood) there is no 'choice' of cost function, so that it is the task of the object to give the optimized likelihood (possibly with user options).

Reimplemented from ObjCryst::RefinableObj.

Definition at line 3058 of file Molecule.cpp.

const CrystVector_REAL & ObjCryst::Molecule::GetLSQDeriv ( const unsigned int  n,
RefinablePar par 
)
virtual

Get the first derivative values for the LSQ function, for a given parameter.

Note that the default method in the base RefinableObj class is to use numerical derivatives, so it should be overridden for better precision.

Todo:
This should be a const method, and the given RefPar should be const too...

Reimplemented from ObjCryst::RefinableObj.

Definition at line 3118 of file Molecule.cpp.

const std::vector< RigidGroup * > & ObjCryst::Molecule::GetRigidGroupList ( ) const

List of rigid group of atoms.

See Molecule::mvRigidGroup

Definition at line 4394 of file Molecule.cpp.

std::vector< RigidGroup * > & ObjCryst::Molecule::GetRigidGroupList ( )

List of rigid group of atoms.

See Molecule::mvRigidGroup

Definition at line 4395 of file Molecule.cpp.

const ScatteringComponentList & ObjCryst::Molecule::GetScatteringComponentList ( ) const
virtual

Get the list of all scattering components for this scatterer.

This is the most important function of this class, giving the list of scattering positions along with the associated ScatteringPower.

Implements ObjCryst::Scatterer.

Definition at line 3175 of file Molecule.cpp.

void ObjCryst::Molecule::GLInitDisplayList ( const bool  noSymmetrics = 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

Create an OpenGL Display List of the scatterer. This should only be called by a Crystal object.

Parameters
noSymmetricsif false (the default), then all symmetrics are shown in the 3D display, within the limits defined by the min/max parameters \ param xMin,xMax,yMin,yMax,zMin,zMax: in fractionnal coordinates, the region in which we want scaterrer to be displayed. The test is made on the center of the scatterer (eg a ZScatterer (molecule) will not be 'cut' on the border).
displayNamesif true, only the names of the scatterers will be displayed, at the position of the scatterers (to actually see them, they will have to be translated with respect to the drawing of the scatterers).
hideHydrogensif true, do not display hydrogens/deuterium and their bonds

Implements ObjCryst::Scatterer.

Definition at line 3398 of file Molecule.cpp.

void ObjCryst::Molecule::GlobalOptRandomMove ( const REAL  mutationAmplitude,
const RefParType type 
)
virtual

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.

RefinableObj::

Parameters
mutationAmplitudemultiplier for the maximum move amplitude, for all parameters
typerestrain the change exclusively to parameters of a given type (same type or descendant from this RefParType).

Reimplemented from ObjCryst::RefinableObj.

Definition at line 2652 of file Molecule.cpp.

void ObjCryst::Molecule::InitRefParList ( )
virtual

Prepare refinable parameters for the scatterer object

Implements ObjCryst::Scatterer.

Definition at line 5208 of file Molecule.cpp.

void ObjCryst::Molecule::MolecularDynamicsEvolve ( std::map< MolAtom *, XYZ > &  v0,
const unsigned  nbStep,
const REAL  dt,
const std::vector< MolBond * > &  vb,
const std::vector< MolBondAngle * > &  va,
const std::vector< MolDihedralAngle * > &  vd,
std::map< RigidGroup *, std::pair< XYZ, XYZ > > &  vr,
REAL  nrj0 = 0 
)

Change the conformation of the molecule using molecular dynamics principles.

Optionnally, move only a subgroup of atoms and only take into account some restraints.

The atoms actually moved are those included as keys in v0, and those part of the rigid bodies in vr.

Parameters
v0initial speed of all atoms. On return, includes the new speed coordinates. Only the atoms used as keys in v0 will be moved, so this should be used to work only on a subgroup of atoms.
nbStepnumber of steps to perform.
dttime step. Recommended value are such that v0[].xyz * dt = 0.001
vb,va,vdvector of bond, bond angle and dihedral angle restraints to be taken into account. If these are empty, the full list of restraints of the Molecule are taken into account, including rigid groups. If they are not empty, then it is assumed that no atom moved belongs to a rigid group.
vrinitial speed for the angular and translation parameters of rigid groups included in the evolution. For each entry of the map the first XYZ coordinates are the speed for RigidGroup::mX,mY,mZ, and the second are the speed for the angular coordinates of the quaternion Q1,Q2,Q3
nrj0the total energy the system should try to maintain. If equal to 0, the initial energy will be used. The speed will be de/increased to compensate any energy change.

Definition at line 4278 of file Molecule.cpp.

void ObjCryst::Molecule::OptimizeConformation ( const long  nbTrial = 10000,
const REAL  stopCost = 0. 
)

Minimize configuration from internal restraints (bond lengths, angles and dihedral angles).

Useful when adding manually atoms to get an initial reasonable configuration.

Definition at line 4184 of file Molecule.cpp.

void ObjCryst::Molecule::OptimizeConformationSteepestDescent ( const REAL  maxStep = 0.1,
const unsigned  nbStep = 1 
)

Optimize the conformation from internal restraints (bond lengths, angles and dihedral angles), using a steepest descent algorithm.

Parameters
maxStepmaximum displacement allowed along any coordinate for all atoms.
nbStepnumber of steps - the gradient is re-calculated after each step.

Definition at line 4202 of file Molecule.cpp.

ostream & ObjCryst::Molecule::POVRayDescription ( ostream &  os,
const CrystalPOVRayOptions options 
) const
virtual

Output a description of the scatterer for POVRay. This should only be called by the Crystal Object to which belongs this scatterer.

Implements ObjCryst::Scatterer.

Definition at line 3189 of file Molecule.cpp.

void ObjCryst::Molecule::RandomizeConfiguration ( )
virtual

Randomize Configuration (before a global optimization).

This Affects only parameters which are limited and not fixed. The randomization also affects all sub-objects (recursive).

Reimplemented from ObjCryst::RefinableObj.

Definition at line 2539 of file Molecule.cpp.

vector< MolAtom * >::iterator ObjCryst::Molecule::RemoveAtom ( MolAtom atom,
const bool  del = true 
)

Remove an atom.

Returns the iterator to the next atom in the list.

This also removes all corresponding bonds, bond angles, etc... If del is true (default), then the MolAtom object is deleted. The del flag gets sent to the RemoveXXX functions for the corresponding objects.

Definition at line 3842 of file Molecule.cpp.

vector< MolBond * >::iterator ObjCryst::Molecule::RemoveBond ( const MolBond bond,
const bool  del = true 
)

Remove a bond.

Returns the iterator to the next bond in the list.

If del is true (default), then the MolBond object is deleted.

Definition at line 3936 of file Molecule.cpp.

vector< MolBondAngle * >::iterator ObjCryst::Molecule::RemoveBondAngle ( const MolBondAngle angle,
const bool  del = true 
)

Remove a BondAngle.

If del is true (default), then the MolBondAngle object is deleted.

Definition at line 3988 of file Molecule.cpp.

vector< MolDihedralAngle * >::iterator ObjCryst::Molecule::RemoveDihedralAngle ( const MolDihedralAngle angle,
const bool  del = true 
)

Remove a dihedral angle.

If del is true (default), then the MolDihedralAngle object is deleted.

Definition at line 4036 of file Molecule.cpp.

vector< RigidGroup * >::iterator ObjCryst::Molecule::RemoveRigidGroup ( const RigidGroup group,
const bool  updateDisplay = true,
const bool  del = true 
)

Remove a rigid group of atoms.

See Molecule::mvRigidGroup

If del is true (default), then the RigidGroup object is deleted.

Definition at line 4153 of file Molecule.cpp.

void ObjCryst::Molecule::ResetRigidGroupsPar ( ) const

Set the orientation & translation parameters of all rigid groups to 0, after correcting the atomic positions.

This is required before saving the structure, as these parameters are not saved.

Definition at line 7806 of file Molecule.cpp.

void ObjCryst::Molecule::RigidifyWithDihedralAngles ( )

Add dihedral angles so as to rigidify the Molecule.

In practice, for every sequence of atoms A-B-C-D, add the dihedral angle defined by these 4 atoms, unless either ABC or BCD are aligned (angle below 10�).

No duplicate dihedral angle is generated.

Definition at line 4589 of file Molecule.cpp.

void ObjCryst::Molecule::RotateAtomGroup ( const MolAtom at1,
const MolAtom at2,
const set< MolAtom * > &  atoms,
const REAL  angle,
const bool  keepCenter = true 
)

Rotate a group of atoms around an axis defined by two atoms.

Parameters
keepCenterif true, the coordinates of the molecule are modified so that only the rotated atoms are moved.

Definition at line 4397 of file Molecule.cpp.

void ObjCryst::Molecule::RotateAtomGroup ( const MolAtom at,
const REAL  vx,
const REAL  vy,
const REAL  vz,
const set< MolAtom * > &  atoms,
const REAL  angle,
const bool  keepCenter = true 
)

Rotate a group of atoms around an axis defined by one atom and a vector.

Parameters
keepCenterif true, the coordinates of the molecule are modified so that only the rotated atoms are moved.

Definition at line 4406 of file Molecule.cpp.

void ObjCryst::Molecule::SetCenterAtom ( const MolAtom at)

Get the atom defining the origin of the Molecule Equal to 0 if no atom as been set.

Definition at line 5034 of file Molecule.cpp.

void ObjCryst::Molecule::SetDeleteSubObjInDestructor ( const bool  b)

Set whether to delete the MolAtoms, MolBonds, MolBondAngles and MolDihedralAngles in the destructor.

By default these sub-objects are deleted.

Definition at line 7802 of file Molecule.cpp.

void ObjCryst::Molecule::TagNewBestConfig ( ) const
virtual

During a global optimization, tells the object that the current config is the latest "best" config.

This can be used by the object to make more intellingent random moves (use with caution: highly experimental !).

Reimplemented from ObjCryst::RefinableObj.

Definition at line 3124 of file Molecule.cpp.

void ObjCryst::Molecule::TranslateAtomGroup ( const set< MolAtom * > &  atoms,
const REAL  dx,
const REAL  dy,
const REAL  dz,
const bool  keepCenter = true 
)

Translate a group of atoms in a given direction.

Parameters
keepCenterif true, the coordinates of the molecule are modified so that only the translated atoms are moved.

Definition at line 4499 of file Molecule.cpp.

void ObjCryst::Molecule::TuneGlobalOptimRotationAmplitude ( )

Tune the rotation amplitude for free torsions and for the overall Molecule Rotation.

This should be done after Molecule::BuildRotorGroup();

Definition at line 6861 of file Molecule.cpp.

void ObjCryst::Molecule::UpdateDisplay ( ) const
virtual

If there is an interface, this should be automatically be called each time there is a 'new, significant' configuration to report.

Reimplemented from ObjCryst::RefinableObj.

Definition at line 2379 of file Molecule.cpp.

void ObjCryst::Molecule::XMLInput ( istream &  is,
const XMLCrystTag tag 
)
virtual

Input From stream.

Todo:
Add an bool XMLInputTag(is,tag) function to recognize all the tags from the stream. So that each inherited class can use the XMLInputTag function from its parent (ie take advantage of inheritance). The children class would first try to interpret the tag, then if unsuccessful would pass it to its parent (thus allowing overloading), etc...

Reimplemented from ObjCryst::RefinableObj.

Definition at line 2267 of file Molecule.cpp.

void ObjCryst::Molecule::XMLOutput ( ostream &  os,
int  indent = 0 
) const
virtual

Output to stream in well-formed XML.

Todo:
Use inheritance.. as for XMLInputTag()...

Reimplemented from ObjCryst::RefinableObj.

Definition at line 2167 of file Molecule.cpp.

Member Data Documentation

RefObjOpt ObjCryst::Molecule::mAutoOptimizeConformation

Option to automatically optimize the starting conformation, if the total restraint cost is too high.

This is done in BeginOptimization().

This is enabled by default, and should be disabled by people who already supply a good starting conformation for their molecule.

Definition at line 1211 of file Molecule.h.

map<MolAtom *,set<MolAtom *> > ObjCryst::Molecule::mConnectivityTable
mutable

Connectivity table: for each atom, keep the list of atoms bonded to it.

All atoms are referenced from their index.

Definition at line 1230 of file Molecule.h.

bool ObjCryst::Molecule::mDeleteSubObjInDestructor

Base Rotation amplitude (in radians) for the Molecule, so that the average atomic displacement is equal to 0.1 A.

Default=0.02*pi

Definition at line 1169 of file Molecule.h.

RefObjOpt ObjCryst::Molecule::mFlexModel

OPtion for the different types of flexibility possible for this molecule: rigid body, free atoms + restraints, torsion angles...

Warning
still EXPERIMENTAL !

Definition at line 1201 of file Molecule.h.

REAL ObjCryst::Molecule::mLogLikelihoodScale

Scale (multiplier) for the log(likelihood)

Changing this scale is equivalent to changing the sigma values of all bonds, bond angles and dihedral angles - but it allows a simple global scaling for the user.

Definition at line 1366 of file Molecule.h.

RefObjOpt ObjCryst::Molecule::mOptimizeOrientation

Option to optimize the Molecule's orientation.

Useful to completely fix the Molecule.

Definition at line 1216 of file Molecule.h.

Quaternion ObjCryst::Molecule::mQuat

The unit quaternion defining the orientation.

Definition at line 1160 of file Molecule.h.

ScatteringComponentList ObjCryst::Molecule::mScattCompList
mutable

The list of scattering components.

this is mutable since it only reflects the list of atoms.

Definition at line 1123 of file Molecule.h.

map<MolAtom* , std::vector<MolBond*> > ObjCryst::Molecule::mvAtomBond

List of Bonds for each atom.

This duplicates the information in Molecule::mvBond

Definition at line 1146 of file Molecule.h.

vector<MolAtom*> ObjCryst::Molecule::mvpAtom

The list of atoms.

Definition at line 1129 of file Molecule.h.

vector<MolBond*> ObjCryst::Molecule::mvpBond

The list of bonds.

Definition at line 1133 of file Molecule.h.

vector<MolBondAngle*> ObjCryst::Molecule::mvpBondAngle

The list of bond angles.

Definition at line 1137 of file Molecule.h.

vector<MolDihedralAngle*> ObjCryst::Molecule::mvpDihedralAngle

The list of dihedral angles.

Definition at line 1141 of file Molecule.h.

std::vector<RigidGroup*> ObjCryst::Molecule::mvRigidGroup

Rigid groups of atoms.

This group will be kept strictly rigid, preventing the use of any stretch mode altering their relative position. The entire group of atoms can however be rotated or translated.

Definition at line 1151 of file Molecule.h.

list<MolRing> ObjCryst::Molecule::mvRing
mutable

The list of rings.

Note
this only reflects the bond list, so it is mutable.

Definition at line 1156 of file Molecule.h.

list<RotorGroup> ObjCryst::Molecule::mvRotorGroupInternal
mutable

List of RotorGroups for internal rotations.

This lists groups of atoms that can be rotated between two given atoms. This is useful to alter the conformation of large rings, where no free torsion bonds exists, and also for long flexible chains.

Definition at line 1276 of file Molecule.h.

list<RotorGroup> ObjCryst::Molecule::mvRotorGroupTorsion
mutable

List of RotorGroups corresponding to free torsion bonds.

In this list are list of atoms on one side of a bond, that can be rotated freely around this bond. Each bond is listed only once, with the side which has the smallest number of atoms.

Definition at line 1261 of file Molecule.h.

list<RotorGroup> ObjCryst::Molecule::mvRotorGroupTorsionSingleChain
mutable

List of RotorGroups corresponding to free torsion bonds, but with only one chain of atoms listed.

The difference with Molecule::mRotorGroupTorsion is that if the bond is A-B, with atom A linked with atoms A1,A2,A3, in this list only one chain (starting either from A1, A2 or A3) will be rotated, instead of the 3 chains. This is useful when searching for the absolute configuration of atoms.

Definition at line 1270 of file Molecule.h.


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