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

Comparing branches/development/src/nonbonded/SC.cpp (file contents):
Revision 1710 by gezelter, Fri May 18 21:44:02 2012 UTC vs.
Revision 1868 by gezelter, Tue Apr 30 15:56:54 2013 UTC

# Line 35 | Line 35
35   *                                                                      
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).          
38 > * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).          
39   * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40   * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
# Line 54 | Line 54 | namespace OpenMD {
54    SC::SC() : name_("SC"), initialized_(false), forceField_(NULL),
55               scRcut_(0.0), np_(3000) {}
56    
57 +  SC::~SC() {
58 +    initialized_ = false;
59 +
60 +    map<pair<AtomType*, AtomType*>, SCInteractionData>::iterator it;
61 +    for (it = MixingMap.begin(); it != MixingMap.end(); ++it) {
62 +      SCInteractionData mixer = (*it).second;
63 +      delete mixer.V;
64 +      delete mixer.phi;
65 +    }
66 +
67 +    MixingMap.clear();
68 +    SCMap.clear();
69 +    SClist.clear();
70 +  }
71 +        
72    RealType SC::getM(AtomType* atomType1, AtomType* atomType2) {    
73      SuttonChenAdapter sca1 = SuttonChenAdapter(atomType1);
74      SuttonChenAdapter sca2 = SuttonChenAdapter(atomType2);
# Line 278 | Line 293 | namespace OpenMD {
293      *(sdat.dfrhodrho) = 0.5 * *(sdat.frho) / *(sdat.rho);
294  
295      (*(sdat.pot))[METALLIC_FAMILY] += u;
296 <    *(sdat.particlePot) += u;
297 <    
296 >    if (sdat.doParticlePot) {
297 >      *(sdat.particlePot) += u;
298 >    }
299 >
300      return;
301    }
302    
# Line 315 | Line 332 | namespace OpenMD {
332        
333        *(idat.f1) += *(idat.d) * dudr / *(idat.rij) ;
334          
335 <      // particlePot is the difference between the full potential and
336 <      // the full potential without the presence of a particular
337 <      // particle (atom1).
338 <      //
339 <      // This reduces the density at other particle locations, so we
340 <      // need to recompute the density at atom2 assuming atom1 didn't
341 <      // contribute.  This then requires recomputing the density
342 <      // functional for atom2 as well.
343 <          
344 <      *(idat.particlePot1) -= data2.c * data2.epsilon *
345 <        sqrt( *(idat.rho2) - rhtmp) + *(idat.frho2);
335 >      if (idat.doParticlePot) {
336 >        // particlePot is the difference between the full potential and
337 >        // the full potential without the presence of a particular
338 >        // particle (atom1).
339 >        //
340 >        // This reduces the density at other particle locations, so we
341 >        // need to recompute the density at atom2 assuming atom1 didn't
342 >        // contribute.  This then requires recomputing the density
343 >        // functional for atom2 as well.
344 >        
345 >        *(idat.particlePot1) -= data2.c * data2.epsilon *
346 >          sqrt( *(idat.rho2) - rhtmp) + *(idat.frho2);
347  
348 <      *(idat.particlePot2) -= data1.c * data1.epsilon *
349 <        sqrt( *(idat.rho1) - rhtmp) + *(idat.frho1);
348 >        *(idat.particlePot2) -= data1.c * data1.epsilon *
349 >          sqrt( *(idat.rho1) - rhtmp) + *(idat.frho1);
350 >      }
351        
352        (*(idat.pot))[METALLIC_FAMILY] += pot_temp;
353      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines