Package ffx.openmm

Class Force

java.lang.Object
ffx.openmm.Force
Direct Known Subclasses:
AndersenThermostat, ATMForce, CMAPTorsionForce, CMMotionRemover, CustomAngleForce, CustomBondForce, CustomCentroidBondForce, CustomCompoundBondForce, CustomCVForce, CustomExternalForce, CustomGBForce, CustomHbondForce, CustomManyParticleForce, CustomNonbondedForce, CustomTorsionForce, CustomVolumeForce, DrudeForce, GayBerneForce, GBSAOBCForce, GeneralizedKirkwoodForce, GKCavitationForce, HarmonicAngleForce, HarmonicBondForce, HippoNonbondedForce, MonteCarloAnisotropicBarostat, MonteCarloBarostat, MonteCarloFlexibleBarostat, MonteCarloMembraneBarostat, MultipoleForce, NonbondedForce, PeriodicTorsionForce, RBTorsionForce, RMSDForce, TorsionTorsionForce, VdwForce, WcaDispersionForce

public abstract class Force extends Object
Force objects apply forces to the particles in a System, or alter their behavior in other ways. This is an abstract class. Subclasses define particular forces.

More specifically, a Force object can do any or all of the following:

  • Add a contribution to the force on each particle
  • Add a contribution to the potential energy of the System
  • Modify the positions and velocities of particles at the start of each time step
  • Define parameters which are stored in the Context and can be modified by the user
  • Change the values of parameters defined by other Force objects at the start of each time step

Forces may be organized into "force groups". This is used for multiple time step integration, and allows subsets of the Forces in a System to be evaluated at different times. By default, all Forces are in group 0. Call setForceGroup() to change this. Some Force subclasses may provide additional methods to further split their computations into multiple groups. Be aware that particular Platforms may place restrictions on the use of force groups, such as requiring all nonbonded forces to be in the same group.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected com.sun.jna.ptr.PointerByReference
    The forcePointer is allocated and deallocated by classes that extend OpenMMForce.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Force(com.sun.jna.ptr.PointerByReference pointer)
    Create a new Force object with the specified pointer.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    Destroy the force.
    int
    Get the force group.
    int
    Get the force index.
    Get the name of the force.
    com.sun.jna.ptr.PointerByReference
    Get the pointer to the OpenMM Force.
    void
    setForceGroup(int forceGroup)
    Set the force group.
    void
    setForceIndex(int forceIndex)
    Set the force index.
    void
    Set the name of the force.
    boolean
    Check if the force use periodic boundary conditions.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • pointer

      protected com.sun.jna.ptr.PointerByReference pointer
      The forcePointer is allocated and deallocated by classes that extend OpenMMForce.
  • Constructor Details

    • Force

      public Force(com.sun.jna.ptr.PointerByReference pointer)
      Create a new Force object with the specified pointer.
      Parameters:
      pointer - A pointer to the native OpenMM Force object.
  • Method Details

    • destroy

      public abstract void destroy()
      Destroy the force.
    • getPointer

      public com.sun.jna.ptr.PointerByReference getPointer()
      Get the pointer to the OpenMM Force.
      Returns:
      The pointer to the OpenMM Force.
    • setForceGroup

      public void setForceGroup(int forceGroup)
      Set the force group.
      Parameters:
      forceGroup - The force group.
    • getForceGroup

      public int getForceGroup()
      Get the force group.
      Returns:
      The force group.
    • setName

      public void setName(String name)
      Set the name of the force.
      Parameters:
      name - The name of the force.
    • getName

      public String getName()
      Get the name of the force.
      Returns:
      The name of the force.
    • setForceIndex

      public void setForceIndex(int forceIndex)
      Set the force index.
      Parameters:
      forceIndex - The force index.
    • getForceIndex

      public int getForceIndex()
      Get the force index.
      Returns:
      The force index.
    • usesPeriodicBoundaryConditions

      public boolean usesPeriodicBoundaryConditions()
      Check if the force use periodic boundary conditions. This is a virtual method that must be implemented by classes that extend OpenMMForce.
      Returns:
      True if the force uses periodic boundary conditions.