--- trunk/src/brains/ForceManager.cpp 2013/06/17 18:28:30 1880 +++ trunk/src/brains/ForceManager.cpp 2013/07/02 20:02:31 1896 @@ -695,7 +695,7 @@ namespace OpenMD { RealType vij; Vector3d fij, fg, f1; tuple3 cuts; - RealType rCutSq; + RealType rCut, rCutSq, rListSq; bool in_switching_region; RealType sw, dswdr, swderiv; vector atomListColumn, atomListRow; @@ -713,7 +713,8 @@ namespace OpenMD { vector::iterator ia, jb; int loopStart, loopEnd; - + + idat.rcut = &rCut; idat.vdwMult = &vdwMult; idat.electroMult = &electroMult; idat.pot = &workPot; @@ -746,26 +747,26 @@ namespace OpenMD { if (update_nlist) { if (!usePeriodicBoundaryConditions_) Mat3x3d bbox = thermo->getBoundingBox(); - neighborList = fDecomp_->buildNeighborList(); + fDecomp_->buildNeighborList(neighborList_); } } - for (vector >::iterator it = neighborList.begin(); - it != neighborList.end(); ++it) { + for (vector >::iterator it = neighborList_.begin(); + it != neighborList_.end(); ++it) { cg1 = (*it).first; cg2 = (*it).second; - cuts = fDecomp_->getGroupCutoffs(cg1, cg2); + fDecomp_->getGroupCutoffs(cg1, cg2, rCut, rCutSq, rListSq); d_grp = fDecomp_->getIntergroupVector(cg1, cg2); - curSnapshot->wrapVector(d_grp); + // already wrapped in the getIntergroupVector call: + // curSnapshot->wrapVector(d_grp); rgrpsq = d_grp.lengthSquare(); - rCutSq = cuts.second; if (rgrpsq < rCutSq) { - idat.rcut = &cuts.first; + if (iLoop == PAIR_LOOP) { vij = 0.0; fij.zero();