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 1584 by gezelter, Fri Jun 17 20:16:35 2011 UTC vs.
Revision 1587 by gezelter, Fri Jul 8 20:25:32 2011 UTC

# Line 271 | Line 271 | namespace OpenMD {
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) {
# Line 282 | Line 284 | namespace OpenMD {
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 313 | Line 318 | namespace OpenMD {
318    void InteractionManager::doPair(InteractionData idat){
319      
320      if (!initialized_) initialize();
316  
317    set<NonBondedInteraction*>::iterator it;
318
319    for (it = interactions_[ idat.atypes ].begin();
320         it != interactions_[ idat.atypes ].end(); ++it)
321      (*it)->calcForce(idat);
322    
323    return;    
324  }
325
326  void InteractionManager::doSkipCorrection(InteractionData idat){
321  
328    if (!initialized_) initialize();  
329    
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