--- branches/development/src/nonbonded/LJ.cpp 2011/01/05 14:49:05 1536 +++ branches/development/src/nonbonded/LJ.cpp 2011/06/09 20:26:29 1579 @@ -244,9 +244,8 @@ namespace OpenMD { 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,31 +261,37 @@ namespace OpenMD { RealType myDeriv = 0.0; RealType myDerivC = 0.0; - ros = idat.rij * sigmai; + ros = *(idat.rij) * sigmai; + + cerr << "ros = " << ros << "\n"; 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[0] += pot_temp; - - RealType dudr = idat.sw * idat.vdwMult * epsilon * (myDeriv - - myDerivC)*sigmai; + cerr << "myPot = " << myPot << "\n"; + cerr << "myPotC = " << myPotC << "\n"; + cerr << "epsilon = " << epsilon << "\n"; + cerr << "vdwm = " << *(idat.vdwMult) << "\n"; + RealType pot_temp = *(idat.vdwMult) * epsilon * (myPot - myPotC); + *(idat.vpair) += pot_temp; - idat.pot[0] += 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; } @@ -306,11 +311,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 {