"vscode:/vscode.git/clone" did not exist on "326b2385433c5a2cb2b9dc99a5e799fd8bb4d7af"
Commit a4020466 authored by Peter Eastman's avatar Peter Eastman
Browse files

Renamed OpenMMContext to Context

parent 95b8dbd6
...@@ -134,11 +134,11 @@ public: ...@@ -134,11 +134,11 @@ public:
void stepTo(double time); void stepTo(double time);
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.
*/ */
...@@ -146,7 +146,7 @@ protected: ...@@ -146,7 +146,7 @@ protected:
private: private:
double temperature, friction, errorTol; double temperature, friction, errorTol;
int randomNumberSeed; int randomNumberSeed;
OpenMMContextImpl* context; ContextImpl* context;
Kernel kernel; Kernel kernel;
}; };
......
...@@ -95,18 +95,18 @@ public: ...@@ -95,18 +95,18 @@ public:
void stepTo(double time); void stepTo(double time);
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.
*/ */
std::vector<std::string> getKernelNames(); std::vector<std::string> getKernelNames();
private: private:
double errorTol; double errorTol;
OpenMMContextImpl* context; ContextImpl* context;
Kernel kernel; Kernel kernel;
}; };
......
...@@ -58,17 +58,17 @@ public: ...@@ -58,17 +58,17 @@ 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.
*/ */
std::vector<std::string> getKernelNames(); std::vector<std::string> getKernelNames();
private: private:
OpenMMContextImpl* context; ContextImpl* context;
Kernel kernel; Kernel kernel;
}; };
......
...@@ -46,15 +46,15 @@ namespace OpenMM { ...@@ -46,15 +46,15 @@ namespace OpenMM {
class AndersenThermostatImpl : public ForceImpl { class AndersenThermostatImpl : public ForceImpl {
public: public:
AndersenThermostatImpl(AndersenThermostat& owner); AndersenThermostatImpl(AndersenThermostat& owner);
void initialize(OpenMMContextImpl& context); void initialize(ContextImpl& context);
AndersenThermostat& getOwner() { AndersenThermostat& getOwner() {
return owner; return owner;
} }
void updateContextState(OpenMMContextImpl& context); void updateContextState(ContextImpl& context);
void calcForces(OpenMMContextImpl& context, Stream& forces) { void calcForces(ContextImpl& context, Stream& forces) {
// This force doesn't apply forces to particles. // This force doesn't apply forces to particles.
} }
double calcEnergy(OpenMMContextImpl& context) { double calcEnergy(ContextImpl& context) {
return 0.0; // This force doesn't contribute to the potential energy. return 0.0; // This force doesn't contribute to the potential energy.
} }
std::map<std::string, double> getDefaultParameters(); std::map<std::string, double> getDefaultParameters();
......
...@@ -45,15 +45,15 @@ namespace OpenMM { ...@@ -45,15 +45,15 @@ namespace OpenMM {
class CMMotionRemoverImpl : public ForceImpl { class CMMotionRemoverImpl : public ForceImpl {
public: public:
CMMotionRemoverImpl(CMMotionRemover& owner); CMMotionRemoverImpl(CMMotionRemover& owner);
void initialize(OpenMMContextImpl& context); void initialize(ContextImpl& context);
CMMotionRemover& getOwner() { CMMotionRemover& getOwner() {
return owner; return owner;
} }
void updateContextState(OpenMMContextImpl& context); void updateContextState(ContextImpl& context);
void calcForces(OpenMMContextImpl& context, Stream& forces) { void calcForces(ContextImpl& context, Stream& forces) {
// This force doesn't apply forces to particles. // This force doesn't apply forces to particles.
} }
double calcEnergy(OpenMMContextImpl& context) { double calcEnergy(ContextImpl& context) {
return 0.0; // This force doesn't contribute to the potential energy. return 0.0; // This force doesn't contribute to the potential energy.
} }
std::map<std::string, double> getDefaultParameters() { std::map<std::string, double> getDefaultParameters() {
......
#ifndef OPENMM_OPENMMCONTEXTIMPL_H_ #ifndef OPENMM_CONTEXTIMPL_H_
#define OPENMM_OPENMMCONTEXTIMPL_H_ #define OPENMM_CONTEXTIMPL_H_
/* -------------------------------------------------------------------------- * /* -------------------------------------------------------------------------- *
* OpenMM * * OpenMM *
...@@ -42,24 +42,24 @@ namespace OpenMM { ...@@ -42,24 +42,24 @@ namespace OpenMM {
class ForceImpl; class ForceImpl;
class Integrator; class Integrator;
class OpenMMContext; class Context;
class System; class System;
/** /**
* This is the internal implementation of an OpenMMContext. * This is the internal implementation of a Context.
*/ */
class OPENMM_EXPORT OpenMMContextImpl { class OPENMM_EXPORT ContextImpl {
public: public:
/** /**
* Create an OpenMMContextImpl for an OpenMMContext; * Create an ContextImpl for a Context;
*/ */
OpenMMContextImpl(OpenMMContext& owner, System& system, Integrator& integrator, Platform* platform); ContextImpl(Context& owner, System& system, Integrator& integrator, Platform* platform);
~OpenMMContextImpl(); ~ContextImpl();
/** /**
* Get the OpenMMContext for which this is the implementation. * Get the Context for which this is the implementation.
*/ */
OpenMMContext& getOwner() { Context& getOwner() {
return owner; return owner;
} }
/** /**
...@@ -149,8 +149,8 @@ public: ...@@ -149,8 +149,8 @@ public:
*/ */
void setPlatformData(void* data); void setPlatformData(void* data);
private: private:
friend class OpenMMContext; friend class Context;
OpenMMContext& owner; Context& owner;
System& system; System& system;
Integrator& integrator; Integrator& integrator;
std::vector<ForceImpl*> forceImpls; std::vector<ForceImpl*> forceImpls;
...@@ -163,4 +163,4 @@ private: ...@@ -163,4 +163,4 @@ private:
} // namespace OpenMM } // namespace OpenMM
#endif /*OPENMM_OPENMMCONTEXTIMPL_H_*/ #endif /*OPENMM_CONTEXTIMPL_H_*/
...@@ -39,14 +39,14 @@ ...@@ -39,14 +39,14 @@
namespace OpenMM { namespace OpenMM {
class Force; class Force;
class OpenMMContextImpl; class ContextImpl;
class Stream; class Stream;
/** /**
* A ForceImpl provides the internal implementation of a Force. When an OpenMMContext is * A ForceImpl provides the internal implementation of a Force. When a Context is
* created for a System, it creates a ForceImpl for each Force in the System. The ForceImpl * created for a System, it creates a ForceImpl for each Force in the System. The ForceImpl
* is permitted to cache information from the Force or System which is needed to apply the * is permitted to cache information from the Force or System which is needed to apply the
* force efficiently. If the user calls reinitialize() on the OpenMMContext, all ForceImpl * force efficiently. If the user calls reinitialize() on the Context, all ForceImpl
* objects it had previously created are deleted and recreated from scratch. * objects it had previously created are deleted and recreated from scratch.
* *
* This is an abstract class. Each Force subclass is responsible for defining its own * This is an abstract class. Each Force subclass is responsible for defining its own
...@@ -61,7 +61,7 @@ public: ...@@ -61,7 +61,7 @@ public:
* This is called after the ForceImpl is created and before updateContextState(), calcForces(), * This is called after the ForceImpl is created and before updateContextState(), calcForces(),
* or calcEnergy() is called on it. This allows it to do any necessary initialization. * or calcEnergy() is called on it. This allows it to do any necessary initialization.
*/ */
virtual void initialize(OpenMMContextImpl& context) = 0; virtual void initialize(ContextImpl& context) = 0;
/** /**
* Get the Force object from which this ForceImpl was created. * Get the Force object from which this ForceImpl was created.
*/ */
...@@ -69,11 +69,11 @@ public: ...@@ -69,11 +69,11 @@ public:
/** /**
* This method is called at the beginning of each time step. It give the ForceImpl a chance * This method is called at the beginning of each time step. It give the ForceImpl a chance
* to modify the state variables (positions, velocities, and parameters) stored in the * to modify the state variables (positions, velocities, and parameters) stored in the
* OpenMMContext in arbitrary ways before integration is performed. * Context in arbitrary ways before integration is performed.
* *
* @param context the context in which the system is being simulated * @param context the context in which the system is being simulated
*/ */
virtual void updateContextState(OpenMMContextImpl& context) = 0; virtual void updateContextState(ContextImpl& context) = 0;
/** /**
* Calculate the force on each particle generated by this ForceImpl. The forces should be <i>added</i> * Calculate the force on each particle generated by this ForceImpl. The forces should be <i>added</i>
* to the values already present in the array that is passed in. If this ForceImpl does not generate * to the values already present in the array that is passed in. If this ForceImpl does not generate
...@@ -82,7 +82,7 @@ public: ...@@ -82,7 +82,7 @@ public:
* @param context the context in which the system is being simulated * @param context the context in which the system is being simulated
* @param forces new forces should be added to the value already stored in this * @param forces new forces should be added to the value already stored in this
*/ */
virtual void calcForces(OpenMMContextImpl& context, Stream& forces) = 0; virtual void calcForces(ContextImpl& context, Stream& forces) = 0;
/** /**
* Calculate this ForceImpl's contribution to the potential energy of the system. * Calculate this ForceImpl's contribution to the potential energy of the system.
* *
...@@ -90,10 +90,10 @@ public: ...@@ -90,10 +90,10 @@ public:
* @return this force's contribution to the potential energy of the system, or 0 if this * @return this force's contribution to the potential energy of the system, or 0 if this
* force does not contribute to potential energy * force does not contribute to potential energy
*/ */
virtual double calcEnergy(OpenMMContextImpl& context) = 0; virtual double calcEnergy(ContextImpl& context) = 0;
/** /**
* Get a map containing the default values for all adjustable parameters defined by this ForceImpl. These * Get a map containing the default values for all adjustable parameters defined by this ForceImpl. These
* parameters and their default values will automatically be added to the OpenMMContext. * parameters and their default values will automatically be added to the Context.
*/ */
virtual std::map<std::string, double> getDefaultParameters() = 0; virtual std::map<std::string, double> getDefaultParameters() = 0;
/** /**
......
...@@ -46,15 +46,15 @@ namespace OpenMM { ...@@ -46,15 +46,15 @@ namespace OpenMM {
class GBSAOBCForceImpl : public ForceImpl { class GBSAOBCForceImpl : public ForceImpl {
public: public:
GBSAOBCForceImpl(GBSAOBCForce& owner); GBSAOBCForceImpl(GBSAOBCForce& owner);
void initialize(OpenMMContextImpl& context); void initialize(ContextImpl& context);
GBSAOBCForce& getOwner() { GBSAOBCForce& getOwner() {
return owner; return owner;
} }
void updateContextState(OpenMMContextImpl& context) { void updateContextState(ContextImpl& context) {
// This force field doesn't update the state directly. // This force field doesn't update the state directly.
} }
void calcForces(OpenMMContextImpl& context, Stream& forces); void calcForces(ContextImpl& context, Stream& forces);
double calcEnergy(OpenMMContextImpl& context); double calcEnergy(ContextImpl& context);
std::map<std::string, double> getDefaultParameters() { std::map<std::string, double> getDefaultParameters() {
return std::map<std::string, double>(); // This force field doesn't define any parameters. return std::map<std::string, double>(); // This force field doesn't define any parameters.
} }
......
...@@ -46,7 +46,7 @@ namespace OpenMM { ...@@ -46,7 +46,7 @@ namespace OpenMM {
class GBVIForceImpl : public ForceImpl { class GBVIForceImpl : public ForceImpl {
public: public:
GBVIForceImpl(GBVIForce& owner); GBVIForceImpl(GBVIForce& owner);
void initialize(OpenMMContextImpl& context); void initialize(ContextImpl& context);
GBVIForce& getOwner() { GBVIForce& getOwner() {
return owner; return owner;
} }
...@@ -56,11 +56,11 @@ public: ...@@ -56,11 +56,11 @@ public:
void findScaledRadii( int numberOfParticles, const std::vector<std::vector<int> >& bondIndices, void findScaledRadii( int numberOfParticles, const std::vector<std::vector<int> >& bondIndices,
const std::vector<double> & bondLengths, std::vector<double> & scaledRadii) const; const std::vector<double> & bondLengths, std::vector<double> & scaledRadii) const;
void updateContextState(OpenMMContextImpl& context) { void updateContextState(ContextImpl& context) {
// This force field doesn't update the state directly. // This force field doesn't update the state directly.
} }
void calcForces(OpenMMContextImpl& context, Stream& forces); void calcForces(ContextImpl& context, Stream& forces);
double calcEnergy(OpenMMContextImpl& context); double calcEnergy(ContextImpl& context);
std::map<std::string, double> getDefaultParameters() { std::map<std::string, double> getDefaultParameters() {
return std::map<std::string, double>(); // This force field doesn't define any parameters. return std::map<std::string, double>(); // This force field doesn't define any parameters.
} }
......
...@@ -49,15 +49,15 @@ class HarmonicAngleForceImpl : public ForceImpl { ...@@ -49,15 +49,15 @@ class HarmonicAngleForceImpl : public ForceImpl {
public: public:
HarmonicAngleForceImpl(HarmonicAngleForce& owner); HarmonicAngleForceImpl(HarmonicAngleForce& owner);
~HarmonicAngleForceImpl(); ~HarmonicAngleForceImpl();
void initialize(OpenMMContextImpl& context); void initialize(ContextImpl& context);
HarmonicAngleForce& getOwner() { HarmonicAngleForce& getOwner() {
return owner; return owner;
} }
void updateContextState(OpenMMContextImpl& context) { void updateContextState(ContextImpl& context) {
// This force field doesn't update the state directly. // This force field doesn't update the state directly.
} }
void calcForces(OpenMMContextImpl& context, Stream& forces); void calcForces(ContextImpl& context, Stream& forces);
double calcEnergy(OpenMMContextImpl& context); double calcEnergy(ContextImpl& context);
std::map<std::string, double> getDefaultParameters() { std::map<std::string, double> getDefaultParameters() {
return std::map<std::string, double>(); // This force field doesn't define any parameters. return std::map<std::string, double>(); // This force field doesn't define any parameters.
} }
......
...@@ -49,15 +49,15 @@ class HarmonicBondForceImpl : public ForceImpl { ...@@ -49,15 +49,15 @@ class HarmonicBondForceImpl : public ForceImpl {
public: public:
HarmonicBondForceImpl(HarmonicBondForce& owner); HarmonicBondForceImpl(HarmonicBondForce& owner);
~HarmonicBondForceImpl(); ~HarmonicBondForceImpl();
void initialize(OpenMMContextImpl& context); void initialize(ContextImpl& context);
HarmonicBondForce& getOwner() { HarmonicBondForce& getOwner() {
return owner; return owner;
} }
void updateContextState(OpenMMContextImpl& context) { void updateContextState(ContextImpl& context) {
// This force field doesn't update the state directly. // This force field doesn't update the state directly.
} }
void calcForces(OpenMMContextImpl& context, Stream& forces); void calcForces(ContextImpl& context, Stream& forces);
double calcEnergy(OpenMMContextImpl& context); double calcEnergy(ContextImpl& context);
std::map<std::string, double> getDefaultParameters() { std::map<std::string, double> getDefaultParameters() {
return std::map<std::string, double>(); // This force field doesn't define any parameters. return std::map<std::string, double>(); // This force field doesn't define any parameters.
} }
......
...@@ -49,15 +49,15 @@ class NonbondedForceImpl : public ForceImpl { ...@@ -49,15 +49,15 @@ class NonbondedForceImpl : public ForceImpl {
public: public:
NonbondedForceImpl(NonbondedForce& owner); NonbondedForceImpl(NonbondedForce& owner);
~NonbondedForceImpl(); ~NonbondedForceImpl();
void initialize(OpenMMContextImpl& context); void initialize(ContextImpl& context);
NonbondedForce& getOwner() { NonbondedForce& getOwner() {
return owner; return owner;
} }
void updateContextState(OpenMMContextImpl& context) { void updateContextState(ContextImpl& context) {
// This force field doesn't update the state directly. // This force field doesn't update the state directly.
} }
void calcForces(OpenMMContextImpl& context, Stream& forces); void calcForces(ContextImpl& context, Stream& forces);
double calcEnergy(OpenMMContextImpl& context); double calcEnergy(ContextImpl& context);
std::map<std::string, double> getDefaultParameters() { std::map<std::string, double> getDefaultParameters() {
return std::map<std::string, double>(); // This force field doesn't define any parameters. return std::map<std::string, double>(); // This force field doesn't define any parameters.
} }
......
...@@ -49,15 +49,15 @@ class PeriodicTorsionForceImpl : public ForceImpl { ...@@ -49,15 +49,15 @@ class PeriodicTorsionForceImpl : public ForceImpl {
public: public:
PeriodicTorsionForceImpl(PeriodicTorsionForce& owner); PeriodicTorsionForceImpl(PeriodicTorsionForce& owner);
~PeriodicTorsionForceImpl(); ~PeriodicTorsionForceImpl();
void initialize(OpenMMContextImpl& context); void initialize(ContextImpl& context);
PeriodicTorsionForce& getOwner() { PeriodicTorsionForce& getOwner() {
return owner; return owner;
} }
void updateContextState(OpenMMContextImpl& context) { void updateContextState(ContextImpl& context) {
// This force field doesn't update the state directly. // This force field doesn't update the state directly.
} }
void calcForces(OpenMMContextImpl& context, Stream& forces); void calcForces(ContextImpl& context, Stream& forces);
double calcEnergy(OpenMMContextImpl& context); double calcEnergy(ContextImpl& context);
std::map<std::string, double> getDefaultParameters() { std::map<std::string, double> getDefaultParameters() {
return std::map<std::string, double>(); // This force field doesn't define any parameters. return std::map<std::string, double>(); // This force field doesn't define any parameters.
} }
......
...@@ -49,15 +49,15 @@ class RBTorsionForceImpl : public ForceImpl { ...@@ -49,15 +49,15 @@ class RBTorsionForceImpl : public ForceImpl {
public: public:
RBTorsionForceImpl(RBTorsionForce& owner); RBTorsionForceImpl(RBTorsionForce& owner);
~RBTorsionForceImpl(); ~RBTorsionForceImpl();
void initialize(OpenMMContextImpl& context); void initialize(ContextImpl& context);
RBTorsionForce& getOwner() { RBTorsionForce& getOwner() {
return owner; return owner;
} }
void updateContextState(OpenMMContextImpl& context) { void updateContextState(ContextImpl& context) {
// This force field doesn't update the state directly. // This force field doesn't update the state directly.
} }
void calcForces(OpenMMContextImpl& context, Stream& forces); void calcForces(ContextImpl& context, Stream& forces);
double calcEnergy(OpenMMContextImpl& context); double calcEnergy(ContextImpl& context);
std::map<std::string, double> getDefaultParameters() { std::map<std::string, double> getDefaultParameters() {
return std::map<std::string, double>(); // This force field doesn't define any parameters. return std::map<std::string, double>(); // This force field doesn't define any parameters.
} }
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#include "openmm/internal/AndersenThermostatImpl.h" #include "openmm/internal/AndersenThermostatImpl.h"
#include "openmm/internal/OpenMMContextImpl.h" #include "openmm/internal/ContextImpl.h"
#include "openmm/Integrator.h" #include "openmm/Integrator.h"
#include "openmm/System.h" #include "openmm/System.h"
#include "openmm/kernels.h" #include "openmm/kernels.h"
...@@ -42,12 +42,12 @@ using std::vector; ...@@ -42,12 +42,12 @@ using std::vector;
AndersenThermostatImpl::AndersenThermostatImpl(AndersenThermostat& owner) : owner(owner) { AndersenThermostatImpl::AndersenThermostatImpl(AndersenThermostat& owner) : owner(owner) {
} }
void AndersenThermostatImpl::initialize(OpenMMContextImpl& context) { void AndersenThermostatImpl::initialize(ContextImpl& context) {
kernel = context.getPlatform().createKernel(ApplyAndersenThermostatKernel::Name(), context); kernel = context.getPlatform().createKernel(ApplyAndersenThermostatKernel::Name(), context);
dynamic_cast<ApplyAndersenThermostatKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner); dynamic_cast<ApplyAndersenThermostatKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner);
} }
void AndersenThermostatImpl::updateContextState(OpenMMContextImpl& context) { void AndersenThermostatImpl::updateContextState(ContextImpl& context) {
dynamic_cast<ApplyAndersenThermostatKernel&>(kernel.getImpl()).execute(context); dynamic_cast<ApplyAndersenThermostatKernel&>(kernel.getImpl()).execute(context);
} }
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#include "openmm/BrownianIntegrator.h" #include "openmm/BrownianIntegrator.h"
#include "openmm/OpenMMContext.h" #include "openmm/Context.h"
#include "openmm/internal/OpenMMContextImpl.h" #include "openmm/internal/ContextImpl.h"
#include "openmm/kernels.h" #include "openmm/kernels.h"
#include <ctime> #include <ctime>
#include <string> #include <string>
...@@ -48,7 +48,7 @@ BrownianIntegrator::BrownianIntegrator(double temperature, double frictionCoeff, ...@@ -48,7 +48,7 @@ BrownianIntegrator::BrownianIntegrator(double temperature, double frictionCoeff,
setRandomNumberSeed((int) time(NULL)); setRandomNumberSeed((int) time(NULL));
} }
void BrownianIntegrator::initialize(OpenMMContextImpl& contextRef) { void BrownianIntegrator::initialize(ContextImpl& contextRef) {
context = &contextRef; context = &contextRef;
kernel = context->getPlatform().createKernel(IntegrateBrownianStepKernel::Name(), contextRef); kernel = context->getPlatform().createKernel(IntegrateBrownianStepKernel::Name(), contextRef);
dynamic_cast<IntegrateBrownianStepKernel&>(kernel.getImpl()).initialize(contextRef.getSystem(), *this); dynamic_cast<IntegrateBrownianStepKernel&>(kernel.getImpl()).initialize(contextRef.getSystem(), *this);
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#include "openmm/internal/CMMotionRemoverImpl.h" #include "openmm/internal/CMMotionRemoverImpl.h"
#include "openmm/internal/OpenMMContextImpl.h" #include "openmm/internal/ContextImpl.h"
#include "openmm/Integrator.h" #include "openmm/Integrator.h"
#include "openmm/System.h" #include "openmm/System.h"
#include "openmm/kernels.h" #include "openmm/kernels.h"
...@@ -42,13 +42,13 @@ using std::vector; ...@@ -42,13 +42,13 @@ using std::vector;
CMMotionRemoverImpl::CMMotionRemoverImpl(CMMotionRemover& owner) : owner(owner) { CMMotionRemoverImpl::CMMotionRemoverImpl(CMMotionRemover& owner) : owner(owner) {
} }
void CMMotionRemoverImpl::initialize(OpenMMContextImpl& context) { void CMMotionRemoverImpl::initialize(ContextImpl& context) {
kernel = context.getPlatform().createKernel(RemoveCMMotionKernel::Name(), context); kernel = context.getPlatform().createKernel(RemoveCMMotionKernel::Name(), context);
const System& system = context.getSystem(); const System& system = context.getSystem();
dynamic_cast<RemoveCMMotionKernel&>(kernel.getImpl()).initialize(system, owner); dynamic_cast<RemoveCMMotionKernel&>(kernel.getImpl()).initialize(system, owner);
} }
void CMMotionRemoverImpl::updateContextState(OpenMMContextImpl& context) { void CMMotionRemoverImpl::updateContextState(ContextImpl& context) {
dynamic_cast<RemoveCMMotionKernel&>(kernel.getImpl()).execute(context); dynamic_cast<RemoveCMMotionKernel&>(kernel.getImpl()).execute(context);
} }
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "openmm/OpenMMException.h" #include "openmm/OpenMMException.h"
#include "openmm/internal/GBSAOBCForceImpl.h" #include "openmm/internal/GBSAOBCForceImpl.h"
#include "openmm/internal/OpenMMContextImpl.h" #include "openmm/internal/ContextImpl.h"
#include "openmm/kernels.h" #include "openmm/kernels.h"
#include <vector> #include <vector>
...@@ -41,18 +41,18 @@ using std::vector; ...@@ -41,18 +41,18 @@ using std::vector;
GBSAOBCForceImpl::GBSAOBCForceImpl(GBSAOBCForce& owner) : owner(owner) { GBSAOBCForceImpl::GBSAOBCForceImpl(GBSAOBCForce& owner) : owner(owner) {
} }
void GBSAOBCForceImpl::initialize(OpenMMContextImpl& context) { void GBSAOBCForceImpl::initialize(ContextImpl& context) {
kernel = context.getPlatform().createKernel(CalcGBSAOBCForceKernel::Name(), context); kernel = context.getPlatform().createKernel(CalcGBSAOBCForceKernel::Name(), context);
if (owner.getNumParticles() != context.getSystem().getNumParticles()) if (owner.getNumParticles() != context.getSystem().getNumParticles())
throw OpenMMException("GBSAOBCForce must have exactly as many particles as the System it belongs to."); throw OpenMMException("GBSAOBCForce must have exactly as many particles as the System it belongs to.");
dynamic_cast<CalcGBSAOBCForceKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner); dynamic_cast<CalcGBSAOBCForceKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner);
} }
void GBSAOBCForceImpl::calcForces(OpenMMContextImpl& context, Stream& forces) { void GBSAOBCForceImpl::calcForces(ContextImpl& context, Stream& forces) {
dynamic_cast<CalcGBSAOBCForceKernel&>(kernel.getImpl()).executeForces(context); dynamic_cast<CalcGBSAOBCForceKernel&>(kernel.getImpl()).executeForces(context);
} }
double GBSAOBCForceImpl::calcEnergy(OpenMMContextImpl& context) { double GBSAOBCForceImpl::calcEnergy(ContextImpl& context) {
return dynamic_cast<CalcGBSAOBCForceKernel&>(kernel.getImpl()).executeEnergy(context); return dynamic_cast<CalcGBSAOBCForceKernel&>(kernel.getImpl()).executeEnergy(context);
} }
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#include "openmm/internal/GBVIForceImpl.h" #include "openmm/internal/GBVIForceImpl.h"
#include "openmm/internal/OpenMMContextImpl.h" #include "openmm/internal/ContextImpl.h"
#include "openmm/OpenMMException.h" #include "openmm/OpenMMException.h"
#include "openmm/kernels.h" #include "openmm/kernels.h"
#include <vector> #include <vector>
...@@ -43,7 +43,7 @@ using std::vector; ...@@ -43,7 +43,7 @@ using std::vector;
GBVIForceImpl::GBVIForceImpl(GBVIForce& owner) : owner(owner) { GBVIForceImpl::GBVIForceImpl(GBVIForce& owner) : owner(owner) {
} }
void GBVIForceImpl::initialize(OpenMMContextImpl& context) { void GBVIForceImpl::initialize(ContextImpl& context) {
kernel = context.getPlatform().createKernel(CalcGBVIForceKernel::Name(), context); kernel = context.getPlatform().createKernel(CalcGBVIForceKernel::Name(), context);
if (owner.getNumParticles() != context.getSystem().getNumParticles()) if (owner.getNumParticles() != context.getSystem().getNumParticles())
throw OpenMMException("GBVIForce must have exactly as many particles as the System it belongs to."); throw OpenMMException("GBVIForce must have exactly as many particles as the System it belongs to.");
...@@ -188,11 +188,11 @@ void GBVIForceImpl::findScaledRadii( int numberOfParticles, const std::vector<st ...@@ -188,11 +188,11 @@ void GBVIForceImpl::findScaledRadii( int numberOfParticles, const std::vector<st
} }
void GBVIForceImpl::calcForces(OpenMMContextImpl& context, Stream& forces) { void GBVIForceImpl::calcForces(ContextImpl& context, Stream& forces) {
dynamic_cast<CalcGBVIForceKernel&>(kernel.getImpl()).executeForces(context); dynamic_cast<CalcGBVIForceKernel&>(kernel.getImpl()).executeForces(context);
} }
double GBVIForceImpl::calcEnergy(OpenMMContextImpl& context) { double GBVIForceImpl::calcEnergy(ContextImpl& context) {
return dynamic_cast<CalcGBVIForceKernel&>(kernel.getImpl()).executeEnergy(context); return dynamic_cast<CalcGBVIForceKernel&>(kernel.getImpl()).executeEnergy(context);
} }
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. * * USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#include "openmm/internal/OpenMMContextImpl.h" #include "openmm/internal/ContextImpl.h"
#include "openmm/internal/HarmonicAngleForceImpl.h" #include "openmm/internal/HarmonicAngleForceImpl.h"
#include "openmm/kernels.h" #include "openmm/kernels.h"
...@@ -44,16 +44,16 @@ HarmonicAngleForceImpl::HarmonicAngleForceImpl(HarmonicAngleForce& owner) : owne ...@@ -44,16 +44,16 @@ HarmonicAngleForceImpl::HarmonicAngleForceImpl(HarmonicAngleForce& owner) : owne
HarmonicAngleForceImpl::~HarmonicAngleForceImpl() { HarmonicAngleForceImpl::~HarmonicAngleForceImpl() {
} }
void HarmonicAngleForceImpl::initialize(OpenMMContextImpl& context) { void HarmonicAngleForceImpl::initialize(ContextImpl& context) {
kernel = context.getPlatform().createKernel(CalcHarmonicAngleForceKernel::Name(), context); kernel = context.getPlatform().createKernel(CalcHarmonicAngleForceKernel::Name(), context);
dynamic_cast<CalcHarmonicAngleForceKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner); dynamic_cast<CalcHarmonicAngleForceKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner);
} }
void HarmonicAngleForceImpl::calcForces(OpenMMContextImpl& context, Stream& forces) { void HarmonicAngleForceImpl::calcForces(ContextImpl& context, Stream& forces) {
dynamic_cast<CalcHarmonicAngleForceKernel&>(kernel.getImpl()).executeForces(context); dynamic_cast<CalcHarmonicAngleForceKernel&>(kernel.getImpl()).executeForces(context);
} }
double HarmonicAngleForceImpl::calcEnergy(OpenMMContextImpl& context) { double HarmonicAngleForceImpl::calcEnergy(ContextImpl& context) {
return dynamic_cast<CalcHarmonicAngleForceKernel&>(kernel.getImpl()).executeEnergy(context); return dynamic_cast<CalcHarmonicAngleForceKernel&>(kernel.getImpl()).executeEnergy(context);
} }
......
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