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
FieldsModifier and TypeFieldDescriptionfinal doubleKinetic energy (kcal/mol).final doublePotential energy (kcal/mol).final doubleTotal energy (kcal/mol). -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOpenMMState(com.sun.jna.ptr.PointerByReference pointer) Construct an OpenMM State with the requested information. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]getAccelerations(double[] a, Atom[] atoms) The acceleration array will contain the acceleration information for all atoms.double[]getActiveAccelerations(double[] a, Atom[] atoms) The acceleration array will contain the acceleration information for all atoms.double[]getActiveGradient(double[] g, Atom[] atoms) The force array contains the OpenMM force information for active atoms.double[]getActivePositions(double[] x, Atom[] atoms) The position array contains the OpenMM atomic position information for active atoms.double[]getActiveVelocities(double[] v, Atom[] atoms) The velocity array contains the OpenMM atomic position information for active atoms.intGet the mask of information contained in the state.double[]getGradient(double[] g) The force array contains the OpenMM force information for all atoms.doubleGet the kinetic energy.double[][]Read the periodic lattice vectors from a state.doubleGet the periodic box volume.double[]getPositions(double[] x) The position array contains the OpenMM atomic position information for all atoms.doubleGet the potential energy.doubleGet the total energy.double[]getVelocities(double[] v) The velocity array contains the OpenMM atomic position information for all atoms.Methods inherited from class ffx.openmm.State
destroy, getEnergyParameterDerivatives, getForces, getParameters, getPointer, getPositions, getStepCount, 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
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
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
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
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:
getPeriodicBoxVectorsin classState- 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
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
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:
getPeriodicBoxVolumein 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:
getPotentialEnergyin 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:
getKineticEnergyin 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:
getDataTypesin classState- Returns:
- The mask of information contained in the state.
-