Package ffx.openmm

Class RMSDForce

java.lang.Object
ffx.openmm.Force
ffx.openmm.RMSDForce

public class RMSDForce extends Force
This is a force whose energy equals the root mean squared deviation (RMSD) between the current coordinates and a reference structure. It is intended for use with CustomCVForce. You will not normally want a force that exactly equals the RMSD, but there are many situations where it is useful to have a restraining or biasing force that depends on the RMSD in some way.

The force is computed by first aligning the particle positions to the reference structure, then computing the RMSD between the aligned positions and the reference. The computation can optionally be done based on only a subset of the particles in the system.

  • Constructor Details

    • RMSDForce

      public RMSDForce(com.sun.jna.ptr.PointerByReference particles, com.sun.jna.ptr.PointerByReference referencePositions)
      Create an RMSDForce.
      Parameters:
      particles - the indices of the particles to use when computing the RMSD. If this is empty (the default), all particles in the system will be used.
      referencePositions - the reference positions to compute the deviation from. The length of this vector must equal the number of particles in the system, even if not all particles are used in computing the RMSD.
  • Method Details

    • destroy

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

      public com.sun.jna.ptr.PointerByReference getParticles()
      Get the indices of the particles to use when computing the RMSD. If this is empty, all particles in the system will be used.
      Returns:
      the indices of the particles to use when computing the RMSD.
    • getReferencePositions

      public com.sun.jna.ptr.PointerByReference getReferencePositions()
      Get the reference positions to compute the deviation from.
      Returns:
      the reference positions to compute the deviation from.
    • setParticles

      public void setParticles(com.sun.jna.ptr.PointerByReference particles)
      Set the indices of the particles to use when computing the RMSD. If this is empty, all particles in the system will be used.
      Parameters:
      particles - the indices of the particles to use when computing the RMSD.
    • setReferencePositions

      public void setReferencePositions(com.sun.jna.ptr.PointerByReference referencePositions)
      Set the reference positions to compute the deviation from.
      Parameters:
      referencePositions - the reference positions to compute the deviation from.
    • updateParametersInContext

      public void updateParametersInContext(Context context)
      Update the reference positions and particle indices in a Context to match those stored in this Force object. This method provides an efficient method to update certain parameters in an existing Context without needing to reinitialize it. Simply call setReferencePositions() and setParticles() to modify this object's parameters, then call updateParametersInContext() to copy them over to the Context.
      Parameters:
      context - the Context in which to update the parameters.
    • usesPeriodicBoundaryConditions

      public boolean usesPeriodicBoundaryConditions()
      Returns whether or not this force makes use of periodic boundary conditions.
      Overrides:
      usesPeriodicBoundaryConditions in class Force
      Returns:
      true if force uses PBC and false otherwise.