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

Comparing trunk/src/parallel/ForceMatrixDecomposition.cpp (file contents):
Revision 1896 by gezelter, Tue Jul 2 20:02:31 2013 UTC vs.
Revision 1939 by gezelter, Thu Oct 31 18:18:57 2013 UTC

# Line 99 | Line 99 | namespace OpenMD {
99      nGroups_ = info_->getNLocalCutoffGroups();
100      // gather the information for atomtype IDs (atids):
101      idents = info_->getIdentArray();
102 +    regions = info_->getRegions();
103      AtomLocalToGlobal = info_->getGlobalAtomIndices();
104      cgLocalToGlobal = info_->getGlobalGroupIndices();
105      vector<int> globalGroupMembership = info_->getGlobalGroupMembership();
# Line 163 | Line 164 | namespace OpenMD {
164      
165      AtomPlanIntRow->gather(idents, identsRow);
166      AtomPlanIntColumn->gather(idents, identsCol);
167 +
168 +    regionsRow.resize(nAtomsInRow_);
169 +    regionsCol.resize(nAtomsInCol_);
170      
171 +    AtomPlanIntRow->gather(regions, regionsRow);
172 +    AtomPlanIntColumn->gather(regions, regionsCol);
173 +    
174      // allocate memory for the parallel objects
175      atypesRow.resize(nAtomsInRow_);
176      atypesCol.resize(nAtomsInCol_);
# Line 1168 | Line 1175 | namespace OpenMD {
1175      idat.excluded = excludeAtomPair(atom1, atom2);
1176    
1177   #ifdef IS_MPI
1178 <    idat.atypes = make_pair( atypesRow[atom1], atypesCol[atom2]);
1178 >    //idat.atypes = make_pair( atypesRow[atom1], atypesCol[atom2]);
1179      idat.atid1 = identsRow[atom1];
1180      idat.atid2 = identsCol[atom2];
1181 <    //idat.atypes = make_pair( ff_->getAtomType(identsRow[atom1]),
1182 <    //                         ff_->getAtomType(identsCol[atom2]) );
1183 <    
1181 >
1182 >    if (regionsRow[atom1] >= 0 && regionsCol[atom2] >= 0) {
1183 >      idat.sameRegion = (regionsRow[atom1] == regionsCol[atom2]);
1184 >    } else {
1185 >      idat.sameRegion = false;
1186 >    }
1187 >
1188      if (storageLayout_ & DataStorage::dslAmat) {
1189        idat.A1 = &(atomRowData.aMat[atom1]);
1190        idat.A2 = &(atomColData.aMat[atom2]);
# Line 1226 | Line 1237 | namespace OpenMD {
1237  
1238   #else
1239      
1240 <    idat.atypes = make_pair( atypesLocal[atom1], atypesLocal[atom2]);
1240 >    //idat.atypes = make_pair( atypesLocal[atom1], atypesLocal[atom2]);
1241      idat.atid1 = idents[atom1];
1242      idat.atid2 = idents[atom2];
1243  
1244 +    if (regions[atom1] >= 0 && regions[atom2] >= 0) {
1245 +      idat.sameRegion = (regions[atom1] == regions[atom2]);
1246 +    } else {
1247 +      idat.sameRegion = false;
1248 +    }
1249 +
1250      if (storageLayout_ & DataStorage::dslAmat) {
1251        idat.A1 = &(snap_->atomData.aMat[atom1]);
1252        idat.A2 = &(snap_->atomData.aMat[atom2]);
# Line 1375 | Line 1392 | namespace OpenMD {
1392      Vector3d boxY = box.getColumn(1);
1393      Vector3d boxZ = box.getColumn(2);
1394      
1395 <    nCells_.x() = (int) ( boxX.length() )/ rList_;
1396 <    nCells_.y() = (int) ( boxY.length() )/ rList_;
1397 <    nCells_.z() = (int) ( boxZ.length() )/ rList_;
1395 >    nCells_.x() = int( boxX.length() / rList_ );
1396 >    nCells_.y() = int( boxY.length() / rList_ );
1397 >    nCells_.z() = int( boxZ.length() / rList_ );
1398      
1399      // handle small boxes where the cell offsets can end up repeating cells
1400      
# Line 1473 | Line 1490 | namespace OpenMD {
1490          }
1491          
1492          // find xyz-indices of cell that cutoffGroup is in.
1493 <        whichCell.x() = nCells_.x() * scaled.x();
1494 <        whichCell.y() = nCells_.y() * scaled.y();
1495 <        whichCell.z() = nCells_.z() * scaled.z();
1493 >        whichCell.x() = int(nCells_.x() * scaled.x());
1494 >        whichCell.y() = int(nCells_.y() * scaled.y());
1495 >        whichCell.z() = int(nCells_.z() * scaled.z());
1496          
1497          // find single index of this cell:
1498          cellIndex = Vlinear(whichCell, nCells_);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines