--- branches/development/src/parallel/ForceMatrixDecomposition.cpp 2012/07/27 17:34:10 1771 +++ trunk/src/parallel/ForceMatrixDecomposition.cpp 2012/08/31 21:16:10 1793 @@ -1295,7 +1295,6 @@ namespace OpenMD { #endif RealType rList_ = (largestRcut_ + skinThickness_); - RealType rl2 = rList_ * rList_; Snapshot* snap_ = sman_->getCurrentSnapshot(); Mat3x3d Hmat = snap_->getHmat(); Vector3d Hx = Hmat.getColumn(0); @@ -1339,6 +1338,10 @@ namespace OpenMD { for (int j = 0; j < 3; j++) { scaled[j] -= roundMe(scaled[j]); scaled[j] += 0.5; + // Handle the special case when an object is exactly on the + // boundary (a scaled coordinate of 1.0 is the same as + // scaled coordinate of 0.0) + if (scaled[j] >= 1.0) scaled[j] -= 1.0; } // find xyz-indices of cell that cutoffGroup is in. @@ -1363,6 +1366,10 @@ namespace OpenMD { for (int j = 0; j < 3; j++) { scaled[j] -= roundMe(scaled[j]); scaled[j] += 0.5; + // Handle the special case when an object is exactly on the + // boundary (a scaled coordinate of 1.0 is the same as + // scaled coordinate of 0.0) + if (scaled[j] >= 1.0) scaled[j] -= 1.0; } // find xyz-indices of cell that cutoffGroup is in.