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 1576 by gezelter, Wed Jun 8 16:05:07 2011 UTC vs.
Revision 1577 by gezelter, Wed Jun 8 20:26:56 2011 UTC

# Line 57 | Line 57 | namespace OpenMD {
57      storageLayout_ = sman_->getStorageLayout();
58      ff_ = info_->getForceField();
59      nLocal_ = snap_->getNumberOfAtoms();
60    nGroups_ = snap_->getNumberOfCutoffGroups();
60  
61 +    nGroups_ = info_->getNLocalCutoffGroups();
62      // gather the information for atomtype IDs (atids):
63      identsLocal = info_->getIdentArray();
64      AtomLocalToGlobal = info_->getGlobalAtomIndices();
# Line 104 | Line 104 | namespace OpenMD {
104      cgColData.resize(nGroupsInCol_);
105      cgColData.setStorageLayout(DataStorage::dslPosition);
106          
107 <    identsRow.reserve(nAtomsInRow_);
108 <    identsCol.reserve(nAtomsInCol_);
107 >    identsRow.resize(nAtomsInRow_);
108 >    identsCol.resize(nAtomsInCol_);
109      
110      AtomCommIntRow->gather(identsLocal, identsRow);
111      AtomCommIntColumn->gather(identsLocal, identsCol);
# Line 120 | Line 120 | namespace OpenMD {
120      AtomCommRealColumn->gather(massFactorsLocal, massFactorsCol);
121  
122      groupListRow_.clear();
123 <    groupListRow_.reserve(nGroupsInRow_);
123 >    groupListRow_.resize(nGroupsInRow_);
124      for (int i = 0; i < nGroupsInRow_; i++) {
125        int gid = cgRowToGlobal[i];
126        for (int j = 0; j < nAtomsInRow_; j++) {
# Line 131 | Line 131 | namespace OpenMD {
131      }
132  
133      groupListCol_.clear();
134 <    groupListCol_.reserve(nGroupsInCol_);
134 >    groupListCol_.resize(nGroupsInCol_);
135      for (int i = 0; i < nGroupsInCol_; i++) {
136        int gid = cgColToGlobal[i];
137        for (int j = 0; j < nAtomsInCol_; j++) {
# Line 142 | Line 142 | namespace OpenMD {
142      }
143  
144      skipsForRowAtom.clear();
145 <    skipsForRowAtom.reserve(nAtomsInRow_);
145 >    skipsForRowAtom.resize(nAtomsInRow_);
146      for (int i = 0; i < nAtomsInRow_; i++) {
147        int iglob = AtomRowToGlobal[i];
148        for (int j = 0; j < nAtomsInCol_; j++) {
# Line 153 | Line 153 | namespace OpenMD {
153      }
154  
155      toposForRowAtom.clear();
156 <    toposForRowAtom.reserve(nAtomsInRow_);
156 >    toposForRowAtom.resize(nAtomsInRow_);
157      for (int i = 0; i < nAtomsInRow_; i++) {
158        int iglob = AtomRowToGlobal[i];
159        int nTopos = 0;
# Line 178 | Line 178 | namespace OpenMD {
178      }
179  
180   #endif
181
181      groupList_.clear();
182 <    groupList_.reserve(nGroups_);
182 >    groupList_.resize(nGroups_);
183      for (int i = 0; i < nGroups_; i++) {
184        int gid = cgLocalToGlobal[i];
185        for (int j = 0; j < nLocal_; j++) {
186          int aid = AtomLocalToGlobal[j];
187 <        if (globalGroupMembership[aid] == gid)
187 >        if (globalGroupMembership[aid] == gid) {
188            groupList_[i].push_back(j);
189 +
190 +        }
191        }      
192      }
193  
194      skipsForLocalAtom.clear();
195 <    skipsForLocalAtom.reserve(nLocal_);
195 >    skipsForLocalAtom.resize(nLocal_);
196  
197      for (int i = 0; i < nLocal_; i++) {
198        int iglob = AtomLocalToGlobal[i];
# Line 201 | Line 202 | namespace OpenMD {
202            skipsForLocalAtom[i].push_back(j);      
203        }      
204      }
204
205      toposForLocalAtom.clear();
206 <    toposForLocalAtom.reserve(nLocal_);
206 >    toposForLocalAtom.resize(nLocal_);
207      for (int i = 0; i < nLocal_; i++) {
208        int iglob = AtomLocalToGlobal[i];
209        int nTopos = 0;
# Line 236 | Line 236 | namespace OpenMD {
236      int atid;
237      set<AtomType*> atypes = info_->getSimulatedAtomTypes();
238      vector<RealType> atypeCutoff;
239 <    atypeCutoff.reserve( atypes.size() );
239 >    atypeCutoff.resize( atypes.size() );
240  
241      for (set<AtomType*>::iterator at = atypes.begin(); at != atypes.end(); ++at){
242        rc = interactionMan_->getSuggestedCutoffRadius(*at);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines