Package ffx.openmm
Class State
java.lang.Object
ffx.openmm.State
- Direct Known Subclasses:
OpenMMState
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Destroy the state.int
Get the data types.com.sun.jna.ptr.PointerByReference
Get the energy parameter derivatives.double[]
Get the forces.double
Get the kinetic energy.com.sun.jna.ptr.PointerByReference
Get the parameters.double[][]
Get the periodic box vectors.double
Get the periodic box volume.com.sun.jna.ptr.PointerByReference
Get the pointer to the state.double[]
Get the positions.double
Get the potential energy.long
Get the step count.double
getTime()
Get the time.double[]
Get the velocities.
-
Constructor Details
-
State
public State(com.sun.jna.ptr.PointerByReference pointer) Constructor.- Parameters:
pointer
- Pointer to the state returned by a Context.
-
-
Method Details
-
destroy
public void destroy()Destroy the state. -
getDataTypes
public int getDataTypes()Get the data types.- Returns:
- The data types.
-
getEnergyParameterDerivatives
public com.sun.jna.ptr.PointerByReference getEnergyParameterDerivatives()Get the energy parameter derivatives.- Returns:
- The energy parameter derivatives.
-
getForces
public double[] getForces()Get the forces.- Returns:
- The forces.
-
getKineticEnergy
public double getKineticEnergy()Get the kinetic energy.- Returns:
- The kinetic energy.
-
getParameters
public com.sun.jna.ptr.PointerByReference getParameters()Get the parameters.- Returns:
- The parameters.
-
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.
-
getPointer
public com.sun.jna.ptr.PointerByReference getPointer()Get the pointer to the state.- Returns:
- The pointer to the state.
-
getPositions
public double[] getPositions()Get the positions.- Returns:
- The positions.
-
getPotentialEnergy
public double getPotentialEnergy()Get the potential energy.- Returns:
- The potential energy.
-
getStepCount
public long getStepCount()Get the step count.- Returns:
- The step count.
-
getTime
public double getTime()Get the time.- Returns:
- The time.
-
getVelocities
public double[] getVelocities()Get the velocities.- Returns:
- The velocities.
-