ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/parallel/ForceMatrixDecomposition.cpp
(Generate patch)

Comparing branches/development/src/parallel/ForceMatrixDecomposition.cpp (file contents):
Revision 1760 by gezelter, Thu Jun 21 19:26:46 2012 UTC vs.
Revision 1771 by gezelter, Fri Jul 27 17:34:10 2012 UTC

# Line 310 | Line 310 | namespace OpenMD {
310      
311      RealType tol = 1e-6;
312      largestRcut_ = 0.0;
313    RealType rc;
313      int atid;
314      set<AtomType*> atypes = info_->getSimulatedAtomTypes();
315      
# Line 395 | Line 394 | namespace OpenMD {
394        }
395        
396        bool gTypeFound = false;
397 <      for (int gt = 0; gt < gTypeCutoffs.size(); gt++) {
397 >      for (unsigned int gt = 0; gt < gTypeCutoffs.size(); gt++) {
398          if (abs(groupCutoff[cg1] - gTypeCutoffs[gt]) < tol) {
399            groupToGtype[cg1] = gt;
400            gTypeFound = true;
# Line 420 | Line 419 | namespace OpenMD {
419      
420      RealType tradRcut = groupMax;
421  
422 <    for (int i = 0; i < gTypeCutoffs.size();  i++) {
423 <      for (int j = 0; j < gTypeCutoffs.size();  j++) {      
422 >    for (unsigned int i = 0; i < gTypeCutoffs.size();  i++) {
423 >      for (unsigned int j = 0; j < gTypeCutoffs.size();  j++) {      
424          RealType thisRcut;
425          switch(cutoffPolicy_) {
426          case TRADITIONAL:
# Line 477 | Line 476 | namespace OpenMD {
476    }
477  
478    int ForceMatrixDecomposition::getTopologicalDistance(int atom1, int atom2) {
479 <    for (int j = 0; j < toposForAtom[atom1].size(); j++) {
479 >    for (unsigned int j = 0; j < toposForAtom[atom1].size(); j++) {
480        if (toposForAtom[atom1][j] == atom2)
481          return topoDist[atom1][j];
482      }
# Line 488 | Line 487 | namespace OpenMD {
487      pairwisePot = 0.0;
488      embeddingPot = 0.0;
489      excludedPot = 0.0;
490 +    excludedSelfPot = 0.0;
491  
492   #ifdef IS_MPI
493      if (storageLayout_ & DataStorage::dslForce) {
# Line 906 | Line 906 | namespace OpenMD {
906        RealType ploc2 = 0.0;
907        MPI::COMM_WORLD.Allreduce(&ploc1, &ploc2, 1, MPI::REALTYPE, MPI::SUM);
908        embeddingPot[ii] = ploc2;
909 +    }    
910 +    for (int ii = 0; ii < N_INTERACTION_FAMILIES; ii++) {
911 +      RealType ploc1 = excludedSelfPot[ii];
912 +      RealType ploc2 = 0.0;
913 +      MPI::COMM_WORLD.Allreduce(&ploc1, &ploc2, 1, MPI::REALTYPE, MPI::SUM);
914 +      excludedSelfPot[ii] = ploc2;
915      }    
916   #endif
917      
# Line 1383 | Line 1389 | namespace OpenMD {
1389          for (int j = 0; j < 3; j++) {
1390            scaled[j] -= roundMe(scaled[j]);
1391            scaled[j] += 0.5;
1392 +          // Handle the special case when an object is exactly on the
1393 +          // boundary (a scaled coordinate of 1.0 is the same as
1394 +          // scaled coordinate of 0.0)
1395 +          if (scaled[j] >= 1.0) scaled[j] -= 1.0;
1396          }
1397          
1398          // find xyz-indices of cell that cutoffGroup is in.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines