ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/devel_omp/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.
branches/devel_omp/src/nonbonded/InteractionManager.cpp (file contents), Revision 1608 by mciznick, Tue Aug 9 01:58:56 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 279 | Line 281 | namespace OpenMD {
281    }
282    
283    void InteractionManager::doPrePair(InteractionData idat){
284 <    
285 <    if (!initialized_) initialize();
284 >        printf("%s\tERROR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n", __FUNCTION__);
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 289 | Line 294 | namespace OpenMD {
294        if ((*it)->getFamily() == METALLIC_FAMILY) {
295          dynamic_cast<MetallicInteraction*>(*it)->calcDensity(idat);
296        }
297 <    }
297 >    }*/
298      
299      return;    
300    }
301    
302 +  void InteractionManager::initializeOMP() {
303 +        if (!initialized_) initialize();
304 +  }
305 +
306 +  void InteractionManager::doPrePairOMP(InteractionDataPrv idatThread){
307 +        InteractionData idat;
308 +    // excluded interaction, so just return
309 +    if (idat.excluded) return;
310 +
311 +    wrapData(idatThread, idat);
312 +
313 +    set<NonBondedInteraction*>::iterator it;
314 +
315 +    for (it = interactions_[ idat.atypes ].begin();
316 +         it != interactions_[ idat.atypes ].end(); ++it){
317 +      if ((*it)->getFamily() == METALLIC_FAMILY) {
318 +        dynamic_cast<MetallicInteraction*>(*it)->calcDensity(idat);
319 +      }
320 +    }
321 +
322 +    return;
323 +  }
324 +
325    void InteractionManager::doPreForce(SelfData sdat){
326  
327      if (!initialized_) initialize();
# Line 311 | Line 339 | namespace OpenMD {
339    }
340  
341    void InteractionManager::doPair(InteractionData idat){
342 <    
343 <    if (!initialized_) initialize();
344 <  
342 >        printf("%s\tERROR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n", __FUNCTION__);
343 >    /*if (!initialized_) initialize();
344 >
345      set<NonBondedInteraction*>::iterator it;
346  
347      for (it = interactions_[ idat.atypes ].begin();
348 <         it != interactions_[ idat.atypes ].end(); ++it)
349 <      (*it)->calcForce(idat);
348 >         it != interactions_[ idat.atypes ].end(); ++it) {
349 >
350 >      // electrostatics still has to worry about indirect
351 >      // contributions from excluded pairs of atoms:
352 >
353 >      if (!idat.excluded || (*it)->getFamily() == ELECTROSTATIC_FAMILY) {
354 >        (*it)->calcForce(idat);
355 >      }
356 >    }*/
357      
358      return;    
359    }
360  
361 <  void InteractionManager::doSkipCorrection(InteractionData idat){
361 >  void InteractionManager::wrapData(InteractionDataPrv &src, InteractionData &dst) {
362 >        dst.A1 = src.A1;
363 >        dst.A2 = src.A2;
364 >        dst.atypes = src.atypes;
365 >        dst.d = &src.d;
366 >        dst.dfrho1 = src.dfrho1;
367 >        dst.dfrho2 = src.dfrho2;
368 >        dst.eFrame1 = src.eFrame1;
369 >        dst.eFrame2 = src.eFrame2;
370 >        dst.electroMult = &src.electroMult;
371 >        dst.excluded = src.excluded;
372 >        dst.f1 = &src.f1;
373 >        dst.frho1 = src.frho1;
374 >        dst.frho2 = src.frho2;
375 >        dst.particlePot1 = src.particlePot1;
376 >        dst.particlePot2 = src.particlePot2;
377 >        dst.pot = &src.pot;
378 >        dst.r2 = &src.r2;
379 >        dst.rcut = &src.rcut;
380 >        dst.rho1 = src.rho1;
381 >        dst.rho2 = src.rho2;
382 >        dst.rij = &src.rij;
383 >        dst.shiftedForce = src.shiftedForce;
384 >        dst.shiftedPot = src.shiftedPot;
385 >        dst.skippedCharge1 = src.skippedCharge1;
386 >        dst.skippedCharge2 = src.skippedCharge2;
387 >        dst.sw = &src.sw;
388 >        dst.t1 = src.t1;
389 >        dst.t2 = src.t2;
390 >        dst.topoDist = src.topoDist;
391 >        dst.vdwMult = &src.vdwMult;
392 >        dst.vpair = &src.vpair;
393 >  }
394  
395 <    if (!initialized_) initialize();  
329 <    
395 >  void InteractionManager::doPairOMP(InteractionDataPrv &idatThread){
396      set<NonBondedInteraction*>::iterator it;
397 +    InteractionData idat;
398  
399 <    for (it = interactions_[ idat.atypes ].begin();
400 <         it != interactions_[ idat.atypes ].end(); ++it){
401 <      if ((*it)->getFamily() == ELECTROSTATIC_FAMILY) {
402 <        dynamic_cast<ElectrostaticInteraction*>(*it)->calcSkipCorrection(idat);
399 >    wrapData(idatThread, idat);
400 >
401 >    for (it = interactions_[ idat.atypes ].begin();
402 >         it != interactions_[ idat.atypes ].end(); ++it) {
403 >
404 >      // electrostatics still has to worry about indirect
405 >      // contributions from excluded pairs of atoms:
406 >
407 >      if (!idat.excluded || (*it)->getFamily() == ELECTROSTATIC_FAMILY) {
408 >        (*it)->calcForce(idat);
409        }
410      }
411 <    
412 <    return;    
411 >
412 >    return;
413    }
414  
415    void InteractionManager::doSelfCorrection(SelfData sdat){

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines