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)
      Construct an OpenMM State with the requested information.
      Parameters:
      pointer - Pointer to an OpenMM state.
  • Method Details

    • getAccelerations

      public double[] getAccelerations(@Nullable double[] a, Atom[] atoms)
      The acceleration array will contain the acceleration information for all atoms. This method will convert the OpenMM forces to accelerations using the atom masses.
      Parameters:
      a - Acceleration components for all atoms.
      atoms - The array of atoms, which is needed to convert from force to acceleration.
      Returns:
      The acceleration for each atom in units of Angstroms per picosecond squared.
    • getActiveAccelerations

      public double[] getActiveAccelerations(@Nullable double[] a, Atom[] atoms)
      The acceleration array will contain the acceleration information for all atoms. This method will convert the OpenMM forces to accelerations using the atom masses.
      Parameters:
      a - Acceleration components for all atoms.
      atoms - The array of atoms, which is needed to convert from force to acceleration.
      Returns:
      The acceleration for each atom in units of Angstroms per picosecond squared.
    • getGradient

      public double[] getGradient(@Nullable double[] g)
      The force array contains the OpenMM force information for all atoms.
      Parameters:
      g - Gradient array to use.
      Returns:
      The gradient for all atoms in units of kcal/mol/Angstrom (in a new array if g is null or the wrong size).
    • getActiveGradient

      public double[] getActiveGradient(@Nullable double[] g, Atom[] atoms)
      The force array contains the OpenMM force information for active atoms.
      Parameters:
      g - Gradient array to use.
      Returns:
      The gradient for all atoms in units of kcal/mol/Angstrom (in a new array if g is null or the wrong size).
    • 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 position array contains the OpenMM atomic position information for all atoms. The returned array x is in units of Angstroms.
      Parameters:
      x - Atomic coordinates array to use.
      Returns:
      The atomic coordinates (in a new array if x is null or the wrong size).
    • getActivePositions

      public double[] getActivePositions(@Nullable double[] x, Atom[] atoms)
      The position array contains the OpenMM atomic position information for active atoms. The returned array x is in units of Angstroms.
      Parameters:
      x - Atomic coordinates array to use.
      Returns:
      The atomic coordinates (in a new array if x is null or the wrong size).
    • getVelocities

      public double[] getVelocities(@Nullable double[] v)
      The velocity array contains the OpenMM atomic position information for all atoms. The returned array v is in units of Angstroms per picosecond.
      Parameters:
      v - Atomic velocity array to use.
      Returns:
      The atomic velocities (in a new array if v is null or the wrong size).
    • getActiveVelocities

      public double[] getActiveVelocities(@Nullable double[] v, Atom[] atoms)
      The velocity array contains the OpenMM atomic position information for active atoms. The returned array v is in units of Angstroms per picosecond.
      Parameters:
      v - Atomic velocity array to use.
      Returns:
      The atomic velocities (in a new array if v is null or the wrong size).
    • 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.