AmoebaAngleForce¶
-
class
OpenMM::
AmoebaAngleForce
¶ This class implements an interaction between triplets of particles that varies with the angle between them. The interaction is defined by a 6th order polynomial. Only the quadratic term is set per-angle. The coefficients of the higher order terms each have a single value that is set globally.
To use it, create an
AmoebaAngleForce
object then calladdAngle()
once for each angle. After an angle has been added, you can modify its force field parameters by callingsetAngleParameters()
. This will have no effect on Contexts that already exist unless you callupdateParametersInContext()
.Methods
AmoebaAngleForce
Create an AmoebaAngleForce
.getNumAngles
Get the number of angle stretch terms in the potential function setAmoebaGlobalAngleCubic
Set the global cubic term getAmoebaGlobalAngleCubic
Get the global cubic term setAmoebaGlobalAngleQuartic
Set the global quartic term getAmoebaGlobalAngleQuartic
Get the global quartic term setAmoebaGlobalAnglePentic
Set the global pentic term getAmoebaGlobalAnglePentic
Get the global pentic term setAmoebaGlobalAngleSextic
Set the global sextic term getAmoebaGlobalAngleSextic
Get the global sextic term addAngle
Add an angle term to the force field. getAngleParameters
Get the force field parameters for an angle term. setAngleParameters
Set the force field parameters for an angle term. updateParametersInContext
Update the per-angle parameters in a Context
to match those stored in thisForce
object.setUsesPeriodicBoundaryConditions
Set whether this force should apply periodic boundary conditions when calculating displacements. usesPeriodicBoundaryConditions
Returns whether or not this force makes use of periodic boundary conditions. -
AmoebaAngleForce
()¶ Create an
AmoebaAngleForce()
.
-
int
getNumAngles
() const¶ Get the number of angle stretch terms in the potential function
-
void
setAmoebaGlobalAngleCubic
(double cubicK)¶ Set the global cubic term
Parameters: - cubicK – the cubic force constant for the angle
-
double
getAmoebaGlobalAngleCubic
() const¶ Get the global cubic term
Returns: global cubicK term
-
void
setAmoebaGlobalAngleQuartic
(double quarticK)¶ Set the global quartic term
Parameters: - quarticK – the quartic force constant for the angle
-
double
getAmoebaGlobalAngleQuartic
() const¶ Get the global quartic term
Returns: global quartic term
-
void
setAmoebaGlobalAnglePentic
(double penticK)¶ Set the global pentic term
Parameters: - penticK – the pentic force constant for the angle
-
double
getAmoebaGlobalAnglePentic
() const¶ Get the global pentic term
Returns: global penticK term
-
void
setAmoebaGlobalAngleSextic
(double sexticK)¶ Set the global sextic term
Parameters: - sexticK – the sextic force constant for the angle
-
double
getAmoebaGlobalAngleSextic
() const¶ Get the global sextic term
Returns: global sextic term
-
int
addAngle
(int particle1, int particle2, int particle3, double length, double quadraticK)¶ Add an angle term to the force field.
Parameters: - particle1 – the index of the first particle connected by the angle
- particle2 – the index of the second particle connected by the angle
- particle3 – the index of the third particle connected by the angle
- length – the equilibrium angle, measured in degrees
- quadraticK – the quadratic force constant for the angle, measured in kJ/mol/radian^2
Returns: the index of the angle that was added
-
void
getAngleParameters
(int index, int &particle1, int &particle2, int &particle3, double &length, double &quadraticK) const¶ Get the force field parameters for an angle term.
Parameters: - index – the index of the angle for which to get parameters
- particle1 – [out] the index of the first particle connected by the angle
- particle2 – [out] the index of the second particle connected by the angle
- particle3 – [out] the index of the third particle connected by the angle
- length – [out] the equilibrium angle, measured in degrees
- quadraticK – [out] the quadratic force constant for the angle, measured in kJ/mol/radian^2
-
void
setAngleParameters
(int index, int particle1, int particle2, int particle3, double length, double quadraticK)¶ Set the force field parameters for an angle term.
Parameters: - index – the index of the angle for which to set parameters
- particle1 – the index of the first particle connected by the angle
- particle2 – the index of the second particle connected by the angle
- particle3 – the index of the third particle connected by the angle
- length – the equilibrium angle, measured in degrees
- quadraticK – the quadratic force constant for the angle, measured in kJ/mol/radian^2
-
void
updateParametersInContext
(Context &context)¶ Update the per-angle parameters in a
Context
to match those stored in thisForce
object. This method provides an efficient method to update certain parameters in an existingContext
without needing to reinitialize it. Simply callsetAngleParameters()
to modify this object’s parameters, then callupdateParametersInContext()
to copy them over to theContext
.The only information this method updates is the values of per-angle parameters. The set of particles involved in an angle cannot be changed, nor can new angles be added.
-
void
setUsesPeriodicBoundaryConditions
(bool periodic)¶ Set whether this force should apply periodic boundary conditions when calculating displacements. Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
-
bool
usesPeriodicBoundaryConditions
() const¶ Returns whether or not this force makes use of periodic boundary conditions.
Returns: true if force uses PBC and false otherwise
-