Avogadro::Core::Constraint#
-
class Constraint#
Constraints for optimization / dynamics.
This class represents a distance, angle, or torsional constraint / restraint during optimization or dynamics. More technically, these are implemented as stiff harmonic oscillators restraining a particular atom set towards the value.
- Author
Geoffrey R. Hutchison
Public Types
Public Functions
-
inline Constraint(Index a, Index b, Index c = MaxIndex, Index d = MaxIndex, Real value = 0.0)#
Constructor, results in a zero distance constraint
- Parameters:
a – Atom index of the first atom of the constraint
b – Atom index of the second atom of the constraint
c – Atom index of the third atom (for angles or torsions) or MaxIndex
d – Atom index of the fourth atom (for torsion constraints) or MaxIndex
value – The value of the constraint, either Angstrom for distance or radians)
-
inline void set(Index a, Index b, Index c = MaxIndex, Index d = MaxIndex, Real value = 0.0)#
Set the constraint
- Parameters:
a – Atom index of the first atom of the constraint
b – Atom index of the second atom of the constraint
c – Atom index of the third atom (for angles or torsions) or MaxIndex
d – Atom index of the fourth atom (for torsion constraints) or MaxIndex
value – The value of the constraint, either Angstrom for distance or radians)
-
inline void setValue(Real value)#
Set the constraint value (distance, angle, dihedral)
- Parameters:
value – The value of the constraint, either Angstrom for distance or radians)
-
inline Real value() const#
- Returns:
the constraint value
-
inline std::tuple<Index, Index, Index, Index> atoms() const#
- Returns:
the atoms in the constraint as a tuple
-
inline Index aIndex() const#
- Returns:
the atom index from the constraint or MaxIndex
-
inline Index bIndex() const#
-
inline Index cIndex() const#
-
inline Index dIndex() const#
-
inline Real k() const#
-
inline void setK(Real k)#
-
inline Constraint::Type type() const#
- Returns:
the type of constraint
-
inline void setType(Constraint::Type type) const#
Set the type of constraint
- Parameters:
type – The type of constraint