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 1587 by gezelter, Fri Jul 8 20:25:32 2011 UTC vs.
branches/devel_omp/src/nonbonded/InteractionManager.cpp (file contents), Revision 1614 by mciznick, Tue Aug 23 20:55:51 2011 UTC

# Line 281 | Line 281 | namespace OpenMD {
281    }
282    
283    void InteractionManager::doPrePair(InteractionData idat){
284 <    
284 > //      printf("%s\tERROR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n", __FUNCTION__);
285      if (!initialized_) initialize();
286          
287      // excluded interaction, so just return
# Line 299 | Line 299 | namespace OpenMD {
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 315 | Line 338 | namespace OpenMD {
338      return;    
339    }
340  
341 +  void InteractionManager::initNonbondedForces() {
342 +        pair<AtomType*, AtomType*> key;
343 +                set<AtomType*> simTypes = info_->getSimulatedAtomTypes();
344 +                set<AtomType*>::iterator it, jt;
345 +                set<NonBondedInteraction*>::iterator kt;
346 +    AtomType* atype1;
347 +    AtomType* atype2;
348 +
349 +                for (it = simTypes.begin(); it != simTypes.end(); ++it) {
350 +                        atype1 = (*it);
351 +                        for (jt = it; jt != simTypes.end(); ++jt) {
352 +                                atype2 = (*jt);
353 +                                key = make_pair(atype1, atype2);
354 +
355 +                                for (kt = interactions_[ key ].begin();
356 +                                                kt != interactions_[ key ].end(); ++kt) {
357 +
358 +                                                (*kt)->initForce();
359 +                                }
360 +                        }
361 +                }
362 +
363 + /*      lj_->initForce();
364 +        electrostatic_->initForce();
365 +        sticky_->initForce();
366 +        eam_->initForce();
367 +        sc_->initForce();
368 +        gb_->initForce();*/
369 +
370 +                return;
371 +  }
372 +
373    void InteractionManager::doPair(InteractionData idat){
374 <    
374 > //      printf("%s\tERROR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n", __FUNCTION__);
375      if (!initialized_) initialize();
376  
377      set<NonBondedInteraction*>::iterator it;
# Line 335 | Line 390 | namespace OpenMD {
390      return;    
391    }
392  
393 +  void InteractionManager::wrapData(InteractionDataPrv &src, InteractionData &dst) {
394 +        dst.A1 = src.A1;
395 +        dst.A2 = src.A2;
396 +        dst.atypes = src.atypes;
397 +        dst.d = &src.d;
398 +        dst.dfrho1 = src.dfrho1;
399 +        dst.dfrho2 = src.dfrho2;
400 +        dst.eFrame1 = src.eFrame1;
401 +        dst.eFrame2 = src.eFrame2;
402 +        dst.electroMult = &src.electroMult;
403 +        dst.excluded = src.excluded;
404 +        dst.f1 = &src.f1;
405 +        dst.frho1 = src.frho1;
406 +        dst.frho2 = src.frho2;
407 +        dst.particlePot1 = src.particlePot1;
408 +        dst.particlePot2 = src.particlePot2;
409 +        dst.pot = &src.pot;
410 +        dst.r2 = &src.r2;
411 +        dst.rcut = &src.rcut;
412 +        dst.rho1 = src.rho1;
413 +        dst.rho2 = src.rho2;
414 +        dst.rij = &src.rij;
415 +        dst.shiftedForce = src.shiftedForce;
416 +        dst.shiftedPot = src.shiftedPot;
417 +        dst.skippedCharge1 = src.skippedCharge1;
418 +        dst.skippedCharge2 = src.skippedCharge2;
419 +        dst.sw = &src.sw;
420 +        dst.t1 = src.t1;
421 +        dst.t2 = src.t2;
422 +        dst.topoDist = src.topoDist;
423 +        dst.vdwMult = &src.vdwMult;
424 +        dst.vpair = &src.vpair;
425 +  }
426 +
427 +  void InteractionManager::doPairOMP(InteractionDataPrv &idatThread){
428 +    set<NonBondedInteraction*>::iterator it;
429 +    InteractionData idat;
430 +
431 +    wrapData(idatThread, idat);
432 +
433 +    for (it = interactions_[ idat.atypes ].begin();
434 +         it != interactions_[ idat.atypes ].end(); ++it) {
435 +
436 +      // electrostatics still has to worry about indirect
437 +      // contributions from excluded pairs of atoms:
438 +
439 +      if (!idat.excluded || (*it)->getFamily() == ELECTROSTATIC_FAMILY) {
440 +        (*it)->calcForce(idat);
441 +      }
442 +    }
443 +
444 +    return;
445 +  }
446 +
447    void InteractionManager::doSelfCorrection(SelfData sdat){
448  
449      if (!initialized_) initialize();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines