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

Comparing trunk/src/nonbonded/Morse.cpp (file contents):
Revision 2017 by gezelter, Tue Sep 2 18:31:44 2014 UTC vs.
Revision 2071 by gezelter, Sat Mar 7 21:41:51 2015 UTC

# Line 52 | Line 52 | namespace OpenMD {
52  
53   namespace OpenMD {
54  
55 <  Morse::Morse() : name_("Morse"), initialized_(false), forceField_(NULL) {}
55 >  Morse::Morse() : initialized_(false), forceField_(NULL), name_("Morse") {}
56    
57    void Morse::initialize() {    
58  
# Line 139 | Line 139 | namespace OpenMD {
139    void Morse::calcForce(InteractionData &idat) {
140  
141      if (!initialized_) initialize();
142 <    
142 >
143 >  
144      MorseInteractionData &mixer = MixingMap[Mtids[idat.atid1]][Mtids[idat.atid2]];
145  
146      RealType myPot = 0.0;
# Line 171 | Line 172 | namespace OpenMD {
172      
173      switch(variant) {
174      case mtShifted : {
174      
175        myPot  = De * (expfnc2  - 2.0 * expfnc);
176        myDeriv   = 2.0 * De * beta * (expfnc - expfnc2);
177        
# Line 190 | Line 190 | namespace OpenMD {
190        break;
191      }
192      case mtRepulsive : {
193        
193        myPot  = De * expfnc2;
194        myDeriv  = -2.0 * De * beta * expfnc2;
195        
# Line 214 | Line 213 | namespace OpenMD {
213      }
214      }
215      
217
216      RealType pot_temp = *(idat.vdwMult) * (myPot - myPotC);
217      *(idat.vpair) += pot_temp;
218      
219      RealType dudr = *(idat.sw) * *(idat.vdwMult) * (myDeriv - myDerivC);
222
220      
221      (*(idat.pot))[VANDERWAALS_FAMILY] += *(idat.sw) * pot_temp;
222      *(idat.f1) = *(idat.d) * dudr / *(idat.rij);
223 <    
223 >
224      return;    
225    }
226  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines