OpenMM
|
An Integrator defines a method for simulating a System by integrating the equations of motion. More...
#include <Integrator.h>
Public Member Functions | |
Integrator () | |
virtual | ~Integrator () |
double | getStepSize () const |
Get the size of each time step, in picoseconds. | |
void | setStepSize (double size) |
Set the size of each time step, in picoseconds. | |
double | getConstraintTolerance () const |
Get the distance tolerance within which constraints are maintained, as a fraction of the constrained distance. | |
void | setConstraintTolerance (double tol) |
Set the distance tolerance within which constraints are maintained, as a fraction of the constrained distance. | |
virtual void | step (int steps)=0 |
Advance a simulation through time by taking a series of time steps. | |
Protected Member Functions | |
virtual void | initialize (ContextImpl &context)=0 |
This will be called by the Context when it is created. | |
virtual void | cleanup () |
This will be called by the Context when it is destroyed to let the Integrator do any necessary cleanup. | |
virtual std::vector< std::string > | getKernelNames ()=0 |
Get the names of all Kernels used by this Integrator. | |
virtual void | stateChanged (State::DataType changed) |
This will be called by the Context when the user modifies aspects of the context state, such as positions, velocities, or parameters. | |
virtual double | computeKineticEnergy ()=0 |
Compute the kinetic energy of the system at the current time. | |
Protected Attributes | |
ContextImpl * | context |
Context * | owner |
Friends | |
class | Context |
class | ContextImpl |
An Integrator defines a method for simulating a System by integrating the equations of motion.
This is an abstract class. Subclasses define particular integration methods.
Each Integrator object is bound to a particular Context which it integrates. This connection is specified by passing the Integrator as an argument to the constructor of the Context.
Integrator | ( | ) |
|
virtual |
|
inlineprotectedvirtual |
This will be called by the Context when it is destroyed to let the Integrator do any necessary cleanup.
It will also get called again if the application calls reinitialize() on the Context.
Reimplemented in CustomIntegrator, VariableLangevinIntegrator, BrownianIntegrator, LangevinIntegrator, VariableVerletIntegrator, and VerletIntegrator.
|
protectedpure virtual |
Compute the kinetic energy of the system at the current time.
This may be different from simply mv2/2. For example, a leapfrog integrator will store velocities offset by half a step, but the kinetic energy should be computed at the current time, not delayed by half a step.
Implemented in CustomIntegrator, VariableLangevinIntegrator, BrownianIntegrator, LangevinIntegrator, VariableVerletIntegrator, and VerletIntegrator.
|
inline |
Get the distance tolerance within which constraints are maintained, as a fraction of the constrained distance.
|
protectedpure virtual |
Get the names of all Kernels used by this Integrator.
Implemented in CustomIntegrator, VariableLangevinIntegrator, BrownianIntegrator, LangevinIntegrator, VariableVerletIntegrator, and VerletIntegrator.
|
inline |
Get the size of each time step, in picoseconds.
If this integrator uses variable time steps, the size of the most recent step is returned.
|
protectedpure virtual |
This will be called by the Context when it is created.
It informs the Integrator of what context it will be integrating, and gives it a chance to do any necessary initialization. It will also get called again if the application calls reinitialize() on the Context.
Implemented in CustomIntegrator, VariableLangevinIntegrator, BrownianIntegrator, LangevinIntegrator, VariableVerletIntegrator, and VerletIntegrator.
|
inline |
Set the distance tolerance within which constraints are maintained, as a fraction of the constrained distance.
|
inline |
Set the size of each time step, in picoseconds.
If this integrator uses variable time steps, the effect of calling this method is undefined, and it may simply be ignored.
size | the step size, measured in ps |
|
inlineprotectedvirtual |
This will be called by the Context when the user modifies aspects of the context state, such as positions, velocities, or parameters.
This gives the Integrator a chance to discard cached information. This is only called when the user modifies information using methods of the Context object. It is not called when a ForceImpl object modifies state information in its updateContextState() method (unless the ForceImpl calls a Context method to perform the modification).
changed | this specifies what aspect of the Context was changed |
Reimplemented in CustomIntegrator.
|
pure virtual |
Advance a simulation through time by taking a series of time steps.
steps | the number of time steps to take |
Implemented in CustomIntegrator, VariableLangevinIntegrator, BrownianIntegrator, LangevinIntegrator, VariableVerletIntegrator, and VerletIntegrator.
|
friend |
|
friend |
|
protected |
|
protected |