# | Line 253 | Line 253 | namespace OpenMD { | |
---|---|---|
253 | void ForceMatrixDecomposition::createGtypeCutoffMap() { | |
254 | ||
255 | RealType tol = 1e-6; | |
256 | + | largestRcut_ = 0.0; |
257 | RealType rc; | |
258 | int atid; | |
259 | set<AtomType*> atypes = info_->getSimulatedAtomTypes(); | |
260 | + | |
261 | map<int, RealType> atypeCutoff; | |
262 | ||
263 | for (set<AtomType*>::iterator at = atypes.begin(); | |
# | Line 263 | Line 265 | namespace OpenMD { | |
265 | atid = (*at)->getIdent(); | |
266 | if (userChoseCutoff_) | |
267 | atypeCutoff[atid] = userCutoff_; | |
268 | < | else |
268 | > | else |
269 | atypeCutoff[atid] = interactionMan_->getSuggestedCutoffRadius(*at); | |
270 | } | |
271 | < | |
271 | > | |
272 | vector<RealType> gTypeCutoffs; | |
273 | // first we do a single loop over the cutoff groups to find the | |
274 | // largest cutoff for any atypes present in this group. | |
# | Line 326 | Line 328 | namespace OpenMD { | |
328 | vector<RealType> groupCutoff(nGroups_, 0.0); | |
329 | groupToGtype.resize(nGroups_); | |
330 | for (int cg1 = 0; cg1 < nGroups_; cg1++) { | |
329 | – | |
331 | groupCutoff[cg1] = 0.0; | |
332 | vector<int> atomList = getAtomsInGroupRow(cg1); | |
332 | – | |
333 | for (vector<int>::iterator ia = atomList.begin(); | |
334 | ia != atomList.end(); ++ia) { | |
335 | int atom1 = (*ia); | |
336 | atid = idents[atom1]; | |
337 | < | if (atypeCutoff[atid] > groupCutoff[cg1]) { |
338 | < | groupCutoff[cg1] = atypeCutoff[atid]; |
339 | < | } |
337 | > | if (atypeCutoff[atid] > groupCutoff[cg1]) |
338 | > | groupCutoff[cg1] = atypeCutoff[atid]; |
339 | } | |
340 | < | |
340 | > | |
341 | bool gTypeFound = false; | |
342 | for (int gt = 0; gt < gTypeCutoffs.size(); gt++) { | |
343 | if (abs(groupCutoff[cg1] - gTypeCutoffs[gt]) < tol) { | |
# | Line 346 | Line 345 | namespace OpenMD { | |
345 | gTypeFound = true; | |
346 | } | |
347 | } | |
348 | < | if (!gTypeFound) { |
348 | > | if (!gTypeFound) { |
349 | gTypeCutoffs.push_back( groupCutoff[cg1] ); | |
350 | groupToGtype[cg1] = gTypeCutoffs.size() - 1; | |
351 | } | |
# | Line 390 | Line 389 | namespace OpenMD { | |
389 | ||
390 | pair<int,int> key = make_pair(i,j); | |
391 | gTypeCutoffMap[key].first = thisRcut; | |
393 | – | |
392 | if (thisRcut > largestRcut_) largestRcut_ = thisRcut; | |
395 | – | |
393 | gTypeCutoffMap[key].second = thisRcut*thisRcut; | |
397 | – | |
394 | gTypeCutoffMap[key].third = pow(thisRcut + skinThickness_, 2); | |
399 | – | |
395 | // sanity check | |
396 | ||
397 | if (userChoseCutoff_) { |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |