All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Integrator.h
#ifndef OPENMM_INTEGRATOR_H_
#define OPENMM_INTEGRATOR_H_
/* -------------------------------------------------------------------------- *
* OpenMM *
* -------------------------------------------------------------------------- *
* This is part of the OpenMM molecular simulation toolkit originating from *
* Simbios, the NIH National Center for Physics-Based Simulation of *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2008-2012 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the "Software"), *
* to deal in the Software without restriction, including without limitation *
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
* and/or sell copies of the Software, and to permit persons to whom the *
* Software is furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included in *
* all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
* THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "State.h"
#include "Vec3.h"
#include <map>
#include <vector>
#include "internal/windowsExport.h"
namespace OpenMM {
class Context;
class ContextImpl;
class OPENMM_EXPORT Integrator {
public:
Integrator();
virtual ~Integrator();
double getStepSize() const {
return stepSize;
}
void setStepSize(double size) {
stepSize = size;
}
double getConstraintTolerance() const {
return constraintTol;
}
void setConstraintTolerance(double tol) {
constraintTol = tol;
}
virtual void step(int steps) = 0;
protected:
friend class Context;
friend class ContextImpl;
ContextImpl* context;
Context* owner;
virtual void initialize(ContextImpl& context) = 0;
virtual void cleanup() {
};
virtual std::vector<std::string> getKernelNames() = 0;
virtual void stateChanged(State::DataType changed) {
}
virtual double computeKineticEnergy() = 0;
private:
double stepSize, constraintTol;
};
} // namespace OpenMM
#endif /*OPENMM_INTEGRATOR_H_*/
OpenMM::Integrator::setStepSize
void setStepSize(double size)
Set the size of each time step, in picoseconds.
Definition: Integrator.h:73
OpenMM::Context
A Context stores the complete state of a simulation.
Definition: Context.h:67
OpenMM::Integrator::owner
Context * owner
Definition: Integrator.h:98
OpenMM::Integrator
An Integrator defines a method for simulating a System by integrating the equations of motion...
Definition: Integrator.h:54
OpenMM::State::DataType
DataType
This is an enumeration of the types of data which may be stored in a State.
Definition: State.h:61
OpenMM::Integrator::cleanup
virtual void cleanup()
This will be called by the Context when it is destroyed to let the Integrator do any necessary cleanu...
Definition: Integrator.h:109
OpenMM::Integrator::context
ContextImpl * context
Definition: Integrator.h:97
OpenMM
Definition: AndersenThermostat.h:40
OpenMM::Integrator::setConstraintTolerance
void setConstraintTolerance(double tol)
Set the distance tolerance within which constraints are maintained, as a fraction of the constrained ...
Definition: Integrator.h:85
OpenMM::Integrator::stateChanged
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.
Definition: Integrator.h:124
OpenMM::Integrator::getConstraintTolerance
double getConstraintTolerance() const
Get the distance tolerance within which constraints are maintained, as a fraction of the constrained ...
Definition: Integrator.h:79
OpenMM::Integrator::getStepSize
double getStepSize() const
Get the size of each time step, in picoseconds.
Definition: Integrator.h:64