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 1586 by gezelter, Tue Jun 21 06:34: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    }
# Line 283 | 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 314 | Line 318 | namespace OpenMD {
318    void InteractionManager::doPair(InteractionData idat){
319      
320      if (!initialized_) initialize();
321 <  
321 >
322      set<NonBondedInteraction*>::iterator it;
323  
324      for (it = interactions_[ idat.atypes ].begin();
325 <         it != interactions_[ idat.atypes ].end(); ++it)
322 <      (*it)->calcForce(idat);
323 <    
324 <    return;    
325 <  }
325 >         it != interactions_[ idat.atypes ].end(); ++it) {
326  
327 <  void InteractionManager::doSkipCorrection(InteractionData idat){
327 >      // electrostatics still has to worry about indirect
328 >      // contributions from excluded pairs of atoms:
329  
330 <    if (!initialized_) initialize();  
331 <
331 <    set<NonBondedInteraction*>::iterator it;
332 <
333 <    for (it = interactions_[ idat.atypes ].begin();
334 <         it != interactions_[ idat.atypes ].end(); ++it){
335 <      if ((*it)->getFamily() == ELECTROSTATIC_FAMILY) {
336 <        dynamic_cast<ElectrostaticInteraction*>(*it)->calcSkipCorrection(idat);
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