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

Renamed OpenMMContext to Context

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