--- trunk/src/brains/ForceManager.cpp 2013/06/16 15:15:42 1879 +++ 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; @@ -705,15 +705,16 @@ namespace OpenMD { RealType vpair; RealType dVdFQ1(0.0); RealType dVdFQ2(0.0); - Vector3d eField1(0.0); - Vector3d eField2(0.0); potVec longRangePotential(0.0); potVec workPot(0.0); potVec exPot(0.0); + Vector3d eField1(0.0); + Vector3d eField2(0.0); 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(); @@ -918,7 +919,7 @@ namespace OpenMD { } } } - + // collects pairwise information fDecomp_->collectData();