92 |
|
int numCutoffGroups; |
93 |
|
CutoffGroup* myCutoffGroup; |
94 |
|
vector<CutoffGroup*>::iterator iterCutoff; |
95 |
– |
Atom* cutoffAtom; |
96 |
– |
vector<Atom*>::iterator iterAtom; |
95 |
|
double com[3]; |
96 |
< |
double tempPos[3]; |
99 |
< |
int atomIndex; |
96 |
> |
vector<double> rcGroup; |
97 |
|
|
98 |
|
short int passedCalcPot = (short int)calcPot; |
99 |
|
short int passedCalcStress = (short int)calcStress; |
128 |
|
u_l = config->getUlArray(); |
129 |
|
|
130 |
|
if(entry_plug->haveCutoffGroups){ |
134 |
– |
//if |
131 |
|
myMols = entry_plug->molecules; |
132 |
|
numMol = entry_plug->n_mol; |
133 |
|
for(int i = 0; i < numMol; i++){ |
138 |
– |
numAtom = myMols[i].getNAtoms(); |
139 |
– |
myAtoms = myMols[i].getMyAtoms(); |
140 |
– |
|
141 |
– |
|
142 |
– |
for(int j = 0; j < numAtom; j++){ |
143 |
– |
#ifdef IS_MPI |
144 |
– |
atomIndex = myAtoms[j]->getGlobalIndex(); |
145 |
– |
#else |
146 |
– |
atomIndex = myAtoms[j]->getIndex(); |
147 |
– |
#endif |
148 |
– |
|
149 |
– |
if(myMols[i].belongToCutoffGroup(atomIndex)) |
150 |
– |
continue; |
151 |
– |
else{ |
152 |
– |
myAtoms[j]->getPos(tempPos); |
153 |
– |
myAtoms[j]->setRc(tempPos); |
154 |
– |
} |
155 |
– |
|
156 |
– |
} |
134 |
|
|
135 |
|
numCutoffGroups = myMols[i].getNCutoffGroups(); |
136 |
|
for(myCutoffGroup =myMols[i].beginCutoffGroup(iterCutoff); myCutoffGroup != NULL; |
137 |
|
myCutoffGroup =myMols[i].nextCutoffGroup(iterCutoff)){ |
138 |
|
//get center of mass of the cutoff group |
139 |
< |
myCutoffGroup->getCOM(com); |
139 |
> |
myCutoffGroup->getCOM(com); |
140 |
|
|
141 |
< |
for(cutoffAtom = myCutoffGroup->beginAtom(iterAtom); cutoffAtom != NULL; |
142 |
< |
cutoffAtom = myCutoffGroup->beginAtom(iterAtom)){ |
143 |
< |
cutoffAtom->setRc(com); |
144 |
< |
} |
168 |
< |
|
141 |
> |
rcGroup.push_back(com[0]); |
142 |
> |
rcGroup.push_back(com[1]); |
143 |
> |
rcGroup.push_back(com[2]); |
144 |
> |
|
145 |
|
}// end for(myCutoffGroup) |
146 |
|
|
147 |
|
}//end for(int i = 0) |
148 |
|
|
149 |
< |
rc = config->getRcArray(); |
149 |
> |
rc = &rcGroup[0]; |
150 |
|
} |
151 |
|
else{ |
152 |
|
// center of mass of the group is the same as position of the atom if cutoff group does not exist |