Package ffx.openmm

Class HarmonicAngleForce

java.lang.Object
ffx.openmm.Force
ffx.openmm.HarmonicAngleForce

public class HarmonicAngleForce extends Force
This class implements an interaction between groups of three particles that varies harmonically with the angle between them. To use it, create a HarmonicAngleForce object then call addAngle() once for each angle. After an angle has been added, you can modify its force field parameters by calling setAngleParameters(). This will have no effect on Contexts that already exist unless you call updateParametersInContext().
  • Constructor Details

    • HarmonicAngleForce

      public HarmonicAngleForce()
      Create a new HarmonicAngleForce.
  • Method Details

    • addAngle

      public int addAngle(int particle1, int particle2, int particle3, double angle, double k)
      Add an angle term to the force field.
      Parameters:
      particle1 - The index of the first particle forming the angle.
      particle2 - The index of the second particle forming the angle.
      particle3 - The index of the third particle forming the angle.
      angle - The equilibrium angle, measured in radians.
      k - The harmonic force constant for the angle, measured in kJ/mol/radianˆ2.
      Returns:
      The index of the angle that was added.
    • destroy

      public void destroy()
      Destroy the force.
      Specified by:
      destroy in class Force
    • getAngleParameters

      public void getAngleParameters(int index, com.sun.jna.ptr.IntByReference particle1, com.sun.jna.ptr.IntByReference particle2, com.sun.jna.ptr.IntByReference particle3, com.sun.jna.ptr.DoubleByReference angle, com.sun.jna.ptr.DoubleByReference k)
      Get the force field parameters for an angle term.
      Parameters:
      index - The index of the angle for which to get parameters.
      particle1 - The index of the first particle forming the angle (output).
      particle2 - The index of the second particle forming the angle (output).
      particle3 - The index of the third particle forming the angle (output).
      angle - The equilibrium angle, measured in radians (output).
      k - The harmonic force constant for the angle, measured in kJ/mol/radianˆ2 (output).
    • getAngleParameters

      public void getAngleParameters(int index, IntBuffer particle1, IntBuffer particle2, IntBuffer particle3, DoubleBuffer angle, DoubleBuffer k)
      Get the force field parameters for an angle term.
      Parameters:
      index - The index of the angle for which to get parameters.
      particle1 - The index of the first particle forming the angle (output).
      particle2 - The index of the second particle forming the angle (output).
      particle3 - The index of the third particle forming the angle (output).
      angle - The equilibrium angle, measured in radians (output).
      k - The harmonic force constant for the angle, measured in kJ/mol/radianˆ2 (output).
    • getNumAngles

      public int getNumAngles()
      Get the number of angles in the force.
      Returns:
      The number of angles.
    • setAngleParameters

      public void setAngleParameters(int index, int particle1, int particle2, int particle3, double angle, double k)
      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 forming the angle.
      particle2 - The index of the second particle forming the angle.
      particle3 - The index of the third particle forming the angle.
      angle - The equilibrium angle, measured in radians.
      k - The harmonic force constant for the angle, measured in kJ/mol/radianˆ2.
    • 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

      public void updateParametersInContext(Context context)
      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:
      usesPeriodicBoundaryConditions in class Force
      Returns:
      True if the force uses periodic boundary conditions.