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

Bond between two atoms, also a restraint on the associated bond length. More...

+ Inheritance diagram for ObjCryst::MolBond:
+ Collaboration diagram for ObjCryst::MolBond:

Public Member Functions

 MolBond (MolAtom &atom1, MolAtom &atom2, const REAL length, const REAL sigma, const REAL delta, Molecule &parent, const REAL bondOrder=1.)
 Constructor. More...
 
virtual ~MolBond ()
 Destructor. More...
 
const MoleculeGetMolecule () const
 
MoleculeGetMolecule ()
 
string GetName () const
 Name of the bond, e.g. "C3-O4".
 
virtual void XMLOutput (ostream &os, int indent=0) const
 
virtual void XMLInput (istream &is, const XMLCrystTag &tag)
 
virtual REAL GetLogLikelihood () const
 Get -ln(likelihood) for this restraint.
 
REAL GetLogLikelihood (const bool calcDeriv, const bool recalc) const
 
REAL GetDeriv (const std::map< const MolAtom *, XYZ > &m, const bool llk=false) const
 Get the derivative of the bond length, given the derivatives of the atom positions This requires that GetLogLikelihood(calcDeriv=true) be called first. More...
 
void CalcGradient (std::map< MolAtom *, XYZ > &m) const
 Calc log(likelihood) gradient - versus all atomic coordinates. More...
 
const MolAtomGetAtom1 () const
 
const MolAtomGetAtom2 () const
 
MolAtomGetAtom1 ()
 
MolAtomGetAtom2 ()
 
void SetAtom1 (MolAtom &at1)
 
void SetAtom2 (MolAtom &at2)
 
REAL GetLength () const
 
REAL GetLength0 () const
 
REAL GetLengthDelta () const
 
REAL GetLengthSigma () const
 
REAL GetBondOrder () const
 
REAL & Length0 ()
 
REAL & LengthDelta ()
 
REAL & LengthSigma ()
 
REAL & BondOrder ()
 
void SetLength0 (const REAL length)
 
void SetLengthDelta (const REAL length)
 
void SetLengthSigma (const REAL length)
 
void SetBondOrder (const REAL length)
 
bool IsFreeTorsion () const
 
void SetFreeTorsion (const bool isInRing)
 
- Public Member Functions inherited from ObjCryst::Restraint
 Restraint ()
 Default constructor, sets RefParType to gpRefParTypeObjCryst.
 
 Restraint (const RefParType *type)
 constructor specifying the type
 
virtual const RefParTypeGetType () const
 
virtual void SetType (const RefParType *type)
 

Private Attributes

pair< MolAtom *, MolAtom * > mAtomPair
 
REAL mLength0
 
REAL mDelta
 
REAL mSigma
 
REAL mBondOrder
 
bool mIsFreeTorsion
 
MoleculempMol
 Parent Molecule.
 
REAL mLLK
 Stored log(likelihood)
 
XYZ mDerivAtom1
 Derivatives of the bond length with respect to the coordinates of the atoms. More...
 
XYZ mDerivAtom2
 
REAL mDerivLLKCoeff
 The factor used to change the derivative of the length/angle, to the derivative of the log(likelihood). More...
 

Detailed Description

Bond between two atoms, also a restraint on the associated bond length.

Definition at line 152 of file Molecule.h.

Constructor & Destructor Documentation

ObjCryst::MolBond::MolBond ( MolAtom atom1,
MolAtom atom2,
const REAL  length,
const REAL  sigma,
const REAL  delta,
Molecule parent,
const REAL  bondOrder = 1. 
)

Constructor.

Both atoms of the bond are told of the creation of the bond, so that they can keep a list of bonds they are involved in.

Parameters
atom1,atom2the atoms of the bond
lengththe expected bond length
sigma,deltadepending on the calculated length, the log(likelihood) is equal to:
  • within $[length_{0}-\delta;length_{0}+\delta]$: $ -\log(likelihood)= \log\left(2\delta+\sqrt{2\pi\sigma^2}\right)$
  • if $length > length_{0}+\delta$: $ -\log(likelihood)= \log\left(2\delta+\sqrt{2\pi\sigma^2}\right) + \left(\frac{(length-\delta)-length_{0}}{\sigma} \right)^2$
  • if $length < length_{0}-\delta$: $ -\log(likelihood)= \log\left(2\delta+\sqrt{2\pi\sigma^2}\right) + \left(\frac{(length+\delta)-length_{0}}{\sigma} \right)^2$

Definition at line 347 of file Molecule.cpp.

ObjCryst::MolBond::~MolBond ( )
virtual

Destructor.

Notifies the atoms that the bond has disappeared.

Definition at line 358 of file Molecule.cpp.

Member Function Documentation

void ObjCryst::MolBond::CalcGradient ( std::map< MolAtom *, XYZ > &  m) const

Calc log(likelihood) gradient - versus all atomic coordinates.

Parameters
mthis map should have been initialized by adding all possible atom pointers as keys, with all XYZ values equal to zeros. On return, the derivative of the log(likelihood) vs each atomic coordinates will added to each coordinate of the corresponding atoms.

Definition at line 545 of file Molecule.cpp.

REAL ObjCryst::MolBond::GetDeriv ( const std::map< const MolAtom *, XYZ > &  m,
const bool  llk = false 
) const

Get the derivative of the bond length, given the derivatives of the atom positions This requires that GetLogLikelihood(calcDeriv=true) be called first.

If llk=true, this will return the derivative of the llk rather than the derivative of the length or angle

Definition at line 526 of file Molecule.cpp.

Member Data Documentation

XYZ ObjCryst::MolBond::mDerivAtom1
mutableprivate

Derivatives of the bond length with respect to the coordinates of the atoms.

The derivatives are calculated in MolBond::GetLogLikelihood(true)

Definition at line 235 of file Molecule.h.

REAL ObjCryst::MolBond::mDerivLLKCoeff
mutableprivate

The factor used to change the derivative of the length/angle, to the derivative of the log(likelihood).

e.g. (for mDelta=0) $ mDerivLLKCoeff = \frac{L-L_0}{\sigma^2} $

Definition at line 239 of file Molecule.h.


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