Commit 15811b7c authored by Peter Eastman's avatar Peter Eastman
Browse files

Periodic box size is specified by System rather than NonbondedForce

parent 77f2d93b
...@@ -101,7 +101,7 @@ void testCutoffAndPeriodic() { ...@@ -101,7 +101,7 @@ void testCutoffAndPeriodic() {
const double cutoffDistance = 3.0; const double cutoffDistance = 3.0;
const double boxSize = 10.0; const double boxSize = 10.0;
nonbonded->setCutoffDistance(cutoffDistance); nonbonded->setCutoffDistance(cutoffDistance);
nonbonded->setPeriodicBoxVectors(Vec3(boxSize, 0, 0), Vec3(0, boxSize, 0), Vec3(0, 0, boxSize)); system.setPeriodicBoxVectors(Vec3(boxSize, 0, 0), Vec3(0, boxSize, 0), Vec3(0, 0, boxSize));
system.addForce(gbsa); system.addForce(gbsa);
system.addForce(nonbonded); system.addForce(nonbonded);
vector<Vec3> positions(2); vector<Vec3> positions(2);
......
...@@ -335,7 +335,7 @@ void testPeriodic() { ...@@ -335,7 +335,7 @@ void testPeriodic() {
nonbonded->setNonbondedMethod(NonbondedForce::CutoffPeriodic); nonbonded->setNonbondedMethod(NonbondedForce::CutoffPeriodic);
const double cutoff = 2.0; const double cutoff = 2.0;
nonbonded->setCutoffDistance(cutoff); nonbonded->setCutoffDistance(cutoff);
nonbonded->setPeriodicBoxVectors(Vec3(4, 0, 0), Vec3(0, 4, 0), Vec3(0, 0, 4)); system.setPeriodicBoxVectors(Vec3(4, 0, 0), Vec3(0, 4, 0), Vec3(0, 0, 4));
system.addForce(nonbonded); system.addForce(nonbonded);
Context context(system, integrator, platform); Context context(system, integrator, platform);
vector<Vec3> positions(3); vector<Vec3> positions(3);
...@@ -368,7 +368,7 @@ void testEwald() { ...@@ -368,7 +368,7 @@ void testEwald() {
const double cutoff = 2.0; const double cutoff = 2.0;
nonbonded->setCutoffDistance(cutoff); nonbonded->setCutoffDistance(cutoff);
nonbonded->setEwaldErrorTolerance(TOL); nonbonded->setEwaldErrorTolerance(TOL);
nonbonded->setPeriodicBoxVectors(Vec3(6, 0, 0), Vec3(0, 6, 0), Vec3(0, 0, 6)); system.setPeriodicBoxVectors(Vec3(6, 0, 0), Vec3(0, 6, 0), Vec3(0, 0, 6));
system.addForce(nonbonded); system.addForce(nonbonded);
Context context(system, integrator, platform); Context context(system, integrator, platform);
vector<Vec3> positions(2); vector<Vec3> positions(2);
......
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