Open Babel  3.0
Public Member Functions | List of all members
OBFFConstraints Class Reference

#include <openbabel/forcefield.h>

Public Member Functions

 OBFFConstraints ()
 
 ~OBFFConstraints ()
 
void Clear ()
 
double GetConstraintEnergy ()
 
vector3 GetGradient (int a)
 
OBFFConstraintsoperator= (const OBFFConstraints &ai)
 
void Setup (OBMol &mol)
 
Methods to set constraints
void SetFactor (double factor)
 
void AddIgnore (int a)
 
void AddAtomConstraint (int a)
 
void AddAtomXConstraint (int a)
 
void AddAtomYConstraint (int a)
 
void AddAtomZConstraint (int a)
 
void AddDistanceConstraint (int a, int b, double length)
 
void AddAngleConstraint (int a, int b, int c, double angle)
 
void AddTorsionConstraint (int a, int b, int c, int d, double torsion)
 
void DeleteConstraint (int index)
 
Methods to get information about set constraints
double GetFactor ()
 
int Size () const
 
int GetConstraintType (int index) const
 
double GetConstraintValue (int index) const
 
int GetConstraintAtomA (int index) const
 
int GetConstraintAtomB (int index) const
 
int GetConstraintAtomC (int index) const
 
int GetConstraintAtomD (int index) const
 
bool IsIgnored (int a)
 
bool IsFixed (int a)
 
bool IsXFixed (int a)
 
bool IsYFixed (int a)
 
bool IsZFixed (int a)
 
OBBitVec GetIgnoredBitVec ()
 
OBBitVec GetFixedBitVec ()
 

Detailed Description

Internal class for OBForceField to handle constraints.

Since
version 2.2

Constructor & Destructor Documentation

◆ OBFFConstraints()

Constructor.

◆ ~OBFFConstraints()

~OBFFConstraints ( )
inline

Destructor.

Member Function Documentation

◆ Clear()

void Clear ( void  )

Clear all constraints.

◆ GetConstraintEnergy()

double GetConstraintEnergy ( )

Get the constraint energy.

◆ GetGradient()

vector3 GetGradient ( int  a)

Get the constraint gradient for atom with index a.

◆ operator=()

OBFFConstraints& operator= ( const OBFFConstraints ai)
inline

Get the constrain gradient for the atom.

◆ Setup()

void Setup ( OBMol mol)

Translate indices to OBAtom* objects, this function is called from OBForceField::Setup, this function doesn't have to be called from anywhere else.

Referenced by OBForceField::SetConstraints(), and OBForceField::Setup().

◆ SetFactor()

void SetFactor ( double  factor)

Set Constraint factor.

◆ AddIgnore()

void AddIgnore ( int  a)

Ignore the atom while setting up calculations.

◆ AddAtomConstraint()

void AddAtomConstraint ( int  a)

Fix the position of an atom.

◆ AddAtomXConstraint()

void AddAtomXConstraint ( int  a)

Fix the x coordinate of the atom position.

◆ AddAtomYConstraint()

void AddAtomYConstraint ( int  a)

Fix the y coordinate of the atom position.

◆ AddAtomZConstraint()

void AddAtomZConstraint ( int  a)

Fix the z coordinate of the atom position.

◆ AddDistanceConstraint()

void AddDistanceConstraint ( int  a,
int  b,
double  length 
)

Constrain the bond length a-b.

◆ AddAngleConstraint()

void AddAngleConstraint ( int  a,
int  b,
int  c,
double  angle 
)

Constrain the angle a-b-c.

◆ AddTorsionConstraint()

void AddTorsionConstraint ( int  a,
int  b,
int  c,
int  d,
double  torsion 
)

Constrain the torsion angle a-b-c-d.

◆ DeleteConstraint()

void DeleteConstraint ( int  index)

Delete a constraint

index constraint index

◆ GetFactor()

double GetFactor ( )

Get Constraint factor.

◆ Size()

int Size ( ) const
Returns
the number of set constraints

◆ GetConstraintType()

int GetConstraintType ( int  index) const

The following constraint types are known: OBFF_CONST_IGNORE (ignore the atom while setting up calculations, forcefield implementations need to check this value in their setup function), OBFF_CONST_ATOM (fix atom position), OBFF_CONST_ATOM_X (fix x coordinate), OBFF_CONST_ATOM_Y (fix y coordinate), OBFF_CONST_ATOM_Z (fix z coordinate), OBFF_CONST_BOND (constrain bond length), OBFF_CONST_ANGLE (constrain angle), OBFF_CONST_TORSION (constrain torsion angle)

Returns
the constraint type

◆ GetConstraintValue()

double GetConstraintValue ( int  index) const
Returns
The constraint value, this can be a bond length, angle or torsion angle depending on the constraint type.

◆ GetConstraintAtomA()

int GetConstraintAtomA ( int  index) const
Returns
The constraint atom a (or fixed atom)
index constraint index

◆ GetConstraintAtomB()

int GetConstraintAtomB ( int  index) const
Returns
The constraint atom b
index constraint index

◆ GetConstraintAtomC()

int GetConstraintAtomC ( int  index) const
Returns
The constraint atom c
index constraint index

◆ GetConstraintAtomD()

int GetConstraintAtomD ( int  index) const
Returns
The constraint atom d
index constraint index

◆ IsIgnored()

bool IsIgnored ( int  a)
Returns
true if this atom is ignored
a atom index

◆ IsFixed()

bool IsFixed ( int  a)
Returns
true if this atom is fixed
a atom index

◆ IsXFixed()

bool IsXFixed ( int  a)
Returns
true if the x coordinate for this atom is fixed
a atom index

◆ IsYFixed()

bool IsYFixed ( int  a)
Returns
true if the y coordinate for this atom is fixed
a atom index

◆ IsZFixed()

bool IsZFixed ( int  a)
Returns
true if the z coordinate for this atom is fixed
a atom index

◆ GetIgnoredBitVec()

OBBitVec GetIgnoredBitVec ( )
inline
Returns
the ignored atom indexes as bitvec. (used in OBForceField::Setup() to determine if a call to OBForceField::SetupCalculations() is needed)

Referenced by OBForceField::SetConstraints(), and OBForceField::Setup().

◆ GetFixedBitVec()

OBBitVec GetFixedBitVec ( )
inline
Returns
the fixed atom indexes as bitvec. (used in OBForceField::SystematicRotorSearch() and similar)

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