--- branches/development/src/parallel/ForceMatrixDecomposition.cpp 2012/07/06 22:01:58 1767 +++ trunk/src/parallel/ForceMatrixDecomposition.cpp 2012/09/10 18:38:44 1796 @@ -1042,19 +1042,19 @@ namespace OpenMD { * the parallel decomposition. */ bool ForceMatrixDecomposition::skipAtomPair(int atom1, int atom2, int cg1, int cg2) { - int unique_id_1, unique_id_2, group1, group2; + int unique_id_1, unique_id_2; #ifdef IS_MPI // in MPI, we have to look up the unique IDs for each atom unique_id_1 = AtomRowToGlobal[atom1]; unique_id_2 = AtomColToGlobal[atom2]; - group1 = cgRowToGlobal[cg1]; - group2 = cgColToGlobal[cg2]; + // group1 = cgRowToGlobal[cg1]; + // group2 = cgColToGlobal[cg2]; #else unique_id_1 = AtomLocalToGlobal[atom1]; unique_id_2 = AtomLocalToGlobal[atom2]; - group1 = cgLocalToGlobal[cg1]; - group2 = cgLocalToGlobal[cg2]; + int group1 = cgLocalToGlobal[cg1]; + int group2 = cgLocalToGlobal[cg2]; #endif if (unique_id_1 == unique_id_2) return true; @@ -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. @@ -1389,6 +1396,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.