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

Renamed OpenMMContext to Context

parent 95b8dbd6
......@@ -67,7 +67,7 @@ public:
*
* @param context the context in which to execute this kernel
*/
void execute(OpenMMContextImpl& context);
void execute(ContextImpl& context);
};
/**
......@@ -88,13 +88,13 @@ public:
*
* @param context the context in which to execute this kernel
*/
double getTime(const OpenMMContextImpl& context) const;
double getTime(const ContextImpl& context) const;
/**
* Set the current time (in picoseconds).
*
* @param context the context in which to execute this kernel
*/
void setTime(OpenMMContextImpl& context, double time);
void setTime(ContextImpl& context, double time);
private:
ReferencePlatform::PlatformData& data;
};
......@@ -119,14 +119,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
void executeForces(OpenMMContextImpl& context);
void executeForces(ContextImpl& context);
/**
* 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
*/
double executeEnergy(OpenMMContextImpl& context);
double executeEnergy(ContextImpl& context);
private:
int numBonds;
int **bondIndexArray;
......@@ -153,14 +153,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
void executeForces(OpenMMContextImpl& context);
void executeForces(ContextImpl& context);
/**
* 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
*/
double executeEnergy(OpenMMContextImpl& context);
double executeEnergy(ContextImpl& context);
private:
int numAngles;
int **angleIndexArray;
......@@ -187,14 +187,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
void executeForces(OpenMMContextImpl& context);
void executeForces(ContextImpl& context);
/**
* 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
*/
double executeEnergy(OpenMMContextImpl& context);
double executeEnergy(ContextImpl& context);
private:
int numTorsions;
int **torsionIndexArray;
......@@ -221,14 +221,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
void executeForces(OpenMMContextImpl& context);
void executeForces(ContextImpl& context);
/**
* 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
*/
double executeEnergy(OpenMMContextImpl& context);
double executeEnergy(ContextImpl& context);
private:
int numTorsions;
int **torsionIndexArray;
......@@ -255,14 +255,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
void executeForces(OpenMMContextImpl& context);
void executeForces(ContextImpl& context);
/**
* 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
*/
double executeEnergy(OpenMMContextImpl& context);
double executeEnergy(ContextImpl& context);
private:
int numParticles, num14;
int **exclusionArray, **bonded14IndexArray;
......@@ -294,14 +294,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
void executeForces(OpenMMContextImpl& context);
void executeForces(ContextImpl& context);
/**
* 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
*/
double executeEnergy(OpenMMContextImpl& context);
double executeEnergy(ContextImpl& context);
private:
CpuObc* obc;
std::vector<RealOpenMM> charges;
......@@ -328,14 +328,14 @@ public:
*
* @param context the context in which to execute this kernel
*/
void executeForces(OpenMMContextImpl& context);
void executeForces(ContextImpl& context);
/**
* 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
*/
double executeEnergy(OpenMMContextImpl& context);
double executeEnergy(ContextImpl& context);
private:
CpuGBVI * gbvi;
std::vector<RealOpenMM> charges;
......@@ -363,7 +363,7 @@ public:
* @param context the context in which to execute this kernel
* @param integrator the VerletIntegrator this kernel is being used for
*/
void execute(OpenMMContextImpl& context, const VerletIntegrator& integrator);
void execute(ContextImpl& context, const VerletIntegrator& integrator);
private:
ReferencePlatform::PlatformData& data;
ReferenceVerletDynamics* dynamics;
......@@ -397,7 +397,7 @@ public:
* @param context the context in which to execute this kernel
* @param integrator the LangevinIntegrator this kernel is being used for
*/
void execute(OpenMMContextImpl& context, const LangevinIntegrator& integrator);
void execute(ContextImpl& context, const LangevinIntegrator& integrator);
private:
ReferencePlatform::PlatformData& data;
ReferenceStochasticDynamics* dynamics;
......@@ -431,7 +431,7 @@ public:
* @param context the context in which to execute this kernel
* @param integrator the BrownianIntegrator this kernel is being used for
*/
void execute(OpenMMContextImpl& context, const BrownianIntegrator& integrator);
void execute(ContextImpl& context, const BrownianIntegrator& integrator);
private:
ReferencePlatform::PlatformData& data;
ReferenceBrownianDynamics* dynamics;
......@@ -466,7 +466,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
*/
void execute(OpenMMContextImpl& context, const VariableLangevinIntegrator& integrator, double maxTime);
void execute(ContextImpl& context, const VariableLangevinIntegrator& integrator, double maxTime);
private:
ReferencePlatform::PlatformData& data;
ReferenceVariableStochasticDynamics* dynamics;
......@@ -501,7 +501,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
*/
void execute(OpenMMContextImpl& context, const VariableVerletIntegrator& integrator, double maxTime);
void execute(ContextImpl& context, const VariableVerletIntegrator& integrator, double maxTime);
private:
ReferencePlatform::PlatformData& data;
ReferenceVariableVerletDynamics* dynamics;
......@@ -533,7 +533,7 @@ public:
*
* @param context the context in which to execute this kernel
*/
void execute(OpenMMContextImpl& context);
void execute(ContextImpl& context);
private:
ReferenceAndersenThermostat* thermostat;
RealOpenMM* masses;
......@@ -557,7 +557,7 @@ public:
*
* @param context the context in which to execute this kernel
*/
double execute(OpenMMContextImpl& context);
double execute(ContextImpl& context);
private:
std::vector<double> masses;
};
......@@ -581,7 +581,7 @@ public:
*
* @param context the context in which to execute this kernel
*/
void execute(OpenMMContextImpl& context);
void execute(ContextImpl& context);
private:
ReferencePlatform::PlatformData& data;
std::vector<double> masses;
......
......@@ -32,7 +32,7 @@
#include "ReferencePlatform.h"
#include "ReferenceKernelFactory.h"
#include "ReferenceKernels.h"
#include "openmm/internal/OpenMMContextImpl.h"
#include "openmm/internal/ContextImpl.h"
#include "SimTKUtilities/SimTKOpenMMRealType.h"
using namespace OpenMM;
......@@ -66,11 +66,11 @@ const StreamFactory& ReferencePlatform::getDefaultStreamFactory() const {
return defaultStreamFactory;
}
void ReferencePlatform::contextCreated(OpenMMContextImpl& context) const {
void ReferencePlatform::contextCreated(ContextImpl& context) const {
context.setPlatformData(new PlatformData());
}
void ReferencePlatform::contextDestroyed(OpenMMContextImpl& context) const {
void ReferencePlatform::contextDestroyed(ContextImpl& context) const {
PlatformData* data = reinterpret_cast<PlatformData*>(context.getPlatformData());
delete data;
}
......@@ -36,7 +36,7 @@
using namespace OpenMM;
StreamImpl* ReferenceStreamFactory::createStreamImpl(std::string name, int size, Stream::DataType type, const Platform& platform, OpenMMContextImpl& context) const {
StreamImpl* ReferenceStreamFactory::createStreamImpl(std::string name, int size, Stream::DataType type, const Platform& platform, ContextImpl& context) const {
switch (type) {
case Stream::Float:
case Stream::Float2:
......
......@@ -35,7 +35,7 @@
#include "../../../tests/AssertionUtilities.h"
#include "openmm/AndersenThermostat.h"
#include "openmm/OpenMMContext.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/NonbondedForce.h"
#include "openmm/System.h"
......@@ -63,7 +63,7 @@ void testTemperature() {
system.addForce(forceField);
AndersenThermostat* thermstat = new AndersenThermostat(temp, collisionFreq);
system.addForce(thermstat);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(numParticles);
for (int i = 0; i < numParticles; ++i)
positions[i] = Vec3((i%2 == 0 ? 2 : -2), (i%4 < 2 ? 2 : -2), (i < 4 ? 2 : -2));
......@@ -111,7 +111,7 @@ void testRandomSeed() {
// Try twice with the same random seed.
thermostat->setRandomNumberSeed(5);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
context.setPositions(positions);
context.setVelocities(velocities);
integrator.step(10);
......
......@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/OpenMMContext.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/NonbondedForce.h"
......@@ -60,7 +60,7 @@ void testSingleBond() {
HarmonicBondForce* forceField = new HarmonicBondForce();
forceField->addBond(0, 1, 1.5, 1);
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(2);
positions[0] = Vec3(-1, 0, 0);
positions[1] = Vec3(1, 0, 0);
......@@ -98,7 +98,7 @@ void testTemperature() {
for (int i = 0; i < numBonds; ++i)
forceField->addBond(i, i+1, 1.0, 5.0);
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(numParticles);
for (int i = 0; i < numParticles; ++i)
positions[i] = Vec3(i, 0, 0);
......@@ -137,7 +137,7 @@ void testConstraints() {
for (int i = 0; i < numParticles-1; ++i)
system.addConstraint(i, i+1, 1.0);
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(numParticles);
vector<Vec3> velocities(numParticles);
init_gen_rand(0);
......@@ -185,7 +185,7 @@ void testRandomSeed() {
// Try twice with the same random seed.
integrator.setRandomNumberSeed(5);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
context.setPositions(positions);
context.setVelocities(velocities);
integrator.step(10);
......
......@@ -35,7 +35,7 @@
#include "../../../tests/AssertionUtilities.h"
#include "openmm/CMMotionRemover.h"
#include "openmm/OpenMMContext.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/NonbondedForce.h"
......@@ -77,7 +77,7 @@ void testMotionRemoval() {
system.addForce(nonbonded);
CMMotionRemover* remover = new CMMotionRemover();
system.addForce(remover);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(numParticles);
vector<Vec3> velocities(numParticles);
init_gen_rand(0);
......
......@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/OpenMMContext.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/NonbondedForce.h"
#include "openmm/System.h"
......@@ -64,7 +64,7 @@ void testEwald() {
nonbonded->setPeriodicBoxVectors(Vec3(6, 0, 0), Vec3(0, 6, 0), Vec3(0, 0, 6));
nonbonded->setEwaldErrorTolerance(TOL);
system.addForce(nonbonded);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(2);
positions[0] = Vec3(3.048000,2.764000,3.156000);
positions[1] = Vec3(2.809000,2.888000,2.571000);
......@@ -99,7 +99,7 @@ void testPME() {
nonbonded->setPeriodicBoxVectors(Vec3(1.86206, 0, 0), Vec3(0, 1.86206, 0), Vec3(0, 0, 1.86206));
nonbonded->setEwaldErrorTolerance(TOL);
system.addForce(nonbonded);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(42);
positions[0] = Vec3( 0.23,0.628,0.113);
positions[1] = Vec3(0.137,0.626, 0.15);
......
......@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/OpenMMContext.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/GBSAOBCForce.h"
#include "openmm/System.h"
......@@ -58,7 +58,7 @@ void testSingleParticle() {
GBSAOBCForce* forceField = new GBSAOBCForce();
forceField->addParticle(0.5, 0.15, 1);
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(1);
positions[0] = Vec3(0, 0, 0);
context.setPositions(positions);
......@@ -96,7 +96,7 @@ void testCutoffAndPeriodic() {
// Calculate the forces for both cutoff and periodic with two different atom positions.
nonbonded->setNonbondedMethod(NonbondedForce::CutoffNonPeriodic);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
context.setPositions(positions);
State state1 = context.getState(State::Forces);
nonbonded->setNonbondedMethod(NonbondedForce::CutoffPeriodic);
......@@ -134,7 +134,7 @@ void testForce() {
forceField->addParticle(i%2 == 0 ? -1 : 1, 0.15, 1);
}
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
// Set random positions for all the particles.
......
......@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/OpenMMContext.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/GBVIForce.h"
......@@ -66,7 +66,7 @@ void testSingleParticle() {
forceField->addParticle(charge, radius, gamma);
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(1);
positions[0] = Vec3(0, 0, 0);
context.setPositions(positions);
......@@ -111,7 +111,7 @@ void testCutoffAndPeriodic() {
// Calculate the forces for both cutoff and periodic with two different atom positions.
nonbonded->setNonbondedMethod(NonbondedForce::CutoffNonPeriodic);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
context.setPositions(positions);
State state1 = context.getState(State::Forces);
nonbonded->setNonbondedMethod(NonbondedForce::CutoffPeriodic);
......@@ -204,7 +204,7 @@ void testEnergyEthane() {
system.addForce(forceField);
}
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
/*
0.5480 1.7661 0.0000 H 0 0 0 0 0 0 0 0 0
......@@ -314,7 +314,7 @@ void testEnergyTwoParticle() {
system.addForce(forceField);
}
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(numParticles);
positions[0] = Vec3( 0.0000, 0.0000, 0.0000);
......
......@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/OpenMMContext.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/HarmonicAngleForce.h"
#include "openmm/System.h"
......@@ -60,7 +60,7 @@ void testAngles() {
forceField->addAngle(0, 1, 2, PI_M/3, 1.1);
forceField->addAngle(1, 2, 3, PI_M/2, 1.2);
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(4);
positions[0] = Vec3(0, 1, 0);
positions[1] = Vec3(0, 0, 0);
......
......@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/OpenMMContext.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/System.h"
......@@ -59,7 +59,7 @@ void testBonds() {
forceField->addBond(0, 1, 1.5, 0.8);
forceField->addBond(1, 2, 1.2, 0.7);
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(3);
positions[0] = Vec3(0, 2, 0);
positions[1] = Vec3(0, 0, 0);
......
......@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/OpenMMContext.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/System.h"
#include "openmm/VerletIntegrator.h"
......@@ -52,7 +52,7 @@ void testCalcKE() {
for (int i = 0; i < 4; ++i)
system.addParticle(i+1);
VerletIntegrator integrator(0.01);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> velocities(4);
velocities[0] = Vec3(1, 0, 0);
velocities[1] = Vec3(0, 1, 0);
......
......@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/OpenMMContext.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/NonbondedForce.h"
......@@ -59,7 +59,7 @@ void testSingleBond() {
HarmonicBondForce* forceField = new HarmonicBondForce();
forceField->addBond(0, 1, 1.5, 1);
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(2);
positions[0] = Vec3(-1, 0, 0);
positions[1] = Vec3(1, 0, 0);
......@@ -106,7 +106,7 @@ void testTemperature() {
forceField->addParticle((i%2 == 0 ? 1.0 : -1.0), 1.0, 5.0);
}
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(numParticles);
for (int i = 0; i < numParticles; ++i)
positions[i] = Vec3((i%2 == 0 ? 2 : -2), (i%4 < 2 ? 2 : -2), (i < 4 ? 2 : -2));
......@@ -144,7 +144,7 @@ void testConstraints() {
for (int i = 0; i < numParticles-1; ++i)
system.addConstraint(i, i+1, 1.0);
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(numParticles);
vector<Vec3> velocities(numParticles);
init_gen_rand(0);
......@@ -192,7 +192,7 @@ void testRandomSeed() {
// Try twice with the same random seed.
integrator.setRandomNumberSeed(5);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
context.setPositions(positions);
context.setVelocities(velocities);
integrator.step(10);
......
......@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/OpenMMContext.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/NonbondedForce.h"
#include "openmm/System.h"
......@@ -59,7 +59,7 @@ void testCoulomb() {
forceField->addParticle(0.5, 1, 0);
forceField->addParticle(-1.5, 1, 0);
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(2);
positions[0] = Vec3(0, 0, 0);
positions[1] = Vec3(2, 0, 0);
......@@ -82,7 +82,7 @@ void testLJ() {
forceField->addParticle(0, 1.2, 1);
forceField->addParticle(0, 1.4, 2);
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(2);
positions[0] = Vec3(0, 0, 0);
positions[1] = Vec3(2, 0, 0);
......@@ -123,7 +123,7 @@ void testExclusionsAnd14() {
second14 = i;
}
system.addForce(nonbonded);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
for (int i = 1; i < 5; ++i) {
// Test LJ forces
......@@ -202,7 +202,7 @@ void testCutoff() {
const double eps = 50.0;
forceField->setReactionFieldDielectric(eps);
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(3);
positions[0] = Vec3(0, 0, 0);
positions[1] = Vec3(0, 2, 0);
......@@ -253,7 +253,7 @@ void testCutoff14() {
second14 = i;
}
system.addForce(nonbonded);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(5);
positions[0] = Vec3(0, 0, 0);
positions[1] = Vec3(1, 0, 0);
......@@ -337,7 +337,7 @@ void testPeriodic() {
nonbonded->setCutoffDistance(cutoff);
nonbonded->setPeriodicBoxVectors(Vec3(4, 0, 0), Vec3(0, 4, 0), Vec3(0, 0, 4));
system.addForce(nonbonded);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(3);
positions[0] = Vec3(0, 0, 0);
positions[1] = Vec3(2, 0, 0);
......
......@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/OpenMMContext.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/PeriodicTorsionForce.h"
#include "openmm/System.h"
......@@ -59,7 +59,7 @@ void testPeriodicTorsions() {
PeriodicTorsionForce* forceField = new PeriodicTorsionForce();
forceField->addTorsion(0, 1, 2, 3, 2, PI_M/3, 1.1);
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(4);
positions[0] = Vec3(0, 1, 0);
positions[1] = Vec3(0, 0, 0);
......
......@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/OpenMMContext.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/RBTorsionForce.h"
#include "openmm/System.h"
......@@ -59,7 +59,7 @@ void testRBTorsions() {
RBTorsionForce* forceField = new RBTorsionForce();
forceField->addTorsion(0, 1, 2, 3, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6);
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(4);
positions[0] = Vec3(0, 1, 0);
positions[1] = Vec3(0, 0, 0);
......
......@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/OpenMMContext.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/NonbondedForce.h"
......@@ -59,7 +59,7 @@ void testSingleBond() {
HarmonicBondForce* forceField = new HarmonicBondForce();
forceField->addBond(0, 1, 1.5, 1);
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(2);
positions[0] = Vec3(-1, 0, 0);
positions[1] = Vec3(1, 0, 0);
......@@ -106,7 +106,7 @@ void testTemperature() {
forceField->addParticle((i%2 == 0 ? 1.0 : -1.0), 1.0, 5.0);
}
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(numParticles);
for (int i = 0; i < numParticles; ++i)
positions[i] = Vec3((i%2 == 0 ? 2 : -2), (i%4 < 2 ? 2 : -2), (i < 4 ? 2 : -2));
......@@ -145,7 +145,7 @@ void testConstraints() {
for (int i = 0; i < numParticles-1; ++i)
system.addConstraint(i, i+1, 1.0);
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(numParticles);
vector<Vec3> velocities(numParticles);
init_gen_rand(0);
......@@ -192,7 +192,7 @@ void testRandomSeed() {
// Try twice with the same random seed.
integrator.setRandomNumberSeed(5);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
context.setPositions(positions);
context.setVelocities(velocities);
integrator.step(10);
......
......@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/OpenMMContext.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/NonbondedForce.h"
......@@ -59,7 +59,7 @@ void testSingleBond() {
HarmonicBondForce* forceField = new HarmonicBondForce();
forceField->addBond(0, 1, 1.5, 1);
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(2);
positions[0] = Vec3(-1, 0, 0);
positions[1] = Vec3(1, 0, 0);
......@@ -101,7 +101,7 @@ void testConstraints() {
for (int i = 0; i < numParticles-1; ++i)
system.addConstraint(i, i+1, 1.0);
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(numParticles);
vector<Vec3> velocities(numParticles);
init_gen_rand(0);
......@@ -166,7 +166,7 @@ void testConstrainedClusters() {
system.addConstraint(3, 4, sqrt(2.0));
system.addConstraint(5, 6, sqrt(2.0));
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(numParticles);
positions[0] = Vec3(0, 0, 0);
positions[1] = Vec3(1, 0, 0);
......
......@@ -34,7 +34,7 @@
*/
#include "../../../tests/AssertionUtilities.h"
#include "openmm/OpenMMContext.h"
#include "openmm/Context.h"
#include "ReferencePlatform.h"
#include "openmm/HarmonicBondForce.h"
#include "openmm/NonbondedForce.h"
......@@ -59,7 +59,7 @@ void testSingleBond() {
HarmonicBondForce* forceField = new HarmonicBondForce();
forceField->addBond(0, 1, 1.5, 1);
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(2);
positions[0] = Vec3(-1, 0, 0);
positions[1] = Vec3(1, 0, 0);
......@@ -100,7 +100,7 @@ void testConstraints() {
for (int i = 0; i < numParticles-1; ++i)
system.addConstraint(i, i+1, 1.0);
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(numParticles);
vector<Vec3> velocities(numParticles);
init_gen_rand(0);
......@@ -157,7 +157,7 @@ void testConstrainedClusters() {
system.addConstraint(3, 4, sqrt(2.0));
system.addConstraint(5, 6, sqrt(2.0));
system.addForce(forceField);
OpenMMContext context(system, integrator, platform);
Context context(system, integrator, platform);
vector<Vec3> positions(numParticles);
positions[0] = Vec3(0, 0, 0);
positions[1] = Vec3(1, 0, 0);
......
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