37 |
|
#include "utils/MemoryUtils.hpp" |
38 |
|
|
39 |
|
namespace oopse { |
40 |
+ |
Molecule::Molecule(int stampId, int globalIndex, const std::string& molName) |
41 |
+ |
: stampId_(stampId), globalIndex_(globalIndex), moleculeName_(molName) { |
42 |
|
|
43 |
+ |
} |
44 |
+ |
|
45 |
|
Molecule::~Molecule() { |
46 |
|
|
47 |
|
MemoryUtils::deleteVectorOfPointer(atoms_); |
116 |
|
|
117 |
|
if (integrableObjects_.size() != allAtoms.size() - rigidAtoms.size()) { |
118 |
|
//Some atoms in rigidAtoms are not in allAtoms, something must be wrong |
119 |
+ |
sprintf(painCave.errMsg, "Atoms in rigidbody are not in the atom list of the same molecule"); |
120 |
+ |
|
121 |
+ |
painCave.isFatal = 1; |
122 |
+ |
simError(); |
123 |
|
} |
124 |
|
|
125 |
|
integrableObjects_.insert(integrableObjects_.end(), rigidBodies_.begin(), rigidBodies_.end()); |
212 |
|
} |
213 |
|
|
214 |
|
for (bond = beginBond(bondIter); bond != NULL; bond = nextBond(bondIter)) { |
215 |
< |
bond->calcForce(); |
215 |
> |
bond->calc_forces(); |
216 |
|
} |
217 |
|
|
218 |
|
for (bend = beginBend(bendIter); bend != NULL; bend = nextBend(bendIter)) { |
219 |
< |
bend->calcForce(); |
219 |
> |
bend->calc_forces(); |
220 |
|
} |
221 |
|
|
222 |
|
for (torsion = beginTorsion(torsionIter); torsion != NULL; torsion = nextTorsion(torsionIter)) { |
223 |
< |
torsion->calcForce(); |
223 |
> |
torsion->calc_forces(); |
224 |
|
} |
225 |
|
|
226 |
|
} |
242 |
|
//} |
243 |
|
|
244 |
|
for (bond = beginBond(bondIter); bond != NULL; bond = nextBond(bondIter)) { |
245 |
< |
potential += bond->getPotential(); |
245 |
> |
potential += bond->get_potential(); |
246 |
|
} |
247 |
|
|
248 |
|
for (bend = beginBend(bendIter); bend != NULL; bend = nextBend(bendIter)) { |
249 |
< |
potential += bend->getPotential(); |
249 |
> |
potential += bend->get_potential(); |
250 |
|
} |
251 |
|
|
252 |
|
for (torsion = beginTorsion(torsionIter); torsion != NULL; torsion = nextTorsion(torsionIter)) { |
253 |
< |
potential += torsion->getPotential(); |
253 |
> |
potential += torsion->get_potential(); |
254 |
|
} |
255 |
|
|
256 |
|
return potential; |