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 1583 by gezelter, Thu Jun 16 22:00:08 2011 UTC vs.
Revision 1587 by gezelter, Fri Jul 8 20:25:32 2011 UTC

# Line 67 | Line 67 | namespace OpenMD {
67      eam_->setForceField(forceField_);
68      sc_->setForceField(forceField_);
69      morse_->setForceField(forceField_);
70 +    electrostatic_->setSimInfo(info_);
71      electrostatic_->setForceField(forceField_);
72      maw_->setForceField(forceField_);
73  
# Line 267 | Line 268 | namespace OpenMD {
268      }
269  
270      initialized_ = true;
271 +  }
272 +
273 +  void InteractionManager::setCutoffRadius(RealType rcut) {
274 +    
275 +    electrostatic_->setCutoffRadius(rcut);
276 +    eam_->setCutoffRadius(rcut);
277 +  }
278 +
279 +  void InteractionManager::setSwitchingRadius(RealType rswitch) {
280 +    electrostatic_->setSwitchingRadius(rswitch);
281    }
282    
283    void InteractionManager::doPrePair(InteractionData idat){
284      
285      if (!initialized_) initialize();
286          
287 +    // excluded interaction, so just return
288 +    if (idat.excluded) return;
289 +
290      set<NonBondedInteraction*>::iterator it;
291  
292      for (it = interactions_[ idat.atypes ].begin();
# Line 304 | Line 318 | namespace OpenMD {
318    void InteractionManager::doPair(InteractionData idat){
319      
320      if (!initialized_) initialize();
307  
308    set<NonBondedInteraction*>::iterator it;
321  
310    for (it = interactions_[ idat.atypes ].begin();
311         it != interactions_[ idat.atypes ].end(); ++it)
312      (*it)->calcForce(idat);
313    
314    return;    
315  }
316
317  void InteractionManager::doSkipCorrection(InteractionData idat){
318
319    if (!initialized_) initialize();  
320    
322      set<NonBondedInteraction*>::iterator it;
323  
324      for (it = interactions_[ idat.atypes ].begin();
325 <         it != interactions_[ idat.atypes ].end(); ++it){
326 <      if ((*it)->getFamily() == ELECTROSTATIC_FAMILY) {
327 <        dynamic_cast<ElectrostaticInteraction*>(*it)->calcSkipCorrection(idat);
325 >         it != interactions_[ idat.atypes ].end(); ++it) {
326 >
327 >      // electrostatics still has to worry about indirect
328 >      // contributions from excluded pairs of atoms:
329 >
330 >      if (!idat.excluded || (*it)->getFamily() == ELECTROSTATIC_FAMILY) {
331 >        (*it)->calcForce(idat);
332        }
333      }
334      

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines