Commit 3bcd80b3 authored by Peter Eastman's avatar Peter Eastman
Browse files

Reduced size of PME grid, since it was being made unnecessarily large for the requested accuracy.

parent b41d77a9
...@@ -150,9 +150,9 @@ void NonbondedForceImpl::calcPMEParameters(const System& system, const Nonbonded ...@@ -150,9 +150,9 @@ void NonbondedForceImpl::calcPMEParameters(const System& system, const Nonbonded
system.getDefaultPeriodicBoxVectors(boxVectors[0], boxVectors[1], boxVectors[2]); system.getDefaultPeriodicBoxVectors(boxVectors[0], boxVectors[1], boxVectors[2]);
double tol = force.getEwaldErrorTolerance(); double tol = force.getEwaldErrorTolerance();
alpha = (1.0/force.getCutoffDistance())*std::sqrt(-log(2.0*tol)); alpha = (1.0/force.getCutoffDistance())*std::sqrt(-log(2.0*tol));
xsize = (int) ceil(alpha*boxVectors[0][0]/pow(0.5*tol, 0.2)); xsize = (int) ceil(2*alpha*boxVectors[0][0]/(3*pow(tol, 0.2)));
ysize = (int) ceil(alpha*boxVectors[1][1]/pow(0.5*tol, 0.2)); ysize = (int) ceil(2*alpha*boxVectors[1][1]/(3*pow(tol, 0.2)));
zsize = (int) ceil(alpha*boxVectors[2][2]/pow(0.5*tol, 0.2)); zsize = (int) ceil(2*alpha*boxVectors[2][2]/(3*pow(tol, 0.2)));
xsize = max(xsize, 5); xsize = max(xsize, 5);
ysize = max(ysize, 5); ysize = max(ysize, 5);
zsize = max(zsize, 5); zsize = max(zsize, 5);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for * * Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. * * Medical Research, grant U54 GM072970. See https://simtk.org. *
* * * *
* Portions copyright (c) 2008-2009 Stanford University and the Authors. * * Portions copyright (c) 2008-2010 Stanford University and the Authors. *
* Authors: Peter Eastman * * Authors: Peter Eastman *
* Contributors: * * Contributors: *
* * * *
...@@ -245,7 +245,7 @@ void testErrorTolerance(NonbondedForce::NonbondedMethod method) { ...@@ -245,7 +245,7 @@ void testErrorTolerance(NonbondedForce::NonbondedMethod method) {
diff += delta.dot(delta); diff += delta.dot(delta);
} }
diff = sqrt(diff)/norm; diff = sqrt(diff)/norm;
ASSERT(diff < 5*tol); ASSERT(diff < 2*tol);
} }
} }
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for * * Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. * * Medical Research, grant U54 GM072970. See https://simtk.org. *
* * * *
* Portions copyright (c) 2008-2009 Stanford University and the Authors. * * Portions copyright (c) 2008-2010 Stanford University and the Authors. *
* Authors: Peter Eastman * * Authors: Peter Eastman *
* Contributors: * * Contributors: *
* * * *
...@@ -244,7 +244,7 @@ void testErrorTolerance(NonbondedForce::NonbondedMethod method) { ...@@ -244,7 +244,7 @@ void testErrorTolerance(NonbondedForce::NonbondedMethod method) {
diff += delta.dot(delta); diff += delta.dot(delta);
} }
diff = sqrt(diff)/norm; diff = sqrt(diff)/norm;
ASSERT(diff < 5*tol); ASSERT(diff < 2*tol);
} }
} }
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for * * Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. * * Medical Research, grant U54 GM072970. See https://simtk.org. *
* * * *
* Portions copyright (c) 2008-2009 Stanford University and the Authors. * * Portions copyright (c) 2008-2010 Stanford University and the Authors. *
* Authors: Peter Eastman * * Authors: Peter Eastman *
* Contributors: * * Contributors: *
* * * *
...@@ -348,7 +348,7 @@ void testErrorTolerance(NonbondedForce::NonbondedMethod method) { ...@@ -348,7 +348,7 @@ void testErrorTolerance(NonbondedForce::NonbondedMethod method) {
diff += delta.dot(delta); diff += delta.dot(delta);
} }
diff = sqrt(diff)/norm; diff = sqrt(diff)/norm;
ASSERT(diff < 5*tol); ASSERT(diff < 2*tol);
} }
} }
} }
......
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