Class OpenMMState

java.lang.Object
ffx.openmm.State
ffx.potential.openmm.OpenMMState

public class OpenMMState extends State
Retrieve state information from an OpenMM Simulation.
  • Field Details

    • potentialEnergy

      public final double potentialEnergy
      Potential energy (kcal/mol).
    • kineticEnergy

      public final double kineticEnergy
      Kinetic energy (kcal/mol).
    • totalEnergy

      public final double totalEnergy
      Total energy (kcal/mol).
  • Constructor Details

    • OpenMMState

      protected OpenMMState(com.sun.jna.ptr.PointerByReference pointer, Atom[] atoms, int dof)
      Construct an OpenMM State with the requested information.
      Parameters:
      pointer - Pointer to an OpenMM state.
      atoms - Array of atoms.
      dof - Degrees of freedom.
  • Method Details

    • getAccelerations

      public double[] getAccelerations(@Nullable double[] a)
      The force array contains the OpenMM force information for all atoms. The returned array a contains accelerations for active atoms only.
      Parameters:
      a - Acceleration components for only active atomic coordinates.
      Returns:
      The acceleration for each active atomic coordinate.
    • getGradient

      public double[] getGradient(@Nullable double[] g)
      The force array contains the OpenMM force information for all atoms. The returned array g contains components for active atoms only.
      Parameters:
      g - Gradient components for only active atomic coordinates.
      Returns:
      g The gradient includes only active atoms
    • getPeriodicBoxVectors

      public double[][] getPeriodicBoxVectors()
      Read the periodic lattice vectors from a state.

      The crystal instance will be updated, and passed to the ForceFieldEnergy instance.

      Overrides:
      getPeriodicBoxVectors in class State
      Returns:
      The periodic box vectors.
    • getPositions

      public double[] getPositions(@Nullable double[] x)
      The positions array contains the OpenMM atomic position information for all atoms. The returned array x contains coordinates only for active atoms.
      Parameters:
      x - Atomic coordinates only for active atoms.
      Returns:
      x The atomic coordinates for only active atoms.
    • getVelocities

      public double[] getVelocities(@Nullable double[] v)
      The positions array contains the OpenMM atomic position information for all atoms. The returned array x contains coordinates for active atoms only.
      Parameters:
      v - Velocity only for active atomic coordinates.
      Returns:
      v The velocity for each active atomic coordinate.
    • getPeriodicBoxVolume

      public double getPeriodicBoxVolume()
      Get the periodic box volume.
      Overrides:
      getPeriodicBoxVolume in class State
      Returns:
      The periodic box volume.
    • getPotentialEnergy

      public double getPotentialEnergy()
      Get the potential energy. This field will be zero if the dataTypes mask did not include the energy.
      Overrides:
      getPotentialEnergy in class State
      Returns:
      The potential energy.
    • getKineticEnergy

      public double getKineticEnergy()
      Get the kinetic energy. This field will be zero if the dataTypes mask did not include the energy.
      Overrides:
      getKineticEnergy in class State
      Returns:
      The kinetic energy.
    • getTotalEnergy

      public double getTotalEnergy()
      Get the total energy. This field will be zero if the dataTypes mask did not include the energy.
      Returns:
      The total energy.
    • getDataTypes

      public int getDataTypes()
      Get the mask of information contained in the state.
      Overrides:
      getDataTypes in class State
      Returns:
      The mask of information contained in the state.