Package ffx.potential.openmm
Class OpenMMState
java.lang.Object
ffx.openmm.State
ffx.potential.openmm.OpenMMState
Retrieve state information from an OpenMM Simulation.
-
Field Summary
Modifier and TypeFieldDescriptionfinal double
Kinetic energy (kcal/mol).final double
Potential energy (kcal/mol).final double
Total energy (kcal/mol). -
Constructor Summary
ModifierConstructorDescriptionprotected
OpenMMState
(com.sun.jna.ptr.PointerByReference pointer, Atom[] atoms, int dof) Construct an OpenMM State with the requested information. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
getAccelerations
(double[] a) The force array contains the OpenMM force information for all atoms.int
Get the mask of information contained in the state.double[]
getGradient
(double[] g) The force array contains the OpenMM force information for all atoms.double
Get the kinetic energy.double[][]
Read the periodic lattice vectors from a state.double
Get the periodic box volume.double[]
getPositions
(double[] x) The positions array contains the OpenMM atomic position information for all atoms.double
Get the potential energy.double
Get the total energy.double[]
getVelocities
(double[] v) The positions array contains the OpenMM atomic position information for all atoms.Methods inherited from class ffx.openmm.State
destroy, getForces, getPointer, getPositions, getTime, getVelocities
-
Field Details
-
potentialEnergy
public final double potentialEnergyPotential energy (kcal/mol). -
kineticEnergy
public final double kineticEnergyKinetic energy (kcal/mol). -
totalEnergy
public final double totalEnergyTotal energy (kcal/mol).
-
-
Constructor Details
-
OpenMMState
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 classState
- 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 classState
- 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 classState
- 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 classState
- 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 classState
- Returns:
- The mask of information contained in the state.
-