64 |
|
nCutoffGroups_ += mol->getNCutoffGroups(); |
65 |
|
nConstraints_ += mol->getNConstraints(); |
66 |
|
|
67 |
+ |
globalIndexToMol_.insert(make_pair(mol->getGlobalIndex(), mol)); |
68 |
|
return true; |
69 |
|
} else { |
70 |
|
return false; |
86 |
|
nCutoffGroups_ -= mol->getNCutoffGroups(); |
87 |
|
nConstraints_ -= mol->getNConstraints(); |
88 |
|
|
89 |
+ |
globalIndexToMol_.erase(mol->getGlobalIndex()); |
90 |
|
return true; |
91 |
|
} else { |
92 |
|
return false; |
107 |
|
} |
108 |
|
|
109 |
|
|
110 |
< |
void SimInfo::calcNDF() { |
110 |
> |
void SimInfo::calcNdf() { |
111 |
|
int ndf_local; |
112 |
|
std::vector<Molecule*>::iterator i; |
113 |
|
std::vector<StuntDouble*>::iterator j; |
148 |
|
|
149 |
|
} |
150 |
|
|
151 |
< |
void SimInfo::calcNDFRaw() { |
151 |
> |
void SimInfo::calcNdfRaw() { |
152 |
|
int ndfRaw_local; |
153 |
|
|
154 |
|
std::vector<Molecule*>::iterator i; |
183 |
|
#endif |
184 |
|
} |
185 |
|
|
186 |
< |
void SimInfo::calcNDFTrans() { |
186 |
> |
void SimInfo::calcNdfTrans() { |
187 |
|
int ndfTrans_local; |
188 |
|
|
189 |
|
ndfTrans_local = 3 * nIntegrableObjects_ - nConstraints_; |
199 |
|
|
200 |
|
} |
201 |
|
|
202 |
+ |
void SimInfo::addExcludePairs(Molecule* mol) { |
203 |
+ |
std::vector<Bond*>::iterator bondIter; |
204 |
+ |
std::vector<Bend*>::iterator bendIter; |
205 |
+ |
std::vector<Torsion*>::iterator torsionIter; |
206 |
+ |
Bond* bond; |
207 |
+ |
Bend* bend; |
208 |
+ |
Torsion* torsion; |
209 |
+ |
int a; |
210 |
+ |
int b; |
211 |
+ |
int c; |
212 |
+ |
int d; |
213 |
+ |
|
214 |
+ |
for (bond= mol->beginBond(bondIter); bond != NULL; bond = mol->nextBond(bondIter)) { |
215 |
+ |
a = bond->getAtomA()->getGlobalIndex(); |
216 |
+ |
b = bond->getAtomB()->getGlobalIndex(); |
217 |
+ |
exclude_.addPair(a, b); |
218 |
+ |
} |
219 |
|
|
220 |
+ |
for (bend= mol->beginBend(bendIter); bend != NULL; bend = mol->nextBend(bendIter)) { |
221 |
+ |
a = bend->getAtomA()->getGlobalIndex(); |
222 |
+ |
b = bend->getAtomB()->getGlobalIndex(); |
223 |
+ |
c = bend->getAtomC()->getGlobalIndex(); |
224 |
+ |
|
225 |
+ |
exclude_.addPair(a, b); |
226 |
+ |
exclude_.addPair(a, c); |
227 |
+ |
exclude_.addPair(b, c); |
228 |
+ |
} |
229 |
+ |
|
230 |
+ |
for (torsion= mol->beginTorsion(torsionIter); torsion != NULL; torsion = mol->nextBond(torsionIter)) { |
231 |
+ |
a = torsion->getAtomA()->getGlobalIndex(); |
232 |
+ |
b = torsion->getAtomB()->getGlobalIndex(); |
233 |
+ |
c = torsion->getAtomC()->getGlobalIndex(); |
234 |
+ |
d = torsion->getAtomD()->getGlobalIndex(); |
235 |
+ |
|
236 |
+ |
exclude_.addPair(a, b); |
237 |
+ |
exclude_.addPair(a, c); |
238 |
+ |
exclude_.addPair(a, d); |
239 |
+ |
exclude_.addPair(b, c); |
240 |
+ |
exclude_.addPair(b, d); |
241 |
+ |
exclude_.addPair(c, d); |
242 |
+ |
} |
243 |
+ |
|
244 |
+ |
|
245 |
+ |
} |
246 |
+ |
|
247 |
+ |
void SimInfo::removeExcludePairs(Molecule* mol) { |
248 |
+ |
std::vector<Bond*>::iterator bondIter; |
249 |
+ |
std::vector<Bend*>::iterator bendIter; |
250 |
+ |
std::vector<Torsion*>::iterator torsionIter; |
251 |
+ |
Bond* bond; |
252 |
+ |
Bend* bend; |
253 |
+ |
Torsion* torsion; |
254 |
+ |
int a; |
255 |
+ |
int b; |
256 |
+ |
int c; |
257 |
+ |
int d; |
258 |
+ |
|
259 |
+ |
for (bond= mol->beginBond(bondIter); bond != NULL; bond = mol->nextBond(bondIter)) { |
260 |
+ |
a = bond->getAtomA()->getGlobalIndex(); |
261 |
+ |
b = bond->getAtomB()->getGlobalIndex(); |
262 |
+ |
exclude_.removePair(a, b); |
263 |
+ |
} |
264 |
+ |
|
265 |
+ |
for (bend= mol->beginBend(bendIter); bend != NULL; bend = mol->nextBend(bendIter)) { |
266 |
+ |
a = bend->getAtomA()->getGlobalIndex(); |
267 |
+ |
b = bend->getAtomB()->getGlobalIndex(); |
268 |
+ |
c = bend->getAtomC()->getGlobalIndex(); |
269 |
+ |
|
270 |
+ |
exclude_.removePair(a, b); |
271 |
+ |
exclude_.removePair(a, c); |
272 |
+ |
exclude_.removePair(b, c); |
273 |
+ |
} |
274 |
+ |
|
275 |
+ |
for (torsion= mol->beginTorsion(torsionIter); torsion != NULL; torsion = mol->nextBond(torsionIter)) { |
276 |
+ |
a = torsion->getAtomA()->getGlobalIndex(); |
277 |
+ |
b = torsion->getAtomB()->getGlobalIndex(); |
278 |
+ |
c = torsion->getAtomC()->getGlobalIndex(); |
279 |
+ |
d = torsion->getAtomD()->getGlobalIndex(); |
280 |
+ |
|
281 |
+ |
exclude_.removePair(a, b); |
282 |
+ |
exclude_.removePair(a, c); |
283 |
+ |
exclude_.removePair(a, d); |
284 |
+ |
exclude_.removePair(b, c); |
285 |
+ |
exclude_.removePair(b, d); |
286 |
+ |
exclude_.removePair(c, d); |
287 |
+ |
} |
288 |
+ |
|
289 |
+ |
} |
290 |
+ |
|
291 |
+ |
|
292 |
+ |
void SimInfo::addMoleculeStamp(MoleculeStamp* molStamp, int nmol) { |
293 |
+ |
int curStampId; |
294 |
+ |
|
295 |
+ |
//index from 0 |
296 |
+ |
curStampId = molStampIds_.size(); |
297 |
+ |
|
298 |
+ |
moleculeStamps_.push_back(molStamp); |
299 |
+ |
molStampIds_.insert(molStampIds_.end(), nmol, curStampId) |
300 |
+ |
} |
301 |
+ |
|
302 |
+ |
std::ostream& operator <<(ostream& o, SimInfo& info) { |
303 |
+ |
|
304 |
+ |
return o; |
305 |
+ |
} |
306 |
+ |
|
307 |
|
}//end namespace oopse |