Open Babel: OBFFConstraints Class Reference

Public Member Functions

# OBFFConstraints Class Reference

Internal class for OBForceField to handle constraints. More...

`#include <openbabel/forcefield.h>`

List of all members.

## Public Member Functions
| OBFFConstraints ()
| ~OBFFConstraints ()
void | Clear ()
double | GetConstraintEnergy ()
vector3 | GetGradient (int a)
OBFFConstraints & | operator= (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 | ( | ) | `[inline]`

Destructor.

## Member Function Documentation

void Clear | ( | void | ) |

Clear all constraints.

Referenced by OBFFConstraints::~OBFFConstraints().

double GetConstraintEnergy | ( | ) |

Get the constraint energy.

vector3 GetGradient | ( | int | a ) |

Get the constraint gradient for atom with index a.

OBFFConstraints& operator= | ( | const OBFFConstraints & | ai ) | `[inline]`

Get the constrain gradient for the atom.

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().

void SetFactor | ( | double | factor ) |

Set Constraint factor.

void AddIgnore | ( | int | a ) |

Ignore the atom while setting up calculations.

void AddAtomConstraint | ( | int | a ) |

Fix the position of an atom.

void AddAtomXConstraint | ( | int | a ) |

Fix the x coordinate of the atom position.

void AddAtomYConstraint | ( | int | a ) |

Fix the y coordinate of the atom position.

void AddAtomZConstraint | ( | int | a ) |

Fix the z coordinate of the atom position.

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

Constrain the bond length a-b.

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

Constrain the angle a-b-c.

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

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

void DeleteConstraint | ( | int | index ) |

Delete a constraint

index constraint index

double GetFactor | ( | ) |

Get Constraint factor.

int Size | ( | ) | const

Returns:
  the number of set constraints

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

double GetConstraintValue | ( | int | index ) | const

Returns:
  The constraint value, this can be a bond length, angle or torsion angle depending on the constraint type.

int GetConstraintAtomA | ( | int | index ) | const

Returns:
  The constraint atom a (or fixed atom)

index constraint index

int GetConstraintAtomB | ( | int | index ) | const

Returns:
  The constraint atom b

index constraint index

int GetConstraintAtomC | ( | int | index ) | const

Returns:
  The constraint atom c

index constraint index

int GetConstraintAtomD | ( | int | index ) | const

Returns:
  The constraint atom d

index constraint index

bool IsIgnored | ( | int | a ) |

Returns:
  true if this atom is ignored

a atom index

bool IsFixed | ( | int | a ) |

Returns:
  true if this atom is fixed

a atom index

bool IsXFixed | ( | int | a ) |

Returns:
  true if the x coordinate for this atom is fixed

a atom index

bool IsYFixed | ( | int | a ) |

Returns:
  true if the y coordinate for this atom is fixed

a atom index

bool IsZFixed | ( | int | a ) |

Returns:
  true if the z coordinate for this atom is fixed

a atom index

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().

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:

- forcefield.h
- forcefield.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines