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 1581 by gezelter, Mon Jun 13 22:13:12 2011 UTC vs.
Revision 1629 by gezelter, Wed Sep 14 21:15:17 2011 UTC

# Line 48 | Line 48 | namespace OpenMD {
48  
49   namespace OpenMD {
50  
51 <  LJ::LJ() : name_("LJ"), initialized_(false), shiftedPot_(false),
52 <             shiftedFrc_(false), forceField_(NULL) {}
51 >  LJ::LJ() : name_("LJ"), initialized_(false), forceField_(NULL) {}
52  
53    LJParam LJ::getLJParam(AtomType* atomType) {
54      
# Line 243 | Line 242 | namespace OpenMD {
242    void LJ::calcForce(InteractionData &idat) {
243      
244      if (!initialized_) initialize();
245 <    
245 >
246      map<pair<AtomType*, AtomType*>, LJInteractionData>::iterator it;
247      it = MixingMap.find( idat.atypes );
248      
# Line 261 | Line 260 | namespace OpenMD {
260        RealType myDeriv = 0.0;
261        RealType myDerivC = 0.0;
262      
263 <      ros = *(idat.rij) * sigmai;
265 <      
266 <      cerr << "ros = " << ros << "\n";
263 >      ros = *(idat.rij) * sigmai;    
264        
265        getLJfunc(ros, myPot, myDeriv);
266        
267 <      if (shiftedPot_) {
267 >      if (idat.shiftedPot) {
268          rcos = *(idat.rcut) * sigmai;
269          getLJfunc(rcos, myPotC, myDerivC);
270          myDerivC = 0.0;
271 <      } else if (LJ::shiftedFrc_) {
271 >      } else if (idat.shiftedForce) {
272          rcos = *(idat.rcut) * sigmai;
273          getLJfunc(rcos, myPotC, myDerivC);
274          myPotC = myPotC + myDerivC * (*(idat.rij) - *(idat.rcut)) * sigmai;
# Line 280 | Line 277 | namespace OpenMD {
277          myDerivC = 0.0;        
278        }
279  
283      cerr << "myPot =  " << myPot << "\n";
284      cerr << "myPotC =  " << myPotC << "\n";
285      cerr << "myDerivC = " << myDerivC << "\n";
286      cerr << "epsilon =  " << epsilon << "\n";
287      cerr << "vdwm =  " << *(idat.vdwMult) << "\n";
288      cerr << "sw = " << *(idat.sw) << "\n";
280        RealType pot_temp = *(idat.vdwMult) * epsilon * (myPot - myPotC);
281        *(idat.vpair) += pot_temp;
282        
283        RealType dudr = *(idat.sw) * *(idat.vdwMult) * epsilon * (myDeriv -
284 <                                                                myDerivC)*sigmai;
285 <      
286 <      (idat.pot)[VANDERWAALS_FAMILY] += *(idat.sw) * pot_temp;
287 <      *(idat.f1) = *(idat.d) * dudr / *(idat.rij);
284 >                                                                myDerivC)*sigmai;      
285 >
286 >      (*(idat.pot))[VANDERWAALS_FAMILY] += *(idat.sw) * pot_temp;
287 >      *(idat.f1) += *(idat.d) * dudr / *(idat.rij);
288      }
289      return;
290    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines