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_); |
112 |
|
//element that is contained in [allAtoms.begin(), allAtoms.end()) and not contained in |
113 |
|
//[rigidAtoms.begin(), rigidAtoms.end()). |
114 |
|
std::set_difference(allAtoms.begin(), allAtoms.end(), rigidAtoms.begin(), rigidAtoms.end(), |
115 |
< |
std::back_inserter(integrableObjects_)); |
115 |
> |
std::back_inserter(integrableObjects_.end())); |
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()); |