| 310 |  |  | 
| 311 |  | RealType tol = 1e-6; | 
| 312 |  | largestRcut_ = 0.0; | 
| 313 | – | RealType rc; | 
| 313 |  | int atid; | 
| 314 |  | set<AtomType*> atypes = info_->getSimulatedAtomTypes(); | 
| 315 |  |  | 
| 394 |  | } | 
| 395 |  |  | 
| 396 |  | bool gTypeFound = false; | 
| 397 | < | for (int gt = 0; gt < gTypeCutoffs.size(); gt++) { | 
| 397 | > | for (unsigned int gt = 0; gt < gTypeCutoffs.size(); gt++) { | 
| 398 |  | if (abs(groupCutoff[cg1] - gTypeCutoffs[gt]) < tol) { | 
| 399 |  | groupToGtype[cg1] = gt; | 
| 400 |  | gTypeFound = true; | 
| 419 |  |  | 
| 420 |  | RealType tradRcut = groupMax; | 
| 421 |  |  | 
| 422 | < | for (int i = 0; i < gTypeCutoffs.size();  i++) { | 
| 423 | < | for (int j = 0; j < gTypeCutoffs.size();  j++) { | 
| 422 | > | for (unsigned int i = 0; i < gTypeCutoffs.size();  i++) { | 
| 423 | > | for (unsigned int j = 0; j < gTypeCutoffs.size();  j++) { | 
| 424 |  | RealType thisRcut; | 
| 425 |  | switch(cutoffPolicy_) { | 
| 426 |  | case TRADITIONAL: | 
| 476 |  | } | 
| 477 |  |  | 
| 478 |  | int ForceMatrixDecomposition::getTopologicalDistance(int atom1, int atom2) { | 
| 479 | < | for (int j = 0; j < toposForAtom[atom1].size(); j++) { | 
| 479 | > | for (unsigned int j = 0; j < toposForAtom[atom1].size(); j++) { | 
| 480 |  | if (toposForAtom[atom1][j] == atom2) | 
| 481 |  | return topoDist[atom1][j]; | 
| 482 |  | } | 
| 487 |  | pairwisePot = 0.0; | 
| 488 |  | embeddingPot = 0.0; | 
| 489 |  | excludedPot = 0.0; | 
| 490 | + | excludedSelfPot = 0.0; | 
| 491 |  |  | 
| 492 |  | #ifdef IS_MPI | 
| 493 |  | if (storageLayout_ & DataStorage::dslForce) { | 
| 907 |  | MPI::COMM_WORLD.Allreduce(&ploc1, &ploc2, 1, MPI::REALTYPE, MPI::SUM); | 
| 908 |  | embeddingPot[ii] = ploc2; | 
| 909 |  | } | 
| 910 | + | for (int ii = 0; ii < N_INTERACTION_FAMILIES; ii++) { | 
| 911 | + | RealType ploc1 = excludedSelfPot[ii]; | 
| 912 | + | RealType ploc2 = 0.0; | 
| 913 | + | MPI::COMM_WORLD.Allreduce(&ploc1, &ploc2, 1, MPI::REALTYPE, MPI::SUM); | 
| 914 | + | excludedSelfPot[ii] = ploc2; | 
| 915 | + | } | 
| 916 |  | #endif | 
| 917 |  |  | 
| 918 |  | } | 
| 1042 |  | * the parallel decomposition. | 
| 1043 |  | */ | 
| 1044 |  | bool ForceMatrixDecomposition::skipAtomPair(int atom1, int atom2, int cg1, int cg2) { | 
| 1045 | < | int unique_id_1, unique_id_2, group1, group2; | 
| 1045 | > | int unique_id_1, unique_id_2; | 
| 1046 |  |  | 
| 1047 |  | #ifdef IS_MPI | 
| 1048 |  | // in MPI, we have to look up the unique IDs for each atom | 
| 1049 |  | unique_id_1 = AtomRowToGlobal[atom1]; | 
| 1050 |  | unique_id_2 = AtomColToGlobal[atom2]; | 
| 1051 | < | group1 = cgRowToGlobal[cg1]; | 
| 1052 | < | group2 = cgColToGlobal[cg2]; | 
| 1051 | > | // group1 = cgRowToGlobal[cg1]; | 
| 1052 | > | // group2 = cgColToGlobal[cg2]; | 
| 1053 |  | #else | 
| 1054 |  | unique_id_1 = AtomLocalToGlobal[atom1]; | 
| 1055 |  | unique_id_2 = AtomLocalToGlobal[atom2]; | 
| 1056 | < | group1 = cgLocalToGlobal[cg1]; | 
| 1057 | < | group2 = cgLocalToGlobal[cg2]; | 
| 1056 | > | int group1 = cgLocalToGlobal[cg1]; | 
| 1057 | > | int group2 = cgLocalToGlobal[cg2]; | 
| 1058 |  | #endif | 
| 1059 |  |  | 
| 1060 |  | if (unique_id_1 == unique_id_2) return true; | 
| 1295 |  | #endif | 
| 1296 |  |  | 
| 1297 |  | RealType rList_ = (largestRcut_ + skinThickness_); | 
| 1292 | – | RealType rl2 = rList_ * rList_; | 
| 1298 |  | Snapshot* snap_ = sman_->getCurrentSnapshot(); | 
| 1299 |  | Mat3x3d Hmat = snap_->getHmat(); | 
| 1300 |  | Vector3d Hx = Hmat.getColumn(0); | 
| 1338 |  | for (int j = 0; j < 3; j++) { | 
| 1339 |  | scaled[j] -= roundMe(scaled[j]); | 
| 1340 |  | scaled[j] += 0.5; | 
| 1341 | + | // Handle the special case when an object is exactly on the | 
| 1342 | + | // boundary (a scaled coordinate of 1.0 is the same as | 
| 1343 | + | // scaled coordinate of 0.0) | 
| 1344 | + | if (scaled[j] >= 1.0) scaled[j] -= 1.0; | 
| 1345 |  | } | 
| 1346 |  |  | 
| 1347 |  | // find xyz-indices of cell that cutoffGroup is in. | 
| 1366 |  | for (int j = 0; j < 3; j++) { | 
| 1367 |  | scaled[j] -= roundMe(scaled[j]); | 
| 1368 |  | scaled[j] += 0.5; | 
| 1369 | + | // Handle the special case when an object is exactly on the | 
| 1370 | + | // boundary (a scaled coordinate of 1.0 is the same as | 
| 1371 | + | // scaled coordinate of 0.0) | 
| 1372 | + | if (scaled[j] >= 1.0) scaled[j] -= 1.0; | 
| 1373 |  | } | 
| 1374 |  |  | 
| 1375 |  | // find xyz-indices of cell that cutoffGroup is in. | 
| 1396 |  | for (int j = 0; j < 3; j++) { | 
| 1397 |  | scaled[j] -= roundMe(scaled[j]); | 
| 1398 |  | scaled[j] += 0.5; | 
| 1399 | + | // Handle the special case when an object is exactly on the | 
| 1400 | + | // boundary (a scaled coordinate of 1.0 is the same as | 
| 1401 | + | // scaled coordinate of 0.0) | 
| 1402 | + | if (scaled[j] >= 1.0) scaled[j] -= 1.0; | 
| 1403 |  | } | 
| 1404 |  |  | 
| 1405 |  | // find xyz-indices of cell that cutoffGroup is in. |