"plugins/drude/openmmapi/src/DrudeSCFIntegrator.cpp" did not exist on "74a8266f4fbe2ac74c41ef84b47b57245e729020"
Commit 94a151b1 authored by Peter Eastman's avatar Peter Eastman
Browse files

Fixed a problem with numerical precision that sometimes prevented SHAKE clusters being recognized

parent 9e83ef09
......@@ -50,7 +50,7 @@ struct OpenCLIntegrationUtilities::ShakeCluster {
ShakeCluster(int centralID, double invMass) : centralID(centralID), centralInvMass(invMass), size(0), valid(true) {
}
void addAtom(int id, double dist, double invMass) {
if (size == 3 || (size > 0 && dist != distance) || (size > 0 && invMass != peripheralInvMass))
if (size == 3 || (size > 0 && abs(dist-distance)/distance > 1e-8) || (size > 0 && abs(invMass-peripheralInvMass)/peripheralInvMass > 1e-8))
valid = false;
else {
peripheralID[size++] = id;
......
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