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 1582 by gezelter, Tue Jun 14 20:41:44 2011 UTC vs.
Revision 1665 by gezelter, Tue Nov 22 20:38:56 2011 UTC

# Line 36 | Line 36
36   * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).            
37   * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).          
38   * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).          
39 < * [4]  Vardeman & Gezelter, in progress (2009).                        
39 > * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40 > * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
42  
43   #include <stdio.h>
# Line 48 | Line 49 | namespace OpenMD {
49  
50   namespace OpenMD {
51  
52 <  LJ::LJ() : name_("LJ"), initialized_(false), shiftedPot_(false),
52 <             shiftedFrc_(false), forceField_(NULL) {}
52 >  LJ::LJ() : name_("LJ"), initialized_(false), forceField_(NULL) {}
53  
54    LJParam LJ::getLJParam(AtomType* atomType) {
55      
# Line 243 | Line 243 | namespace OpenMD {
243    void LJ::calcForce(InteractionData &idat) {
244      
245      if (!initialized_) initialize();
246 <    
246 >
247      map<pair<AtomType*, AtomType*>, LJInteractionData>::iterator it;
248      it = MixingMap.find( idat.atypes );
249      
# Line 265 | Line 265 | namespace OpenMD {
265        
266        getLJfunc(ros, myPot, myDeriv);
267        
268 <      if (shiftedPot_) {
268 >      if (idat.shiftedPot) {
269          rcos = *(idat.rcut) * sigmai;
270          getLJfunc(rcos, myPotC, myDerivC);
271          myDerivC = 0.0;
272 <      } else if (LJ::shiftedFrc_) {
272 >      } else if (idat.shiftedForce) {
273          rcos = *(idat.rcut) * sigmai;
274          getLJfunc(rcos, myPotC, myDerivC);
275          myPotC = myPotC + myDerivC * (*(idat.rij) - *(idat.rcut)) * sigmai;
# Line 283 | Line 283 | namespace OpenMD {
283        
284        RealType dudr = *(idat.sw) * *(idat.vdwMult) * epsilon * (myDeriv -
285                                                                  myDerivC)*sigmai;      
286 +
287        (*(idat.pot))[VANDERWAALS_FAMILY] += *(idat.sw) * pot_temp;
288 <      *(idat.f1) = *(idat.d) * dudr / *(idat.rij);
288 >      *(idat.f1) += *(idat.d) * dudr / *(idat.rij);
289      }
290      return;
291    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines