# Integrator Class Reference

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

`#include <Integrator.h>`

Inheritance diagram for Integrator:

List of all members.

## 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

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

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

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

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

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, DrudeLangevinIntegrator, DrudeSCFIntegrator, and RPMDIntegrator.

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

## 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