Package ffx.potential
Class ForceFieldEnergyOpenMM.Context
java.lang.Object
ffx.potential.ForceFieldEnergyOpenMM.Context
- Enclosing class:
ForceFieldEnergyOpenMM
Creates and manage an OpenMM Context.
A Context stores the complete state of a simulation. More specifically, it includes: The current time The position of each particle The velocity of each particle The values of configurable parameters defined by Force objects in the System
You can retrieve a snapshot of the current state at any time by calling getState(). This allows you to record the state of the simulation at various points, either for analysis or for checkpointing. getState() can also be used to retrieve the current forces on each particle and the current energy of the System.
-
Method Summary
Modifier and TypeMethodDescriptioncom.sun.jna.ptr.PointerByReference
Get a Pointer to the OpenMM Context.com.sun.jna.ptr.PointerByReference
Get a Pointer to the OpenMM Integrator.void
integrate
(int numSteps) Use the Context / Integrator combination to take the requested number of steps.void
optimize
(double eps, int maxIterations) Use the Context to optimize the system to the requested tolerance.void
setOpenMMPositions
(double[] x) The array x contains atomic coordinates only for active atoms.void
setOpenMMVelocities
(double[] v) The array v contains velocity values for active atomic coordinates.void
Set the periodic box vectors for a context based on the crystal instance.toString()
-
Method Details
-
getContextPointer
public com.sun.jna.ptr.PointerByReference getContextPointer()Get a Pointer to the OpenMM Context. A Context is created if none has been instantiated yet.- Returns:
- Context pointer.
-
getIntegrator
public com.sun.jna.ptr.PointerByReference getIntegrator()Get a Pointer to the OpenMM Integrator.- Returns:
- Integrator pointer.
-
integrate
public void integrate(int numSteps) Use the Context / Integrator combination to take the requested number of steps.- Parameters:
numSteps
- Number of steps to take.
-
optimize
public void optimize(double eps, int maxIterations) Use the Context to optimize the system to the requested tolerance.- Parameters:
eps
- Convergence criteria (kcal/mole/A).maxIterations
- Maximum number of iterations.
-
setOpenMMPositions
public void setOpenMMPositions(double[] x) The array x contains atomic coordinates only for active atoms.- Parameters:
x
- Atomic coordinate array for only active atoms.
-
setOpenMMVelocities
public void setOpenMMVelocities(double[] v) The array v contains velocity values for active atomic coordinates.- Parameters:
v
- Velocity array for active atoms.
-
setPeriodicBoxVectors
public void setPeriodicBoxVectors()Set the periodic box vectors for a context based on the crystal instance. -
toString
-