--- branches/development/src/nonbonded/LJ.cpp 2010/10/03 22:18:59 1505 +++ branches/development/src/nonbonded/LJ.cpp 2011/05/27 16:45:44 1571 @@ -240,13 +240,12 @@ namespace OpenMD { } } - void LJ::calcForce(InteractionData idat) { + void LJ::calcForce(InteractionData &idat) { if (!initialized_) initialize(); - pair key = make_pair(idat.atype1, idat.atype2); map, LJInteractionData>::iterator it; - it = MixingMap.find(key); + it = MixingMap.find( idat.atypes ); if (it != MixingMap.end()) { @@ -262,32 +261,31 @@ namespace OpenMD { RealType myDeriv = 0.0; RealType myDerivC = 0.0; - ros = idat.rij * sigmai; + ros = *(idat.rij) * sigmai; getLJfunc(ros, myPot, myDeriv); if (shiftedPot_) { - rcos = idat.rcut * sigmai; + rcos = *(idat.rcut) * sigmai; getLJfunc(rcos, myPotC, myDerivC); myDerivC = 0.0; } else if (LJ::shiftedFrc_) { - rcos = idat.rcut * sigmai; + rcos = *(idat.rcut) * sigmai; getLJfunc(rcos, myPotC, myDerivC); - myPotC = myPotC + myDerivC * (idat.rij - idat.rcut) * sigmai; + myPotC = myPotC + myDerivC * (*(idat.rij) - *(idat.rcut)) * sigmai; } else { myPotC = 0.0; myDerivC = 0.0; } - RealType pot_temp = idat.vdwMult * epsilon * (myPot - myPotC); - idat.vpair += pot_temp; - - RealType dudr = idat.sw * idat.vdwMult * epsilon * (myDeriv - - myDerivC)*sigmai; + RealType pot_temp = *(idat.vdwMult) * epsilon * (myPot - myPotC); + *(idat.vpair) += pot_temp; - idat.pot += idat.sw * pot_temp; - idat.f1 = idat.d * dudr / idat.rij; + RealType dudr = *(idat.sw) * *(idat.vdwMult) * epsilon * (myDeriv - + myDerivC)*sigmai; + (idat.pot)[VANDERWAALS_FAMILY] += *(idat.sw) * pot_temp; + *(idat.f1) = *(idat.d) * dudr / *(idat.rij); } return; } @@ -307,11 +305,10 @@ namespace OpenMD { return; } - RealType LJ::getSuggestedCutoffRadius(AtomType* at1, AtomType* at2) { + RealType LJ::getSuggestedCutoffRadius(pair atypes) { if (!initialized_) initialize(); - pair key = make_pair(at1, at2); map, LJInteractionData>::iterator it; - it = MixingMap.find(key); + it = MixingMap.find(atypes); if (it == MixingMap.end()) return 0.0; else {