1 #ifndef OPENMM_CONTEXTIMPL_H_
2 #define OPENMM_CONTEXTIMPL_H_
35 #include "openmm/Kernel.h"
36 #include "openmm/Platform.h"
37 #include "openmm/Vec3.h"
87 double getTime()
const;
91 void setTime(
double t);
97 void getPositions(std::vector<Vec3>& positions);
103 void setPositions(
const std::vector<Vec3>& positions);
109 void getVelocities(std::vector<Vec3>& velocities);
115 void setVelocities(
const std::vector<Vec3>& velocities);
121 void getForces(std::vector<Vec3>& forces);
125 const std::map<std::string, double>& getParameters()
const;
132 double getParameter(std::string name);
140 void setParameter(std::string name,
double value);
164 void setPeriodicBoxVectors(
const Vec3& a,
const Vec3& b,
const Vec3& c);
171 void applyConstraints(
double tol);
177 void applyVelocityConstraints(
double tol);
184 void computeVirtualSites();
195 double calcForcesAndEnergy(
bool includeForces,
bool includeEnergy,
int groups=0xFFFFFFFF);
199 int getLastForceGroups()
const;
203 double calcKineticEnergy();
208 void updateContextState();
212 const std::vector<ForceImpl*>& getForceImpls()
const;
216 std::vector<ForceImpl*>& getForceImpls();
220 void* getPlatformData();
224 const void* getPlatformData()
const;
228 void setPlatformData(
void* data);
233 const std::vector<std::vector<int> >& getMolecules()
const;
239 void createCheckpoint(std::ostream& stream);
245 void loadCheckpoint(std::istream& stream);
251 integratorIsDeleted =
true;
257 static std::vector<std::vector<int> > findMolecules(
int numParticles, std::vector<std::vector<int> >& particleBonds);
263 std::vector<ForceImpl*> forceImpls;
264 std::map<std::string, double> parameters;
265 mutable std::vector<std::vector<int> > molecules;
266 bool hasInitializedForces, hasSetPositions, integratorIsDeleted;
269 Kernel initializeForcesKernel, updateStateDataKernel, applyConstraintsKernel, virtualSitesKernel;
This is the internal implementation of a Context.
Definition: ContextImpl.h:53
Context & getOwner()
Get the Context for which this is the implementation.
Definition: ContextImpl.h:63
A Context stores the complete state of a simulation.
Definition: Context.h:67
Platform & getPlatform()
Get the Platform implementation being used for computations.
Definition: ContextImpl.h:81
An Integrator defines a method for simulating a System by integrating the equations of motion...
Definition: Integrator.h:54
This class represents a molecular system.
Definition: System.h:66
This class represents a three component vector.
Definition: Vec3.h:45
Integrator & getIntegrator()
Get Integrator being used to by this context.
Definition: ContextImpl.h:75
A Kernel encapsulates a particular implementation of a calculation that can be performed on the data ...
Definition: Kernel.h:58
void integratorDeleted()
This is invoked by the Integrator when it is deleted.
Definition: ContextImpl.h:250
const System & getSystem() const
Get System being simulated in this context.
Definition: ContextImpl.h:69