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;
255 static void tagParticlesInMolecule(
int particle,
int molecule, std::vector<int>& particleMolecule, std::vector<std::vector<int> >& particleBonds);
259 std::vector<ForceImpl*> forceImpls;
260 std::map<std::string, double> parameters;
261 mutable std::vector<std::vector<int> > molecules;
262 bool hasInitializedForces, hasSetPositions, integratorIsDeleted;
265 Kernel initializeForcesKernel, updateStateDataKernel, applyConstraintsKernel, virtualSitesKernel;