OpenMM

- Main Page
- Related Pages
- Classes

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Integrator Class Referenceabstract

An Integrator defines a method for simulating a System by integrating the equations of motion. More...

`#include <Integrator.h>`

Inheritance diagram for Integrator:

## Public Member Functions
| Integrator ()
virtual | ~Integrator ()
double | getStepSize () const
| Get the size of each time step, in picoseconds. More...
void | setStepSize (double size)
| Set the size of each time step, in picoseconds. More...
double | getConstraintTolerance () const
| Get the distance tolerance within which constraints are maintained, as a fraction of the constrained distance. More...
void | setConstraintTolerance (double tol)
| Set the distance tolerance within which constraints are maintained, as a fraction of the constrained distance. More...
virtual void | step (int steps)=0
| Advance a simulation through time by taking a series of time steps. More...

## Protected Member Functions
virtual void | initialize (ContextImpl &context)=0
| This will be called by the Context when it is created. More...
virtual void | cleanup ()
| This will be called by the Context when it is destroyed to let the Integrator do any necessary cleanup. More...
virtual std::vector< std::string > | getKernelNames ()=0
| Get the names of all Kernels used by this Integrator. More...
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. More...
virtual double | computeKineticEnergy ()=0
| Compute the kinetic energy of the system at the current time. More...

## Protected Attributes
ContextImpl * | context
Context * | owner

## Friends
class | Context
class | ContextImpl

## Detailed Description

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.

## Constructor & Destructor Documentation

Integrator | ( |  | ) |

virtual ~Integrator | ( |  | ) |
| virtual

## Member Function Documentation

virtual void cleanup | ( |  | ) |
| inline protected virtual

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, RPMDIntegrator, DrudeLangevinIntegrator, VariableLangevinIntegrator, BrownianIntegrator, LangevinIntegrator, VariableVerletIntegrator, DrudeSCFIntegrator, and VerletIntegrator.

virtual double computeKineticEnergy | ( |  | ) |
| protected pure 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, RPMDIntegrator, DrudeLangevinIntegrator, VariableLangevinIntegrator, BrownianIntegrator, LangevinIntegrator, VariableVerletIntegrator, DrudeSCFIntegrator, and VerletIntegrator.

double getConstraintTolerance | ( |  | ) | const
| inline

Get the distance tolerance within which constraints are maintained, as a fraction of the constrained distance.

virtual std::vector<std::string> getKernelNames | ( |  | ) |
| protected pure virtual

Get the names of all Kernels used by this Integrator.

Implemented in CustomIntegrator, RPMDIntegrator, DrudeLangevinIntegrator, VariableLangevinIntegrator, BrownianIntegrator, LangevinIntegrator, VariableVerletIntegrator, DrudeSCFIntegrator, and VerletIntegrator.

double getStepSize | ( |  | ) | const
| 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.

Returns
  the step size, measured in ps

virtual void initialize | ( | ContextImpl & | context | ) |
| protected pure 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, RPMDIntegrator, DrudeLangevinIntegrator, VariableLangevinIntegrator, BrownianIntegrator, LangevinIntegrator, VariableVerletIntegrator, DrudeSCFIntegrator, and VerletIntegrator.

void setConstraintTolerance | ( | double | tol | ) |
| inline

Set the distance tolerance within which constraints are maintained, as a fraction of the constrained distance.

void setStepSize | ( | double | size | ) |
| 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.

Parameters

  size | the step size, measured in ps

virtual void stateChanged | ( | State::DataType | changed | ) |
| inline protected virtual

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).

Parameters

  changed | this specifies what aspect of the Context was changed

Reimplemented in CustomIntegrator, RPMDIntegrator, DrudeLangevinIntegrator, and DrudeSCFIntegrator.

virtual void step | ( | int | steps | ) |
| pure virtual

Advance a simulation through time by taking a series of time steps.

Parameters

  steps | the number of time steps to take

Implemented in CustomIntegrator, RPMDIntegrator, DrudeLangevinIntegrator, VariableLangevinIntegrator, BrownianIntegrator, LangevinIntegrator, VariableVerletIntegrator, DrudeSCFIntegrator, and VerletIntegrator.

## Friends And Related Function Documentation

friend class Context
| friend

friend class ContextImpl
| friend

## Member Data Documentation

ContextImpl* context
| protected

Context* owner
| protected

The documentation for this class was generated from the following file:

- Integrator.h