Package ffx.openmm

Class State

java.lang.Object
ffx.openmm.State
Direct Known Subclasses:
OpenMMState

public class State extends Object
A State object records a snapshot of the current state of a simulation at a point in time. You create it by calling getState() on a Context. When a State is created, you specify what information should be stored in it. This saves time and memory by only copying in the information that you actually want. This is especially important for forces and energies, since they may need to be calculated. If you query a State object for a piece of information which is not available (because it was not requested when the State was created), it will throw an exception.
  • Constructor Details

    • State

      public State(com.sun.jna.ptr.PointerByReference pointer)
      Constructor.
      Parameters:
      pointer - Pointer to the state returned by a Context.
  • Method Details

    • getPointer

      public com.sun.jna.ptr.PointerByReference getPointer()
      Get the pointer to the state.
      Returns:
      The pointer to the state.
    • getDataTypes

      public int getDataTypes()
      Get the data types.
      Returns:
      The data types.
    • getPositions

      public double[] getPositions()
      Get the positions.
      Returns:
      The positions.
    • getVelocities

      public double[] getVelocities()
      Get the velocities.
      Returns:
      The velocities.
    • getForces

      public double[] getForces()
      Get the forces.
      Returns:
      The forces.
    • getTime

      public double getTime()
      Get the time.
      Returns:
      The time.
    • getKineticEnergy

      public double getKineticEnergy()
      Get the kinetic energy.
      Returns:
      The kinetic energy.
    • getPotentialEnergy

      public double getPotentialEnergy()
      Get the potential energy.
      Returns:
      The potential energy.
    • getPeriodicBoxVectors

      public double[][] getPeriodicBoxVectors()
      Get the periodic box vectors.
      Returns:
      The periodic box vectors.
    • getPeriodicBoxVolume

      public double getPeriodicBoxVolume()
      Get the periodic box volume.
      Returns:
      The periodic box volume.
    • destroy

      public void destroy()
      Destroy the state.