Commit 71d33617 authored by John Chodera (MSKCC)'s avatar John Chodera (MSKCC)
Browse files

Merge remote-tracking branch 'upstream/master'

parents eb232608 9da36463
......@@ -410,9 +410,9 @@ void testTriclinic() {
}
else {
const Vec3 force = delta*ONE_4PI_EPS0*(-1.0/(distance*distance*distance)+2.0*krf);
ASSERT_EQUAL_TOL(ONE_4PI_EPS0*(1.0/distance+krf*distance*distance-crf), state.getPotentialEnergy(), TOL);
ASSERT_EQUAL_VEC(force, state.getForces()[0], TOL);
ASSERT_EQUAL_VEC(-force, state.getForces()[1], TOL);
ASSERT_EQUAL_TOL(ONE_4PI_EPS0*(1.0/distance+krf*distance*distance-crf), state.getPotentialEnergy(), 1e-4);
ASSERT_EQUAL_VEC(force, state.getForces()[0], 1e-4);
ASSERT_EQUAL_VEC(-force, state.getForces()[1], 1e-4);
}
}
}
......
......@@ -413,7 +413,7 @@ void testConservationLaws() {
if (i == 0)
initialAngularMomentum = angularMomentum;
else
ASSERT_EQUAL_VEC(initialAngularMomentum, angularMomentum, 0.03);
ASSERT_EQUAL_VEC(initialAngularMomentum, angularMomentum, 0.05);
integrator.step(1);
}
}
......
/* Portions copyright (c) 2006-2013 Stanford University and Simbios.
/* Portions copyright (c) 2006-2015 Stanford University and Simbios.
* Contributors: Pande Group
*
* Permission is hereby granted, free of charge, to any person obtaining
......@@ -37,6 +37,7 @@ class OPENMM_EXPORT ReferenceCCMAAlgorithm : public ReferenceConstraintAlgorithm
protected:
int _maximumNumberOfIterations;
RealOpenMM _elementCutoff;
int _numberOfConstraints;
std::vector<std::pair<int, int> > _atomIndices;
......@@ -66,8 +67,9 @@ public:
* @param distance distances for constraints
* @param masses atom masses
* @param angles angle force field terms
* @param elementCutoff the cutoff for which elements of the inverse matrix to keep
*/
ReferenceCCMAAlgorithm(int numberOfAtoms, int numberOfConstraints, const std::vector<std::pair<int, int> >& atomIndices, const std::vector<RealOpenMM>& distance, std::vector<RealOpenMM>& masses, std::vector<AngleInfo>& angles);
ReferenceCCMAAlgorithm(int numberOfAtoms, int numberOfConstraints, const std::vector<std::pair<int, int> >& atomIndices, const std::vector<RealOpenMM>& distance, std::vector<RealOpenMM>& masses, std::vector<AngleInfo>& angles, RealOpenMM elementCutoff);
~ReferenceCCMAAlgorithm();
......@@ -107,6 +109,13 @@ public:
*/
void applyToVelocities(std::vector<OpenMM::RealVec>& atomCoordinates,
std::vector<OpenMM::RealVec>& velocities, std::vector<RealOpenMM>& inverseMasses, RealOpenMM tolerance);
/**
* Get the inverse constraint matrix. Each element represents one column, and contains a list
* of all non-zero elements in the form (index, value).
*/
const std::vector<std::vector<std::pair<int, RealOpenMM> > >& getMatrix() const;
};
class ReferenceCCMAAlgorithm::AngleInfo
......
......@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2008-2013 Stanford University and the Authors. *
* Portions copyright (c) 2008-2015 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -493,6 +493,13 @@ public:
* @return the potential energy due to the force
*/
double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
/**
* Copy changed parameters over to a context.
*
* @param context the context to copy parameters to
* @param force the CMAPTorsionForce to copy the parameters from
*/
void copyParametersToContext(ContextImpl& context, const CMAPTorsionForce& force);
private:
std::vector<std::vector<std::vector<RealOpenMM> > > coeff;
std::vector<int> torsionMaps;
......
......@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2008-2013 Stanford University and the Authors. *
* Portions copyright (c) 2008-2015 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -710,6 +710,40 @@ double ReferenceCalcCMAPTorsionForceKernel::execute(ContextImpl& context, bool i
return totalEnergy;
}
void ReferenceCalcCMAPTorsionForceKernel::copyParametersToContext(ContextImpl& context, const CMAPTorsionForce& force) {
int numMaps = force.getNumMaps();
int numTorsions = force.getNumTorsions();
if (coeff.size() != numMaps)
throw OpenMMException("updateParametersInContext: The number of maps has changed");
if (torsionMaps.size() != numTorsions)
throw OpenMMException("updateParametersInContext: The number of CMAP torsions has changed");
// Update the maps.
vector<double> energy;
vector<vector<double> > c;
for (int i = 0; i < numMaps; i++) {
int size;
force.getMapParameters(i, size, energy);
if (coeff[i].size() != size*size)
throw OpenMMException("updateParametersInContext: The size of a map has changed");
CMAPTorsionForceImpl::calcMapDerivatives(size, energy, c);
for (int j = 0; j < size*size; j++)
for (int k = 0; k < 16; k++)
coeff[i][j][k] = c[j][k];
}
// Update the indices.
for (int i = 0; i < numTorsions; i++) {
int index[8];
force.getTorsionParameters(i, torsionMaps[i], index[0], index[1], index[2], index[3], index[4], index[5], index[6], index[7]);
for (int j = 0; j < 8; j++)
if (index[j] != torsionIndices[i][j])
throw OpenMMException("updateParametersInContext: The set of particles in a CMAP torsion has changed");
}
}
ReferenceCalcCustomTorsionForceKernel::~ReferenceCalcCustomTorsionForceKernel() {
disposeIntArray(torsionIndexArray, numTorsions);
disposeRealArray(torsionParamArray, numTorsions);
......
......@@ -382,9 +382,9 @@ void ObcParameters::setPeriodic(OpenMM::RealVec* vectors) {
assert(_cutoff);
assert(boxSize[0][0] >= 2.0*_cutoffDistance);
assert(boxSize[1][1] >= 2.0*_cutoffDistance);
assert(boxSize[2][2] >= 2.0*_cutoffDistance);
assert(vectors[0][0] >= 2.0*_cutoffDistance);
assert(vectors[1][1] >= 2.0*_cutoffDistance);
assert(vectors[2][2] >= 2.0*_cutoffDistance);
_periodic = true;
_periodicBoxVectors[0] = vectors[0];
......
/* Portions copyright (c) 2006-2013 Stanford University and Simbios.
/* Portions copyright (c) 2006-2015 Stanford University and Simbios.
* Contributors: Peter Eastman, Pande Group
*
* Permission is hereby granted, free of charge, to any person obtaining
......@@ -31,6 +31,7 @@
#include "quern.h"
#include "openmm/OpenMMException.h"
#include "openmm/Vec3.h"
#include "openmm/internal/ThreadPool.h"
#include <map>
using std::map;
......@@ -39,13 +40,51 @@ using std::vector;
using std::set;
using namespace OpenMM;
// This class extracts columns from the inverse matrix one at a time. It is done in parallel,
// since this can be very slow.
class ExtractMatrixTask : public ThreadPool::Task {
public:
ExtractMatrixTask(int numConstraints, vector<vector<pair<int, RealOpenMM> > >& matrix, const vector<RealOpenMM>& distance, RealOpenMM elementCutoff,
const int* qRowStart, const int* qColIndex, const int* rRowStart, const int* rColIndex, const double* qValue, const double* rValue) :
numConstraints(numConstraints), matrix(matrix), distance(distance), elementCutoff(elementCutoff), qRowStart(qRowStart), qColIndex(qColIndex),
rRowStart(rRowStart), rColIndex(rColIndex), qValue(qValue), rValue(rValue) {
}
void execute(ThreadPool& pool, int threadIndex) {
vector<double> rhs(numConstraints);
for (int i = threadIndex; i < numConstraints; i += pool.getNumThreads()) {
// Extract column i of the inverse matrix.
for (int j = 0; j < numConstraints; j++)
rhs[j] = (i == j ? 1.0 : 0.0);
QUERN_multiply_with_q_transpose(numConstraints, qRowStart, qColIndex, qValue, &rhs[0]);
QUERN_solve_with_r(numConstraints, rRowStart, rColIndex, rValue, &rhs[0], &rhs[0]);
for (int j = 0; j < numConstraints; j++) {
double value = rhs[j]*distance[j]/distance[i];
if (FABS((RealOpenMM) value) > elementCutoff)
matrix[i].push_back(pair<int, RealOpenMM>(j, (RealOpenMM) value));
}
}
}
private:
int numConstraints;
vector<vector<pair<int, RealOpenMM> > >& matrix;
const vector<RealOpenMM>& distance;
RealOpenMM elementCutoff;
const int *qRowStart, *qColIndex, *rRowStart, *rColIndex;
const double *qValue, *rValue;
};
ReferenceCCMAAlgorithm::ReferenceCCMAAlgorithm(int numberOfAtoms,
int numberOfConstraints,
const vector<pair<int, int> >& atomIndices,
const vector<RealOpenMM>& distance,
vector<RealOpenMM>& masses,
vector<AngleInfo>& angles) {
int numberOfConstraints,
const vector<pair<int, int> >& atomIndices,
const vector<RealOpenMM>& distance,
vector<RealOpenMM>& masses,
vector<AngleInfo>& angles,
RealOpenMM elementCutoff) {
_numberOfConstraints = numberOfConstraints;
_elementCutoff = elementCutoff;
_atomIndices = atomIndices;
_distance = distance;
......@@ -157,19 +196,10 @@ ReferenceCCMAAlgorithm::ReferenceCCMAAlgorithm(int numberOfAtoms,
&qRowStart, &qColIndex, &qValue, &rRowStart, &rColIndex, &rValue);
vector<double> rhs(numberOfConstraints);
_matrix.resize(numberOfConstraints);
for (int i = 0; i < numberOfConstraints; i++) {
// Extract column i of the inverse matrix.
for (int j = 0; j < numberOfConstraints; j++)
rhs[j] = (i == j ? 1.0 : 0.0);
QUERN_multiply_with_q_transpose(numberOfConstraints, qRowStart, qColIndex, qValue, &rhs[0]);
QUERN_solve_with_r(numberOfConstraints, rRowStart, rColIndex, rValue, &rhs[0], &rhs[0]);
for (int j = 0; j < numberOfConstraints; j++) {
double value = rhs[j]*_distance[i]/_distance[j];
if (FABS((RealOpenMM)value) > 0.02)
_matrix[j].push_back(pair<int, RealOpenMM>(i, (RealOpenMM) value));
}
}
ThreadPool threads;
ExtractMatrixTask task(numberOfConstraints, _matrix, _distance, _elementCutoff, qRowStart, qColIndex, rRowStart, rColIndex, qValue, rValue);
threads.execute(task);
threads.waitForThreads();
QUERN_free_result(qRowStart, qColIndex, qValue);
QUERN_free_result(rRowStart, rColIndex, rValue);
}
......@@ -290,3 +320,7 @@ void ReferenceCCMAAlgorithm::applyConstraints(vector<RealVec>& atomCoordinates,
}
}
}
const vector<vector<pair<int, RealOpenMM> > >& ReferenceCCMAAlgorithm::getMatrix() const {
return _matrix;
}
......@@ -180,7 +180,7 @@ ReferenceConstraints::ReferenceConstraints(const System& system) : ccma(NULL), s
// Create the CCMA object.
ccma = new ReferenceCCMAAlgorithm(numParticles, numCCMA, ccmaIndices, ccmaDistance, masses, angles);
ccma = new ReferenceCCMAAlgorithm(numParticles, numCCMA, ccmaIndices, ccmaDistance, masses, angles, 0.02);
}
}
......
......@@ -48,12 +48,13 @@
using namespace OpenMM;
using namespace std;
ReferencePlatform platform;
void testTemperature() {
const int numParticles = 8;
const double temp = 100.0;
const double collisionFreq = 10.0;
const int numSteps = 5000;
ReferencePlatform platform;
System system;
VerletIntegrator integrator(0.003);
NonbondedForce* forceField = new NonbondedForce();
......@@ -94,7 +95,6 @@ void testConstraints() {
const double temp = 100.0;
const double collisionFreq = 10.0;
const int numSteps = 15000;
ReferencePlatform platform;
System system;
VerletIntegrator integrator(0.004);
NonbondedForce* forceField = new NonbondedForce();
......@@ -147,7 +147,6 @@ void testRandomSeed() {
const int numParticles = 8;
const double temp = 100.0;
const double collisionFreq = 10.0;
ReferencePlatform platform;
System system;
VerletIntegrator integrator(0.01);
NonbondedForce* forceField = new NonbondedForce();
......
......@@ -48,10 +48,11 @@
using namespace OpenMM;
using namespace std;
ReferencePlatform platform;
const double TOL = 1e-5;
void testSingleBond() {
ReferencePlatform platform;
System system;
system.addParticle(2.0);
system.addParticle(2.0);
......@@ -88,7 +89,6 @@ void testTemperature() {
const int numParticles = 8;
const int numBonds = numParticles-1;
const double temp = 10.0;
ReferencePlatform platform;
System system;
BrownianIntegrator integrator(temp, 2.0, 0.01);
HarmonicBondForce* forceField = new HarmonicBondForce();
......@@ -125,7 +125,6 @@ void testTemperature() {
void testConstraints() {
const int numParticles = 8;
const double temp = 100.0;
ReferencePlatform platform;
System system;
BrownianIntegrator integrator(temp, 2.0, 0.001);
integrator.setConstraintTolerance(1e-5);
......@@ -165,7 +164,6 @@ void testConstraints() {
}
void testConstrainedMasslessParticles() {
ReferencePlatform platform;
System system;
system.addParticle(0.0);
system.addParticle(1.0);
......@@ -200,7 +198,6 @@ void testRandomSeed() {
const int numParticles = 8;
const double temp = 100.0;
const double collisionFreq = 10.0;
ReferencePlatform platform;
System system;
BrownianIntegrator integrator(temp, 2.0, 0.001);
NonbondedForce* forceField = new NonbondedForce();
......
......@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010 Stanford University and the Authors. *
* Portions copyright (c) 2010-2015 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -48,6 +48,8 @@
using namespace OpenMM;
using namespace std;
ReferencePlatform platform;
const double TOL = 1e-5;
void testCMAPTorsions() {
......@@ -56,7 +58,6 @@ void testCMAPTorsions() {
// Create two systems: one with a pair of periodic torsions, and one with a CMAP torsion
// that approximates the same force.
ReferencePlatform platform;
System system1;
for (int i = 0; i < 5; i++)
system1.addParticle(1.0);
......@@ -108,9 +109,66 @@ void testCMAPTorsions() {
}
}
void testChangingParameters() {
// Create a system with two maps and one torsion.
const int mapSize = 8;
System system;
for (int i = 0; i < 5; i++)
system.addParticle(1.0);
CMAPTorsionForce* cmap = new CMAPTorsionForce();
vector<double> mapEnergy1(mapSize*mapSize);
vector<double> mapEnergy2(mapSize*mapSize);
for (int i = 0; i < mapSize; i++) {
double angle1 = i*2*M_PI/mapSize;
double energy1 = cos(angle1);
for (int j = 0; j < mapSize; j++) {
double angle2 = j*2*M_PI/mapSize;
double energy2 = 10*sin(angle2);
mapEnergy1[i+j*mapSize] = energy1+energy2;
mapEnergy2[i+j*mapSize] = energy1-energy2;
}
}
cmap->addMap(mapSize, mapEnergy1);
cmap->addMap(mapSize, mapEnergy2);
cmap->addTorsion(0, 0, 1, 2, 3, 1, 2, 3, 4);
system.addForce(cmap);
// Set particle positions so angle1=0 and angle2=PI/4.
vector<Vec3> positions(5);
positions[0] = Vec3(0, 0, 1);
positions[1] = Vec3(0, 0, 0);
positions[2] = Vec3(1, 0, 0);
positions[3] = Vec3(1, 0, 1);
positions[4] = Vec3(0.5, -0.5, 1);
VerletIntegrator integrator(0.01);
Context context(system, integrator, platform);
context.setPositions(positions);
// Check that the energy is correct.
double energy = context.getState(State::Energy).getPotentialEnergy();
ASSERT_EQUAL_TOL(1+10*sin(M_PI/4), energy, 1e-5);
// Modify the parameters.
cmap->setTorsionParameters(0, 1, 0, 1, 2, 3, 1, 2, 3, 4);
for (int i = 0; i < mapSize*mapSize; i++)
mapEnergy2[i] *= 2.0;
cmap->setMapParameters(1, mapSize, mapEnergy2);
cmap->updateParametersInContext(context);
// See if the results are correct.
energy = context.getState(State::Energy).getPotentialEnergy();
ASSERT_EQUAL_TOL(2-20*sin(M_PI/4), energy, 1e-5);
}
int main() {
try {
testCMAPTorsions();
testChangingParameters();
}
catch(const exception& e) {
cout << "exception: " << e.what() << endl;
......
......@@ -49,6 +49,8 @@
using namespace OpenMM;
using namespace std;
ReferencePlatform platform;
Vec3 calcCM(const vector<Vec3>& values, System& system) {
Vec3 cm;
for (int j = 0; j < system.getNumParticles(); ++j) {
......@@ -63,7 +65,6 @@ void testMotionRemoval() {
const int numParticles = 8;
const double temp = 100.0;
const double collisionFreq = 10.0;
ReferencePlatform platform;
System system;
VerletIntegrator integrator(0.01);
HarmonicBondForce* bonds = new HarmonicBondForce();
......
......@@ -48,6 +48,8 @@
using namespace OpenMM;
using namespace std;
ReferencePlatform platform;
const double TOL = 1e-5;
void compareStates(State& s1, State& s2) {
......@@ -71,7 +73,6 @@ void testCheckpoint() {
const int numParticles = 10;
const double boxSize = 3.0;
const double temperature = 200.0;
ReferencePlatform platform;
System system;
system.addForce(new AndersenThermostat(0.0, 100.0));
NonbondedForce* nonbonded = new NonbondedForce();
......@@ -125,7 +126,6 @@ void testSetState() {
const int numParticles = 10;
const double boxSize = 3.0;
const double temperature = 200.0;
ReferencePlatform platform;
System system;
system.addForce(new AndersenThermostat(0.0, 100.0));
NonbondedForce* nonbonded = new NonbondedForce();
......
......@@ -47,11 +47,11 @@
using namespace OpenMM;
using namespace std;
ReferencePlatform platform;
const double TOL = 1e-5;
void testAngles() {
ReferencePlatform platform;
// Create a system using a CustomAngleForce.
System customSystem;
......
......@@ -46,10 +46,11 @@
using namespace OpenMM;
using namespace std;
ReferencePlatform platform;
const double TOL = 1e-5;
void testBonds() {
ReferencePlatform platform;
System system;
system.addParticle(1.0);
system.addParticle(1.0);
......
......@@ -52,11 +52,11 @@
using namespace OpenMM;
using namespace std;
ReferencePlatform platform;
const double TOL = 1e-5;
void testBond() {
ReferencePlatform platform;
// Create a system using a CustomCompoundBondForce.
System customSystem;
......@@ -147,7 +147,6 @@ void testBond() {
}
void testPositionDependence() {
ReferencePlatform platform;
System customSystem;
customSystem.addParticle(1.0);
customSystem.addParticle(1.0);
......@@ -179,7 +178,6 @@ void testContinuous2DFunction() {
const double xmax = 1.1;
const double ymin = 0.0;
const double ymax = 0.9;
ReferencePlatform platform;
System system;
system.addParticle(1.0);
VerletIntegrator integrator(0.01);
......@@ -227,7 +225,6 @@ void testContinuous3DFunction() {
const double ymax = 0.9;
const double zmin = 0.2;
const double zmax = 1.3;
ReferencePlatform platform;
System system;
system.addParticle(1.0);
VerletIntegrator integrator(0.01);
......@@ -273,7 +270,6 @@ void testContinuous3DFunction() {
void testMultipleBonds() {
// Two compound bonds using Urey-Bradley example from API doc
ReferencePlatform platform;
System customSystem;
customSystem.addParticle(1.0);
customSystem.addParticle(1.0);
......
......@@ -46,10 +46,11 @@
using namespace OpenMM;
using namespace std;
ReferencePlatform platform;
const double TOL = 1e-5;
void testForce() {
ReferencePlatform platform;
System system;
system.addParticle(1.0);
system.addParticle(1.0);
......
......@@ -51,6 +51,8 @@
using namespace OpenMM;
using namespace std;
ReferencePlatform platform;
const double TOL = 1e-5;
void testOBC(GBSAOBCForce::NonbondedMethod obcMethod, CustomGBForce::NonbondedMethod customMethod) {
......@@ -58,7 +60,6 @@ void testOBC(GBSAOBCForce::NonbondedMethod obcMethod, CustomGBForce::NonbondedMe
const int numParticles = numMolecules*2;
const double boxSize = 10.0;
const double cutoff = 2.0;
ReferencePlatform platform;
// Create two systems: one with a GBSAOBCForce, and one using a CustomGBForce to implement the same interaction.
......@@ -190,7 +191,6 @@ void testMembrane() {
const int numMolecules = 70;
const int numParticles = numMolecules*2;
const double boxSize = 10.0;
ReferencePlatform platform;
// Create a system with an implicit membrane.
......@@ -280,7 +280,6 @@ void testMembrane() {
}
void testTabulatedFunction() {
ReferencePlatform platform;
System system;
system.addParticle(1.0);
system.addParticle(1.0);
......@@ -313,7 +312,6 @@ void testTabulatedFunction() {
}
void testMultipleChainRules() {
ReferencePlatform platform;
System system;
system.addParticle(1.0);
system.addParticle(1.0);
......@@ -341,7 +339,6 @@ void testMultipleChainRules() {
}
void testPositionDependence() {
ReferencePlatform platform;
System system;
system.addParticle(1.0);
system.addParticle(1.0);
......@@ -405,7 +402,6 @@ void testPositionDependence() {
}
void testExclusions() {
ReferencePlatform platform;
for (int i = 3; i < 4; i++) {
System system;
system.addParticle(1.0);
......@@ -817,7 +813,6 @@ void testGBVI(GBVIForce::NonbondedMethod gbviMethod, CustomGBForce::NonbondedMet
const int numMolecules = 1;
const double boxSize = 10.0;
ReferencePlatform platform;
GBVIForce* gbvi = new GBVIForce();
std::vector<Vec3> positions;
......
......@@ -49,11 +49,11 @@
using namespace OpenMM;
using namespace std;
ReferencePlatform platform;
const double TOL = 1e-5;
void testHbond() {
ReferencePlatform platform;
// Create a system using a CustomHbondForce.
System customSystem;
......@@ -151,7 +151,6 @@ void testHbond() {
}
void testExclusions() {
ReferencePlatform platform;
System system;
system.addParticle(1.0);
system.addParticle(1.0);
......@@ -178,7 +177,6 @@ void testExclusions() {
}
void testCutoff() {
ReferencePlatform platform;
System system;
system.addParticle(1.0);
system.addParticle(1.0);
......@@ -206,7 +204,6 @@ void testCutoff() {
}
void testCustomFunctions() {
ReferencePlatform platform;
System system;
system.addParticle(1.0);
system.addParticle(1.0);
......
......@@ -49,13 +49,14 @@
using namespace OpenMM;
using namespace std;
ReferencePlatform platform;
const double TOL = 1e-5;
/**
* Test a simple leapfrog integrator on a single bond.
*/
void testSingleBond() {
ReferencePlatform platform;
System system;
system.addParticle(2.0);
system.addParticle(2.0);
......@@ -101,7 +102,6 @@ void testSingleBond() {
void testConstraints() {
const int numParticles = 8;
const double temp = 500.0;
ReferencePlatform platform;
System system;
CustomIntegrator integrator(0.002);
integrator.addPerDofVariable("oldx", 0);
......@@ -160,7 +160,6 @@ void testConstraints() {
*/
void testVelocityConstraints() {
const int numParticles = 10;
ReferencePlatform platform;
System system;
CustomIntegrator integrator(0.002);
integrator.addPerDofVariable("x1", 0);
......@@ -236,7 +235,6 @@ void testVelocityConstraints() {
}
void testConstrainedMasslessParticles() {
ReferencePlatform platform;
System system;
system.addParticle(0.0);
system.addParticle(1.0);
......@@ -282,7 +280,6 @@ void testWithThermostat() {
const double temp = 100.0;
const double collisionFreq = 10.0;
const int numSteps = 5000;
ReferencePlatform platform;
System system;
CustomIntegrator integrator(0.003);
integrator.addUpdateContextState();
......@@ -324,7 +321,6 @@ void testWithThermostat() {
* Test a Monte Carlo integrator that uses global variables and depends on energy.
*/
void testMonteCarlo() {
ReferencePlatform platform;
System system;
system.addParticle(1.0);
system.addParticle(1.0);
......@@ -379,7 +375,6 @@ void testMonteCarlo() {
void testSum() {
const int numParticles = 200;
const double boxSize = 10;
ReferencePlatform platform;
System system;
system.setDefaultPeriodicBoxVectors(Vec3(boxSize, 0, 0), Vec3(0, boxSize, 0), Vec3(0, 0, boxSize));
NonbondedForce* nb = new NonbondedForce();
......@@ -422,7 +417,6 @@ void testSum() {
* Test an integrator that both uses and modifies a context parameter.
*/
void testParameter() {
ReferencePlatform platform;
System system;
system.addParticle(1.0);
AndersenThermostat* thermostat = new AndersenThermostat(0.1, 0.1);
......@@ -448,7 +442,6 @@ void testRandomDistributions() {
const int numParticles = 100;
const int numBins = 20;
const int numSteps = 100;
ReferencePlatform platform;
System system;
for (int i = 0; i < numParticles; i++)
system.addParticle(1.0);
......@@ -516,7 +509,6 @@ void testRandomDistributions() {
void testPerDofVariables() {
const int numParticles = 200;
const double boxSize = 10;
ReferencePlatform platform;
System system;
system.setDefaultPeriodicBoxVectors(Vec3(boxSize, 0, 0), Vec3(0, boxSize, 0), Vec3(0, 0, boxSize));
NonbondedForce* nb = new NonbondedForce();
......@@ -571,7 +563,6 @@ void testPerDofVariables() {
* Test evaluating force groups separately.
*/
void testForceGroups() {
ReferencePlatform platform;
System system;
system.addParticle(2.0);
system.addParticle(2.0);
......@@ -647,7 +638,6 @@ void testForceGroups() {
*/
void testRespa() {
const int numParticles = 8;
ReferencePlatform platform;
System system;
system.setDefaultPeriodicBoxVectors(Vec3(4, 0, 0), Vec3(0, 4, 0), Vec3(0, 0, 4));
CustomIntegrator integrator(0.002);
......
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