ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/nonbonded/EAM.cpp
(Generate patch)

Comparing branches/development/src/nonbonded/EAM.cpp (file contents):
Revision 1502 by gezelter, Sat Oct 2 19:53:32 2010 UTC vs.
Revision 1536 by gezelter, Wed Jan 5 14:49:05 2011 UTC

# Line 347 | Line 347 | namespace OpenMD {
347      return;
348    }
349  
350 <  void EAM::calcDensity(DensityData ddat) {
350 >  void EAM::calcDensity(DensityData &ddat) {
351      
352      if (!initialized_) initialize();
353      
# Line 363 | Line 363 | namespace OpenMD {
363      return;
364    }
365  
366 <  void EAM::calcFunctional(FunctionalData fdat) {
366 >  void EAM::calcFunctional(FunctionalData &fdat) {
367  
368      if (!initialized_) initialize();
369  
# Line 377 | Line 377 | namespace OpenMD {
377    }
378  
379  
380 <  void EAM::calcForce(InteractionData idat) {
380 >  void EAM::calcForce(InteractionData &idat) {
381  
382      if (!initialized_) initialize();
383  
# Line 478 | Line 478 | namespace OpenMD {
478        idat.fshift1 = data1.F->getValueAt( idat.rho1 - rhb );
479        idat.fshift2 = data1.F->getValueAt( idat.rho2 - rha );
480  
481 <      idat.pot += phab;
481 >      idat.pot[3] += phab;
482  
483 <      idat.vpair += phab;
483 >      idat.vpair[3] += phab;
484      }
485  
486      return;
487      
488    }
489 +
490 +  RealType EAM::getSuggestedCutoffRadius(AtomType* at1, AtomType* at2) {
491 +    if (!initialized_) initialize();  
492 +
493 +    RealType cut = 0.0;
494 +
495 +    map<AtomType*, EAMAtomData>::iterator it;
496 +
497 +    it = EAMMap.find(at1);
498 +    if (it != EAMMap.end()) {
499 +      EAMAtomData data1 = (*it).second;
500 +      cut = data1.rcut;
501 +    }
502 +
503 +    it = EAMMap.find(at2);
504 +    if (it != EAMMap.end()) {
505 +      EAMAtomData data2 = (*it).second;
506 +      if (data2.rcut > cut)
507 +        cut = data2.rcut;
508 +    }
509 +
510 +    return cut;
511 +  }
512   }
513  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines