Package ffx.openmm
Class RBTorsionForce
java.lang.Object
ffx.openmm.Force
ffx.openmm.RBTorsionForce
This class implements an interaction between groups of four particles that varies with the torsion angle between them
according to the Ryckaert-Bellemans potential. To use it, create an RBTorsionForce object then call addTorsion() once
for each torsion. After a torsion has been added, you can modify its force field parameters by calling setTorsionParameters().
This will have no effect on Contexts that already exist unless you call updateParametersInContext().
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintaddTorsion(int particle1, int particle2, int particle3, int particle4, double c0, double c1, double c2, double c3, double c4, double c5) Add a torsion to the force.voiddestroy()Destroy the force.intGet the number of torsions in the force.voidgetTorsionParameters(int index, com.sun.jna.ptr.IntByReference particle1, com.sun.jna.ptr.IntByReference particle2, com.sun.jna.ptr.IntByReference particle3, com.sun.jna.ptr.IntByReference particle4, com.sun.jna.ptr.DoubleByReference c0, com.sun.jna.ptr.DoubleByReference c1, com.sun.jna.ptr.DoubleByReference c2, com.sun.jna.ptr.DoubleByReference c3, com.sun.jna.ptr.DoubleByReference c4, com.sun.jna.ptr.DoubleByReference c5) Get the parameters for a torsion.voidgetTorsionParameters(int index, IntBuffer particle1, IntBuffer particle2, IntBuffer particle3, IntBuffer particle4, DoubleBuffer c0, DoubleBuffer c1, DoubleBuffer c2, DoubleBuffer c3, DoubleBuffer c4, DoubleBuffer c5) Get the parameters for a torsion.voidsetTorsionParameters(int index, int particle1, int particle2, int particle3, int particle4, double c0, double c1, double c2, double c3, double c4, double c5) Set the parameters for a torsion.voidsetUsesPeriodicBoundaryConditions(boolean periodic) Set whether this force should apply periodic boundary conditions when calculating displacements.voidupdateParametersInContext(Context context) Update the parameters in the OpenMM Context.booleanCheck if the force uses periodic boundary conditions.Methods inherited from class ffx.openmm.Force
getForceGroup, getForceIndex, getName, getPointer, setForceGroup, setForceIndex, setName
-
Constructor Details
-
RBTorsionForce
public RBTorsionForce()Create a new RBTorsionForce.
-
-
Method Details
-
addTorsion
public int addTorsion(int particle1, int particle2, int particle3, int particle4, double c0, double c1, double c2, double c3, double c4, double c5) Add a torsion to the force.- Parameters:
particle1- The index of the first particle forming the torsion.particle2- The index of the second particle forming the torsion.particle3- The index of the third particle forming the torsion.particle4- The index of the fourth particle forming the torsion.c0- The C0 RB parameter.c1- The C1 RB parameter.c2- The C2 RB parameter.c3- The C3 RB parameter.c4- The C4 RB parameter.c5- The C5 RB parameter.- Returns:
- The index of the torsion that was added.
-
destroy
public void destroy()Destroy the force. -
getNumTorsions
public int getNumTorsions()Get the number of torsions in the force.- Returns:
- The number of torsions.
-
getTorsionParameters
public void getTorsionParameters(int index, com.sun.jna.ptr.IntByReference particle1, com.sun.jna.ptr.IntByReference particle2, com.sun.jna.ptr.IntByReference particle3, com.sun.jna.ptr.IntByReference particle4, com.sun.jna.ptr.DoubleByReference c0, com.sun.jna.ptr.DoubleByReference c1, com.sun.jna.ptr.DoubleByReference c2, com.sun.jna.ptr.DoubleByReference c3, com.sun.jna.ptr.DoubleByReference c4, com.sun.jna.ptr.DoubleByReference c5) Get the parameters for a torsion.- Parameters:
index- The index of the torsion for which to get parameters.particle1- The index of the first particle forming the torsion (output).particle2- The index of the second particle forming the torsion (output).particle3- The index of the third particle forming the torsion (output).particle4- The index of the fourth particle forming the torsion (output).c0- The C0 RB parameter (output).c1- The C1 RB parameter (output).c2- The C2 RB parameter (output).c3- The C3 RB parameter (output).c4- The C4 RB parameter (output).c5- The C5 RB parameter (output).
-
getTorsionParameters
public void getTorsionParameters(int index, IntBuffer particle1, IntBuffer particle2, IntBuffer particle3, IntBuffer particle4, DoubleBuffer c0, DoubleBuffer c1, DoubleBuffer c2, DoubleBuffer c3, DoubleBuffer c4, DoubleBuffer c5) Get the parameters for a torsion.- Parameters:
index- The index of the torsion for which to get parameters.particle1- The index of the first particle forming the torsion (output).particle2- The index of the second particle forming the torsion (output).particle3- The index of the third particle forming the torsion (output).particle4- The index of the fourth particle forming the torsion (output).c0- The C0 RB parameter (output).c1- The C1 RB parameter (output).c2- The C2 RB parameter (output).c3- The C3 RB parameter (output).c4- The C4 RB parameter (output).c5- The C5 RB parameter (output).
-
setTorsionParameters
public void setTorsionParameters(int index, int particle1, int particle2, int particle3, int particle4, double c0, double c1, double c2, double c3, double c4, double c5) Set the parameters for a torsion.- Parameters:
index- The index of the torsion for which to set parameters.particle1- The index of the first particle forming the torsion.particle2- The index of the second particle forming the torsion.particle3- The index of the third particle forming the torsion.particle4- The index of the fourth particle forming the torsion.c0- The C0 RB parameter.c1- The C1 RB parameter.c2- The C2 RB parameter.c3- The C3 RB parameter.c4- The C4 RB parameter.c5- The C5 RB parameter.
-
setUsesPeriodicBoundaryConditions
public void setUsesPeriodicBoundaryConditions(boolean periodic) Set whether this force should apply periodic boundary conditions when calculating displacements.- Parameters:
periodic- If true, periodic boundary conditions will be applied.
-
updateParametersInContext
Update the parameters in the OpenMM Context.- Parameters:
context- The OpenMM Context.
-
usesPeriodicBoundaryConditions
public boolean usesPeriodicBoundaryConditions()Check if the force uses periodic boundary conditions.- Overrides:
usesPeriodicBoundaryConditionsin classForce- Returns:
- True if the force uses periodic boundary conditions.
-