ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/ZConstraint.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/ZConstraint.cpp (file contents):
Revision 658 by tim, Thu Jul 31 15:35:07 2003 UTC vs.
Revision 660 by tim, Thu Jul 31 19:59:34 2003 UTC

# Line 33 | Line 33 | template<typename T> ZConstraint<T>::ZConstraint(SimIn
33      
34      }
35      else{
36 +          
37        indexOfAllZConsMols = index->getIndexData();
38 +      
39 +      //the maximum value of index is the last one(we sorted the index data in SimSetup.cpp)
40 +      int maxIndex;
41 +      int totalNumMol;
42 +      
43 +      maxIndex = indexOfAllZConsMols[indexOfAllZConsMols.size() - 1];
44 +
45 + #ifndef IS_MPI
46 +      totalNumMol = nMols;
47 + #else
48 +      totalNumMol = mpiSim->getTotNmol();  
49 + #endif      
50 +      
51 +      if(maxIndex > totalNumMol - 1){
52 +        sprintf( painCave.errMsg,
53 +               "ZConstraint error: index is out of range\n");
54 +        painCave.isFatal = 1;
55 +        simError();
56 +                
57 +      }
58 +      
59      }
60          
61    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines