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

Comparing branches/development/src/nonbonded/InteractionManager.cpp (file contents):
Revision 1531 by gezelter, Tue Dec 28 21:47:55 2010 UTC vs.
Revision 1532 by gezelter, Wed Dec 29 19:59:21 2010 UTC

# Line 58 | Line 58 | namespace OpenMD {
58    EAM* InteractionManager::eam_ = new EAM();
59    SC* InteractionManager::sc_ = new SC();
60    Electrostatic* InteractionManager::electrostatic_ = new Electrostatic();
61 +  MAW* InteractionManager::maw_ = new MAW();
62    SwitchingFunction* InteractionManager::switcher_ = new SwitchingFunction();
63  
64    InteractionManager* InteractionManager::Instance() {
# Line 76 | Line 77 | namespace OpenMD {
77      sc_->setForceField(forceField_);
78      morse_->setForceField(forceField_);
79      electrostatic_->setForceField(forceField_);
80 +    maw_->setForceField(forceField_);
81  
82      ForceFieldOptions& fopts = forceField_->getForceFieldOptions();
83      // Force fields can set options on how to scale van der Waals and electrostatic
# Line 231 | Line 233 | namespace OpenMD {
233            interactions_[key].insert(sc_);
234            metExplicit = true;
235          }
236 +
237 +        if (nbiType->isMAW()) {
238 +          if (vdwExplicit) {
239 +            sprintf( painCave.errMsg,
240 +                     "InteractionManager::initialize found more than one explicit\n"
241 +                     "\tvan der Waals interaction for atom types %s - %s\n",
242 +                     atype1->getName().c_str(), atype2->getName().c_str());
243 +            painCave.severity = OPENMD_ERROR;
244 +            painCave.isFatal = 1;
245 +            simError();
246 +          }
247 +          // We found an explicit MAW interaction.  
248 +          // override all other vdw entries for this pair of atom types:
249 +          set<NonBondedInteraction*>::iterator it;
250 +          for (it = interactions_[key].begin(); it != interactions_[key].end(); ++it) {
251 +            InteractionFamily ifam = (*it)->getFamily();
252 +            if (ifam == VANDERWAALS_FAMILY) interactions_[key].erase(*it);
253 +          }
254 +          interactions_[key].insert(maw_);
255 +          vdwExplicit = true;
256 +        }        
257        }
258      }
259      

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines