138 |
|
int nCutoffGroups = molStamp->getNCutoffGroups(); |
139 |
|
for (int i = 0; i < nCutoffGroups; ++i) { |
140 |
|
currentCutoffGroupStamp = molStamp->getCutoffGroupStamp(i); |
141 |
< |
cutoffGroup = createCutoffGroup(mol, currentCutoffGroupStamp); |
141 |
> |
cutoffGroup = createCutoffGroup(mol, currentCutoffGroupStamp, localIndexMan); |
142 |
|
mol->addCutoffGroup(cutoffGroup); |
143 |
|
} |
144 |
|
|
169 |
|
// every single free atom |
170 |
|
|
171 |
|
for (fai = freeAtoms.begin(); fai != freeAtoms.end(); ++fai) { |
172 |
< |
cutoffGroup = createCutoffGroup(mol, *fai); |
172 |
> |
cutoffGroup = createCutoffGroup(mol, *fai, localIndexMan); |
173 |
|
mol->addCutoffGroup(cutoffGroup); |
174 |
|
} |
175 |
|
//create constraints |
449 |
|
} |
450 |
|
|
451 |
|
|
452 |
< |
CutoffGroup* MoleculeCreator::createCutoffGroup(Molecule* mol, CutoffGroupStamp* stamp) { |
452 |
> |
CutoffGroup* MoleculeCreator::createCutoffGroup(Molecule* mol, |
453 |
> |
CutoffGroupStamp* stamp, |
454 |
> |
LocalIndexManager* localIndexMan) { |
455 |
|
int nAtoms; |
456 |
|
CutoffGroup* cg; |
457 |
|
Atom* atom; |
463 |
|
assert(atom); |
464 |
|
cg->addAtom(atom); |
465 |
|
} |
466 |
< |
|
466 |
> |
|
467 |
> |
//set the local index of this cutoffGroup, global index will be set later |
468 |
> |
cg->setLocalIndex(localIndexMan->getNextCutoffGroupIndex()); |
469 |
> |
|
470 |
|
return cg; |
471 |
|
} |
472 |
< |
|
473 |
< |
CutoffGroup* MoleculeCreator::createCutoffGroup(Molecule * mol, Atom* atom) { |
472 |
> |
|
473 |
> |
CutoffGroup* MoleculeCreator::createCutoffGroup(Molecule * mol, Atom* atom, |
474 |
> |
LocalIndexManager* localIndexMan) { |
475 |
|
CutoffGroup* cg; |
476 |
|
cg = new CutoffGroup(); |
477 |
|
cg->addAtom(atom); |
478 |
+ |
|
479 |
+ |
//set the local index of this cutoffGroup, global index will be set later |
480 |
+ |
cg->setLocalIndex(localIndexMan->getNextCutoffGroupIndex()); |
481 |
+ |
|
482 |
|
return cg; |
483 |
|
} |
484 |
|
|