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

Comparing branches/development/src/nonbonded/MAW.cpp (file contents):
Revision 1554 by gezelter, Sat Apr 30 02:54:02 2011 UTC vs.
Revision 1583 by gezelter, Thu Jun 16 22:00:08 2011 UTC

# Line 50 | Line 50 | namespace OpenMD {
50  
51   namespace OpenMD {
52  
53 <  MAW::MAW() : name_("MAW"), initialized_(false), forceField_(NULL),
54 <                   shiftedPot_(false), shiftedFrc_(false) {}
53 >  MAW::MAW() : name_("MAW"), initialized_(false), forceField_(NULL) {}
54    
55    void MAW::initialize() {    
56  
# Line 129 | Line 128 | namespace OpenMD {
128      if (!initialized_) initialize();
129      
130      map<pair<AtomType*, AtomType*>, MAWInteractionData>::iterator it;
131 <    it = MixingMap.find( *(idat.atypes) );
131 >    it = MixingMap.find( idat.atypes );
132      if (it != MixingMap.end()) {
133        MAWInteractionData mixer = (*it).second;
134        
# Line 144 | Line 143 | namespace OpenMD {
143        RealType ca1 = mixer.ca1;
144        RealType cb1 = mixer.cb1;
145  
146 <      bool j_is_Metal = idat.atypes->second->isMetal();
146 >      bool j_is_Metal = idat.atypes.second->isMetal();
147  
148        Vector3d r;
149        RotMat3x3d Atrans;
# Line 172 | Line 171 | namespace OpenMD {
171        myPot  = D_e * (expfnc2  - 2.0 * expfnc);
172        myDeriv   = 2.0 * D_e * beta * (expfnc - expfnc2);
173        
174 <      if (MAW::shiftedPot_ || MAW::shiftedFrc_) {
174 >      if (idat.shiftedPot || idat.shiftedForce) {
175          exptC     = -beta*( *(idat.rcut)  - R_e);
176          expfncC   = exp(exptC);
177          expfnc2C  = expfncC*expfncC;
178        }
179        
180 <      if (MAW::shiftedPot_) {
180 >      if (idat.shiftedPot) {
181          myPotC = D_e * (expfnc2C - 2.0 * expfncC);
182          myDerivC = 0.0;
183 <      } else if (MAW::shiftedFrc_) {
183 >      } else if (idat.shiftedForce) {
184          myPotC = D_e * (expfnc2C - 2.0 * expfncC);
185          myDerivC  = 2.0 * D_e * beta * (expfnc2C - expfnc2C);
186          myPotC += myDerivC * ( *(idat.rij)  -  *(idat.rcut) );
# Line 221 | Line 220 | namespace OpenMD {
220        
221        RealType pot_temp = *(idat.vdwMult) * Vmorse * Vang;
222        *(idat.vpair) += pot_temp;
223 <      idat.pot[VANDERWAALS_FAMILY] += *(idat.sw) * pot_temp;
223 >      (*(idat.pot))[VANDERWAALS_FAMILY] += *(idat.sw) * pot_temp;
224            
225        Vector3d dVmorsedr = (myDeriv - myDerivC) * Vector3d(x, y, z) /  *(idat.rij) ;
226        

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines