ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/nonbonded/LJ.cpp
(Generate patch)

Comparing branches/development/src/nonbonded/LJ.cpp (file contents):
Revision 1549 by gezelter, Wed Apr 27 18:38:15 2011 UTC vs.
Revision 1554 by gezelter, Sat Apr 30 02:54:02 2011 UTC

# Line 245 | Line 245 | namespace OpenMD {
245      if (!initialized_) initialize();
246      
247      map<pair<AtomType*, AtomType*>, LJInteractionData>::iterator it;
248 <    it = MixingMap.find(idat.atypes);
248 >    it = MixingMap.find( *(idat.atypes) );
249      
250      if (it != MixingMap.end())  {
251        
# Line 261 | Line 261 | namespace OpenMD {
261        RealType myDeriv = 0.0;
262        RealType myDerivC = 0.0;
263      
264 <      ros = idat.rij * sigmai;
264 >      ros = *(idat.rij) * sigmai;
265        
266        getLJfunc(ros, myPot, myDeriv);
267        
268        if (shiftedPot_) {
269 <        rcos = idat.rcut * sigmai;
269 >        rcos = *(idat.rcut) * sigmai;
270          getLJfunc(rcos, myPotC, myDerivC);
271          myDerivC = 0.0;
272        } else if (LJ::shiftedFrc_) {
273 <        rcos = idat.rcut * sigmai;
273 >        rcos = *(idat.rcut) * sigmai;
274          getLJfunc(rcos, myPotC, myDerivC);
275 <        myPotC = myPotC + myDerivC * (idat.rij - idat.rcut) * sigmai;
275 >        myPotC = myPotC + myDerivC * (*(idat.rij) - *(idat.rcut)) * sigmai;
276        } else {
277          myPotC = 0.0;
278          myDerivC = 0.0;        
279        }
280  
281 <      RealType pot_temp = idat.vdwMult * epsilon * (myPot - myPotC);
282 <      idat.vpair += pot_temp;
281 >      RealType pot_temp = *(idat.vdwMult) * epsilon * (myPot - myPotC);
282 >      *(idat.vpair) += pot_temp;
283        
284 <      RealType dudr = idat.sw * idat.vdwMult * epsilon * (myDeriv -
285 <                                                          myDerivC)*sigmai;
284 >      RealType dudr = *(idat.sw) * *(idat.vdwMult) * epsilon * (myDeriv -
285 >                                                             myDerivC)*sigmai;
286        
287 <      idat.pot[0] += idat.sw * pot_temp;
288 <      idat.f1 = idat.d * dudr / idat.rij;      
287 >      (idat.pot)[VANDERWAALS_FAMILY] += *(idat.sw) * pot_temp;
288 >      *(idat.f1) = *(idat.d) * dudr / *(idat.rij);
289      }
290      return;
291    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines