Commit a4020466 authored by Peter Eastman's avatar Peter Eastman
Browse files

Renamed OpenMMContext to Context

parent 95b8dbd6
......@@ -49,7 +49,7 @@ void simulateArgon()
OpenMM::VerletIntegrator integrator(0.004); // step size in ps
// Let OpenMM Context choose best platform.
OpenMM::OpenMMContext context(system, integrator);
OpenMM::Context context(system, integrator);
printf( "REMARK Using OpenMM platform %s\n",
context.getPlatform().getName().c_str() );
......
......@@ -225,7 +225,7 @@ struct MyOpenMMData {
~MyOpenMMData() {delete context; delete integrator; delete system;}
OpenMM::System* system;
OpenMM::Integrator* integrator;
OpenMM::OpenMMContext* context;
OpenMM::Context* context;
};
......@@ -345,7 +345,7 @@ myInitializeOpenMM( const MyAtomInfo atoms[],
// best available Platform. Initialize the configuration from the default
// positions we collected above. Initial velocities will be zero.
omm->integrator = new OpenMM::VerletIntegrator(StepSizeInFs * OpenMM::PsPerFs);
omm->context = new OpenMM::OpenMMContext(*omm->system, *omm->integrator);
omm->context = new OpenMM::Context(*omm->system, *omm->integrator);
omm->context->setPositions(initialPosInNm);
platformName = omm->context->getPlatform().getName();
......
......@@ -178,7 +178,7 @@ struct MyOpenMMData {
MyOpenMMData() : system(0), context(0), integrator(0) {}
~MyOpenMMData() {delete system; delete context; delete integrator;}
OpenMM::System* system;
OpenMM::OpenMMContext* context;
OpenMM::Context* context;
OpenMM::Integrator* integrator;
};
......@@ -262,7 +262,7 @@ myInitializeOpenMM( const MyAtomInfo atoms[],
// have been set here.
omm->integrator = new OpenMM::LangevinIntegrator(temperature, frictionInPs,
stepSizeInFs * OpenMM::PsPerFs);
omm->context = new OpenMM::OpenMMContext(*omm->system, *omm->integrator);
omm->context = new OpenMM::Context(*omm->system, *omm->integrator);
omm->context->setPositions(initialPosInNm);
platformName = omm->context->getPlatform().getName();
......
......@@ -193,7 +193,7 @@ struct MyOpenMMData {
~MyOpenMMData() {delete context; delete integrator; delete system;}
OpenMM::System* system;
OpenMM::Integrator* integrator;
OpenMM::OpenMMContext* context;
OpenMM::Context* context;
};
......@@ -348,7 +348,7 @@ myInitializeOpenMM( int numWatersAlongEdge,
// best available Platform. Initialize the configuration from the default
// positions we collected above. Initial velocities will be zero.
omm->integrator = new OpenMM::VerletIntegrator(StepSizeInFs * OpenMM::PsPerFs);
omm->context = new OpenMM::OpenMMContext(*omm->system, *omm->integrator);
omm->context = new OpenMM::Context(*omm->system, *omm->integrator);
omm->context->setPositions(initialPosInNm);
platformName = omm->context->getPlatform().getName();
......
......@@ -1012,7 +1012,7 @@ void OPENMM_LANGEVININTEGRATOR_STEP(OpenMM_LangevinIntegrator* const& langevin,
// create
OpenMM_Context* OpenMM_Context_create(OpenMM_System* sys, OpenMM_Integrator* integ)
{ return (OpenMM_Context*)new OpenMM::OpenMMContext(*(System*)sys, *(Integrator*)integ); }
{ return (OpenMM_Context*)new OpenMM::Context(*(System*)sys, *(Integrator*)integ); }
void openmm_context_create_(OpenMM_Context*& context, OpenMM_System*& sys, OpenMM_Integrator*& integ)
{ context = OpenMM_Context_create(sys, integ); }
void OPENMM_CONTEXT_CREATE(OpenMM_Context*& context, OpenMM_System*& sys, OpenMM_Integrator*& integ)
......@@ -1020,7 +1020,7 @@ void OPENMM_CONTEXT_CREATE(OpenMM_Context*& context, OpenMM_System*& sys, OpenMM
// destroy
void OpenMM_Context_destroy(OpenMM_Context* doomed)
{ delete (OpenMMContext*)doomed; }
{ delete (Context*)doomed; }
void openmm_context_destroy_(OpenMM_Context*& doomed)
{ OpenMM_Context_destroy(doomed); }
void OPENMM_CONTEXT_DESTROY(OpenMM_Context*& doomed)
......@@ -1028,7 +1028,7 @@ void OPENMM_CONTEXT_DESTROY(OpenMM_Context*& doomed)
// setPositions
void OpenMM_Context_setPositions(OpenMM_Context* context, const OpenMM_Vec3Array* positions)
{ ((OpenMMContext*)context)->setPositions(*(const std::vector<Vec3>*)positions); }
{ ((Context*)context)->setPositions(*(const std::vector<Vec3>*)positions); }
void openmm_context_setpositions_(OpenMM_Context* const& context, const OpenMM_Vec3Array* const& positions)
{ OpenMM_Context_setPositions(context, positions); }
void OPENMM_CONTEXT_SETPOSITIONS(OpenMM_Context* const& context, const OpenMM_Vec3Array* const& positions)
......@@ -1036,7 +1036,7 @@ void OPENMM_CONTEXT_SETPOSITIONS(OpenMM_Context* const& context, const OpenMM_Ve
// setVelocities
void OpenMM_Context_setVelocities(OpenMM_Context* context, const OpenMM_Vec3Array* velocities)
{ ((OpenMMContext*)context)->setVelocities(*(const std::vector<Vec3>*)velocities); }
{ ((Context*)context)->setVelocities(*(const std::vector<Vec3>*)velocities); }
void openmm_context_setvelocities_(OpenMM_Context* const& context, const OpenMM_Vec3Array* const& velocities)
{ OpenMM_Context_setVelocities(context, velocities); }
void OPENMM_CONTEXT_SETVELOCITIES(OpenMM_Context* const& context, const OpenMM_Vec3Array* const& velocities)
......@@ -1046,7 +1046,7 @@ void OPENMM_CONTEXT_SETVELOCITIES(OpenMM_Context* const& context, const OpenMM_V
// Note that a Context creates the OpenMM::State object, but you have to destroy
// it using OpenMM_State_destroy.
OpenMM_State* OpenMM_Context_createState(const OpenMM_Context* context, int types)
{ return (OpenMM_State*)new State(((OpenMMContext*)context)->getState(types)); }
{ return (OpenMM_State*)new State(((Context*)context)->getState(types)); }
void openmm_context_createstate_(const OpenMM_Context* const& context, const int& types, OpenMM_State*& state)
{ state=OpenMM_Context_createState(context, types); }
void OPENMM_CONTEXT_CREATESTATE(const OpenMM_Context* const& context, const int& types, OpenMM_State*& state)
......@@ -1056,13 +1056,13 @@ void OPENMM_CONTEXT_CREATESTATE(const OpenMM_Context* const& context, const int&
// Platform name.
const char* OpenMM_Context_getPlatformName(const OpenMM_Context* context) {
static std::string platform;
platform = ((const OpenMMContext*)context)->getPlatform().getName();
platform = ((const Context*)context)->getPlatform().getName();
return platform.c_str();
}
// getPlatformName Fortran: Return a blank-padded Fortran string containing the Platform name. There
// is no terminating null.
void openmm_context_getplatformname_(const OpenMM_Context* const& context, char* buf, int len) {
const std::string name = ((const OpenMMContext*)context)->getPlatform().getName();
const std::string name = ((const Context*)context)->getPlatform().getName();
const int minLen = std::min((int)name.size(), len);
for (int i=0; i<minLen; ++i) buf[i] = name[i];
for (int i=minLen; i<len; ++i) buf[i] = ' ';
......
......@@ -50,7 +50,7 @@ public:
* @param name the name of the kernel to create
* @param context the context the kernel will belong to
*/
virtual KernelImpl* createKernelImpl(std::string name, const Platform& platform, OpenMMContextImpl& context) const = 0;
virtual KernelImpl* createKernelImpl(std::string name, const Platform& platform, ContextImpl& context) const = 0;
virtual ~KernelFactory() {
}
};
......
......@@ -41,7 +41,7 @@ namespace OpenMM {
class Kernel;
class KernelFactory;
class OpenMMContextImpl;
class ContextImpl;
class StreamFactory;
/**
......@@ -86,15 +86,15 @@ public:
*/
virtual const StreamFactory& getDefaultStreamFactory() const = 0;
/**
* This is called whenever a new OpenMMContext is created. It gives the Platform a chance to initialize
* This is called whenever a new Context is created. It gives the Platform a chance to initialize
* the context and store platform-specific data in it.
*/
virtual void contextCreated(OpenMMContextImpl& context) const;
virtual void contextCreated(ContextImpl& context) const;
/**
* This is called whenever an OpenMMContext is deleted. It gives the Platform a chance to clean up
* This is called whenever a Context is deleted. It gives the Platform a chance to clean up
* any platform-specific data that was stored in it.
*/
virtual void contextDestroyed(OpenMMContextImpl& context) const;
virtual void contextDestroyed(ContextImpl& context) const;
/**
* Register a KernelFactory which should be used to create Kernels with a particular name.
* The Platform takes over ownership of the factory, and will delete it when the Platform itself
......@@ -133,7 +133,7 @@ public:
* @param context the context for which to create a Kernel
* @return a newly created Kernel object
*/
Kernel createKernel(const std::string& name, OpenMMContextImpl& context) const;
Kernel createKernel(const std::string& name, ContextImpl& context) const;
/**
* Create a Stream object. If you call this method multiple times for different contexts with the same name,
* the returned Streams are independent and do not interact with each other. This means
......@@ -147,7 +147,7 @@ public:
* @param context the context for which to create a Stream
* @return a newly created Stream object
*/
Stream createStream(const std::string& name, int size, Stream::DataType type, OpenMMContextImpl& context) const;
Stream createStream(const std::string& name, int size, Stream::DataType type, ContextImpl& context) const;
/**
* Register a new Platform.
*/
......
......@@ -53,7 +53,7 @@ public:
* @param type the data type of each element in the stream
* @param context the context the kernel will belong to
*/
virtual StreamImpl* createStreamImpl(std::string name, int size, Stream::DataType type, const Platform& platform, OpenMMContextImpl& context) const = 0;
virtual StreamImpl* createStreamImpl(std::string name, int size, Stream::DataType type, const Platform& platform, ContextImpl& context) const = 0;
virtual ~StreamFactory() {
}
};
......
......@@ -76,7 +76,7 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual void execute(OpenMMContextImpl& context) = 0;
virtual void execute(ContextImpl& context) = 0;
};
/**
......@@ -100,14 +100,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual double getTime(const OpenMMContextImpl& context) const = 0;
virtual double getTime(const ContextImpl& context) const = 0;
/**
* Set the current time (in picoseconds).
*
* @param context the context in which to execute this kernel
* @param time the time
*/
virtual void setTime(OpenMMContextImpl& context, double time) = 0;
virtual void setTime(ContextImpl& context, double time) = 0;
};
/**
......@@ -132,14 +132,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual void executeForces(OpenMMContextImpl& context) = 0;
virtual void executeForces(ContextImpl& context) = 0;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the HarmonicBondForce
*/
virtual double executeEnergy(OpenMMContextImpl& context) = 0;
virtual double executeEnergy(ContextImpl& context) = 0;
};
/**
......@@ -164,14 +164,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual void executeForces(OpenMMContextImpl& context) = 0;
virtual void executeForces(ContextImpl& context) = 0;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the HarmonicAngleForce
*/
virtual double executeEnergy(OpenMMContextImpl& context) = 0;
virtual double executeEnergy(ContextImpl& context) = 0;
};
/**
......@@ -196,14 +196,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual void executeForces(OpenMMContextImpl& context) = 0;
virtual void executeForces(ContextImpl& context) = 0;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the PeriodicTorsionForce
*/
virtual double executeEnergy(OpenMMContextImpl& context) = 0;
virtual double executeEnergy(ContextImpl& context) = 0;
};
/**
......@@ -228,14 +228,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual void executeForces(OpenMMContextImpl& context) = 0;
virtual void executeForces(ContextImpl& context) = 0;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the RBTorsionForce
*/
virtual double executeEnergy(OpenMMContextImpl& context) = 0;
virtual double executeEnergy(ContextImpl& context) = 0;
};
/**
......@@ -267,14 +267,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual void executeForces(OpenMMContextImpl& context) = 0;
virtual void executeForces(ContextImpl& context) = 0;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the NonbondedForce
*/
virtual double executeEnergy(OpenMMContextImpl& context) = 0;
virtual double executeEnergy(ContextImpl& context) = 0;
};
/**
......@@ -299,14 +299,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual void executeForces(OpenMMContextImpl& context) = 0;
virtual void executeForces(ContextImpl& context) = 0;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the GBSAOBCForce
*/
virtual double executeEnergy(OpenMMContextImpl& context) = 0;
virtual double executeEnergy(ContextImpl& context) = 0;
};
/**
......@@ -332,14 +332,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual void executeForces(OpenMMContextImpl& context) = 0;
virtual void executeForces(ContextImpl& context) = 0;
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the GBVIForce
*/
virtual double executeEnergy(OpenMMContextImpl& context) = 0;
virtual double executeEnergy(ContextImpl& context) = 0;
};
/**
......@@ -365,7 +365,7 @@ public:
* @param context the context in which to execute this kernel
* @param integrator the VerletIntegrator this kernel is being used for
*/
virtual void execute(OpenMMContextImpl& context, const VerletIntegrator& integrator) = 0;
virtual void execute(ContextImpl& context, const VerletIntegrator& integrator) = 0;
};
/**
......@@ -391,7 +391,7 @@ public:
* @param context the context in which to execute this kernel
* @param integrator the LangevinIntegrator this kernel is being used for
*/
virtual void execute(OpenMMContextImpl& context, const LangevinIntegrator& integrator) = 0;
virtual void execute(ContextImpl& context, const LangevinIntegrator& integrator) = 0;
};
/**
......@@ -417,7 +417,7 @@ public:
* @param context the context in which to execute this kernel
* @param integrator the BrownianIntegrator this kernel is being used for
*/
virtual void execute(OpenMMContextImpl& context, const BrownianIntegrator& integrator) = 0;
virtual void execute(ContextImpl& context, const BrownianIntegrator& integrator) = 0;
};
/**
......@@ -444,7 +444,7 @@ public:
* @param integrator the LangevinIntegrator this kernel is being used for
* @param maxTime the maximum time beyond which the simulation should not be advanced
*/
virtual void execute(OpenMMContextImpl& context, const VariableLangevinIntegrator& integrator, double maxTime) = 0;
virtual void execute(ContextImpl& context, const VariableLangevinIntegrator& integrator, double maxTime) = 0;
};
/**
......@@ -471,7 +471,7 @@ public:
* @param integrator the VerletIntegrator this kernel is being used for
* @param maxTime the maximum time beyond which the simulation should not be advanced
*/
virtual void execute(OpenMMContextImpl& context, const VariableVerletIntegrator& integrator, double maxTime) = 0;
virtual void execute(ContextImpl& context, const VariableVerletIntegrator& integrator, double maxTime) = 0;
};
/**
......@@ -496,7 +496,7 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual void execute(OpenMMContextImpl& context) = 0;
virtual void execute(ContextImpl& context) = 0;
};
/**
......@@ -520,7 +520,7 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual double execute(OpenMMContextImpl& context) = 0;
virtual double execute(ContextImpl& context) = 0;
};
/**
......@@ -545,7 +545,7 @@ public:
*
* @param context the context in which to execute this kernel
*/
virtual void execute(OpenMMContextImpl& context) = 0;
virtual void execute(ContextImpl& context) = 0;
};
} // namespace OpenMM
......
......@@ -74,10 +74,10 @@ Platform::~Platform() {
delete *iter;
}
void Platform::contextCreated(OpenMMContextImpl& context) const {
void Platform::contextCreated(ContextImpl& context) const {
}
void Platform::contextDestroyed(OpenMMContextImpl& context) const {
void Platform::contextDestroyed(ContextImpl& context) const {
}
void Platform::registerKernelFactory(const string& name, KernelFactory* factory) {
......@@ -95,13 +95,13 @@ bool Platform::supportsKernels(const vector<string>& kernelNames) const {
return true;
}
Kernel Platform::createKernel(const string& name, OpenMMContextImpl& context) const {
Kernel Platform::createKernel(const string& name, ContextImpl& context) const {
if (kernelFactories.find(name) == kernelFactories.end())
throw OpenMMException("Called createKernel() on a Platform which does not support the requested kernel");
return Kernel(kernelFactories.find(name)->second->createKernelImpl(name, *this, context));
}
Stream Platform::createStream(const string& name, int size, Stream::DataType type, OpenMMContextImpl& context) const {
Stream Platform::createStream(const string& name, int size, Stream::DataType type, ContextImpl& context) const {
if (streamFactories.find(name) == streamFactories.end())
return Stream(getDefaultStreamFactory().createStreamImpl(name, size, type, *this, context));
return Stream(streamFactories.find(name)->second->createStreamImpl(name, size, type, *this, context));
......
......@@ -43,7 +43,7 @@
#include "openmm/Integrator.h"
#include "openmm/LangevinIntegrator.h"
#include "openmm/NonbondedForce.h"
#include "openmm/OpenMMContext.h"
#include "openmm/Context.h"
#include "openmm/OpenMMException.h"
#include "openmm/PeriodicTorsionForce.h"
#include "openmm/RBTorsionForce.h"
......
......@@ -103,11 +103,11 @@ public:
void step(int steps);
protected:
/**
* This will be called by the OpenMMContext when it is created. It informs the Integrator
* 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 OpenMMContext.
* It will also get called again if the application calls reinitialize() on the Context.
*/
void initialize(OpenMMContextImpl& context);
void initialize(ContextImpl& context);
/**
* Get the names of all Kernels used by this Integrator.
*/
......@@ -115,7 +115,7 @@ protected:
private:
double temperature, friction;
int randomNumberSeed;
OpenMMContextImpl* context;
ContextImpl* context;
Kernel kernel;
};
......
#ifndef OPENMM_OPENMMCONTEXT_H_
#define OPENMM_OPENMMCONTEXT_H_
#ifndef OPENMM_CONTEXT_H_
#define OPENMM_CONTEXT_H_
/* -------------------------------------------------------------------------- *
* OpenMM *
......@@ -41,12 +41,12 @@
namespace OpenMM {
class OpenMMContextImpl;
class ContextImpl;
class Vec3;
class Platform;
/**
* An OpenMMContext stores the complete state of a simulation. More specifically, it includes:
* A Context stores the complete state of a simulation. More specifically, it includes:
*
* <ul>
* <li>The current time</li>
......@@ -61,25 +61,25 @@ class Platform;
* particle and the current energy of the System.
*/
class OPENMM_EXPORT OpenMMContext {
class OPENMM_EXPORT Context {
public:
/**
* Construct a new OpenMMContext in which to run a simulation.
* Construct a new Context in which to run a simulation.
*
* @param system the System which will be simulated
* @param integrator the Integrator which will be used to simulate the System
*/
OpenMMContext(System& system, Integrator& integrator);
Context(System& system, Integrator& integrator);
/**
* Construct a new OpenMMContext in which to run a simulation, explicitly specifying what Platform should be used
* Construct a new Context in which to run a simulation, explicitly specifying what Platform should be used
* to perform calculations.
*
* @param system the System which will be simulated
* @param integrator the Integrator which will be used to simulate the System
* @param platform the Platform to use for calculations
*/
OpenMMContext(System& system, Integrator& integrator, Platform& platform);
~OpenMMContext();
Context(System& system, Integrator& integrator, Platform& platform);
~Context();
/**
* Get System being simulated in this context.
*/
......@@ -143,19 +143,19 @@ public:
*/
void setParameter(const std::string& name, double value);
/**
* When an OpenMMContext is created, it may cache information about the System being simulated
* When a Context is created, it may cache information about the System being simulated
* and the Force objects contained in it. This means that, if the System or Forces are then
* modified, the OpenMMContext might not see all of the changes. Call reinitialize() to force
* the OpenMMContext to rebuild its internal representation of the System and pick up any changes
* modified, the Context might not see all of the changes. Call reinitialize() to force
* the Context to rebuild its internal representation of the System and pick up any changes
* that have been made.
*
* This is an expensive operation, so you should try to avoid calling it too frequently.
*/
void reinitialize();
private:
OpenMMContextImpl* impl;
ContextImpl* impl;
};
} // namespace OpenMM
#endif /*OPENMM_OPENMMCONTEXT_H_*/
#endif /*OPENMM_CONTEXT_H_*/
......@@ -48,7 +48,7 @@ class ForceImpl;
* <li>Add a contribution to the force on each particle</li>
* <li>Add a contribution to the potential energy of the System</li>
* <li>Modify the positions and velocities of particles at the start of each time step</li>
* <li>Define parameters which are stored in the OpenMMContext and can be modified by the user</li>
* <li>Define parameters which are stored in the Context and can be modified by the user</li>
* <li>Change the values of parameters defined by other Force objects at the start of each time step</li>
* </ul>
*/
......@@ -59,11 +59,11 @@ public:
virtual ~Force() {
}
protected:
friend class OpenMMContextImpl;
friend class ContextImpl;
/**
* When an OpenMMContext is created, it invokes this method on each Force in the System.
* When a Context is created, it invokes this method on each Force in the System.
* It should create a new ForceImpl object which can be used by the context for calculating forces.
* The ForceImpl will be deleted automatically when the OpenMMContext is deleted.
* The ForceImpl will be deleted automatically when the Context is deleted.
*/
virtual ForceImpl* createImpl() = 0;
......
......@@ -44,7 +44,7 @@ namespace OpenMM {
* To use this class, create a GBSAOBCForce object, then call addParticle() once for each particle in the
* System to define its parameters. The number of particles for which you define GBSA parameters must
* be exactly equal to the number of particles in the System, or else an exception will be thrown when you
* try to create an OpenMMContext. After a particle has been added, you can modify its force field parameters
* try to create a Context. After a particle has been added, you can modify its force field parameters
* by calling setParticleParameters().
* <p>
* If the System also contains a NonbondedForce, this force will use the cutoffs
......
......@@ -44,7 +44,7 @@ namespace OpenMM {
* To use this class, create a GBVIForce object, then call addParticle() once for each particle in the
* System to define its parameters. The number of particles for which you define GB/VI parameters must
* be exactly equal to the number of particles in the System, or else an exception will be thrown when you
* try to create an OpenMMContext. After a particle has been added, you can modify its force field parameters
* try to create a Context. After a particle has been added, you can modify its force field parameters
* by calling setParticleParameters().
* <p>
* If the System also contains a NonbondedForce, this force will use the cutoffs
......
......@@ -39,15 +39,15 @@
namespace OpenMM {
class OpenMMContext;
class OpenMMContextImpl;
class Context;
class ContextImpl;
/**
* 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 OpenMMContext which it integrates. This connection
* is specified by passing the Integrator as an argument to the constructor of the OpenMMContext.
* 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.
*/
class OPENMM_EXPORT Integrator {
......@@ -87,13 +87,13 @@ public:
*/
virtual void step(int steps) = 0;
protected:
friend class OpenMMContextImpl;
friend class ContextImpl;
/**
* This will be called by the OpenMMContext when it is created. It informs the Integrator
* 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 OpenMMContext.
* It will also get called again if the application calls reinitialize() on the Context.
*/
virtual void initialize(OpenMMContextImpl& context) = 0;
virtual void initialize(ContextImpl& context) = 0;
/**
* Get the names of all Kernels used by this Integrator.
*/
......
......@@ -103,11 +103,11 @@ public:
void step(int steps);
protected:
/**
* This will be called by the OpenMMContext when it is created. It informs the Integrator
* 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 OpenMMContext.
* It will also get called again if the application calls reinitialize() on the Context.
*/
void initialize(OpenMMContextImpl& context);
void initialize(ContextImpl& context);
/**
* Get the names of all Kernels used by this Integrator.
*/
......@@ -115,7 +115,7 @@ protected:
private:
double temperature, friction;
int randomNumberSeed;
OpenMMContextImpl* context;
ContextImpl* context;
Kernel kernel;
};
......
......@@ -52,7 +52,7 @@ namespace OpenMM {
* To use this class, create a NonbondedForce object, then call addParticle() once for each particle in the
* System to define its parameters. The number of particles for which you define nonbonded parameters must
* be exactly equal to the number of particles in the System, or else an exception will be thrown when you
* try to create an OpenMMContext. After a particle has been added, you can modify its force field parameters
* try to create a Context. After a particle has been added, you can modify its force field parameters
* by calling setParticleParameters().
*
* NonbondedForce also lets you specify "exceptions", particular pairs of particles whose interactions should be
......
......@@ -41,7 +41,7 @@ namespace OpenMM {
/**
* A State object records a snapshot of the current state of a simulation at a point in time.
* You create it by calling getState() on an OpenMMContext.
* You create it by calling getState() on a Context.
*
* When a State is created, you specify what information should be stored in it. This saves
* time and memory by only copying in the information that you actually want. This is especially
......@@ -86,7 +86,7 @@ public:
*/
const std::map<std::string, double>& getParameters() const;
private:
friend class OpenMMContext;
friend class Context;
State(double time, int numParticles, DataType types);
// Retarded visual studio compiler complains about being unable to
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment