82 Atom* donatedHydrogen;
85 using AtomIterator = std::vector<Atom*>::iterator;
86 using BondIterator = std::vector<Bond*>::iterator;
87 using BendIterator = std::vector<Bend*>::iterator;
88 using TorsionIterator = std::vector<Torsion*>::iterator;
89 using InversionIterator = std::vector<Inversion*>::iterator;
90 using RigidBodyIterator = std::vector<RigidBody*>::iterator;
91 using CutoffGroupIterator = std::vector<CutoffGroup*>::iterator;
92 using IntegrableObjectIterator = std::vector<StuntDouble*>::iterator;
93 using ConstraintPairIterator = std::vector<ConstraintPair*>::iterator;
94 using ConstraintElemIterator = std::vector<ConstraintElem*>::iterator;
95 using FluctuatingChargeIterator = std::vector<Atom*>::iterator;
96 using HBondDonorIterator = std::vector<HBondDonor*>::iterator;
97 using HBondAcceptorIterator = std::vector<Atom*>::iterator;
99 Molecule(
int stampId,
int globalIndex,
const std::string& molName,
117 int getRegion() {
return region_; }
120 std::string
getType() {
return moleculeName_; }
128 void setConstrainTotalCharge(
bool ctc) { constrainTotalCharge_ = ctc; }
130 bool constrainTotalCharge() {
return constrainTotalCharge_; }
153 void addConstraintPair(ConstraintPair* consPair);
155 void addConstraintElem(ConstraintElem* consElem);
195 Atom* getAtomAt(
unsigned int i) {
196 assert(i < atoms_.size());
200 RigidBody* getRigidBodyAt(
unsigned int i) {
201 assert(i < rigidBodies_.size());
202 return rigidBodies_[i];
205 Atom* beginAtom(std::vector<Atom*>::iterator& i) {
207 return (i == atoms_.end()) ? NULL : *i;
210 Atom* nextAtom(std::vector<Atom*>::iterator& i) {
212 return (i == atoms_.end()) ? NULL : *i;
215 Bond* beginBond(std::vector<Bond*>::iterator& i) {
217 return (i == bonds_.end()) ? NULL : *i;
220 Bond* nextBond(std::vector<Bond*>::iterator& i) {
222 return (i == bonds_.end()) ? NULL : *i;
225 Bend* beginBend(std::vector<Bend*>::iterator& i) {
227 return (i == bends_.end()) ? NULL : *i;
230 Bend* nextBend(std::vector<Bend*>::iterator& i) {
232 return (i == bends_.end()) ? NULL : *i;
235 Torsion* beginTorsion(std::vector<Torsion*>::iterator& i) {
236 i = torsions_.begin();
237 return (i == torsions_.end()) ? NULL : *i;
240 Torsion* nextTorsion(std::vector<Torsion*>::iterator& i) {
242 return (i == torsions_.end()) ? NULL : *i;
245 Inversion* beginInversion(std::vector<Inversion*>::iterator& i) {
246 i = inversions_.begin();
247 return (i == inversions_.end()) ? NULL : *i;
250 Inversion* nextInversion(std::vector<Inversion*>::iterator& i) {
252 return (i == inversions_.end()) ? NULL : *i;
255 RigidBody* beginRigidBody(std::vector<RigidBody*>::iterator& i) {
256 i = rigidBodies_.begin();
257 return (i == rigidBodies_.end()) ? NULL : *i;
260 RigidBody* nextRigidBody(std::vector<RigidBody*>::iterator& i) {
262 return (i == rigidBodies_.end()) ? NULL : *i;
265 StuntDouble* beginIntegrableObject(std::vector<StuntDouble*>::iterator& i) {
266 i = integrableObjects_.begin();
267 return (i == integrableObjects_.end()) ? NULL : *i;
270 StuntDouble* nextIntegrableObject(std::vector<StuntDouble*>::iterator& i) {
272 return (i == integrableObjects_.end()) ? NULL : *i;
275 CutoffGroup* beginCutoffGroup(std::vector<CutoffGroup*>::iterator& i) {
276 i = cutoffGroups_.begin();
277 return (i == cutoffGroups_.end()) ? NULL : *i;
280 CutoffGroup* nextCutoffGroup(std::vector<CutoffGroup*>::iterator& i) {
282 return (i == cutoffGroups_.end()) ? NULL : *i;
285 ConstraintPair* beginConstraintPair(
286 std::vector<ConstraintPair*>::iterator& i) {
287 i = constraintPairs_.begin();
288 return (i == constraintPairs_.end()) ? NULL : *i;
291 ConstraintPair* nextConstraintPair(
292 std::vector<ConstraintPair*>::iterator& i) {
294 return (i == constraintPairs_.end()) ? NULL : *i;
297 ConstraintElem* beginConstraintElem(
298 std::vector<ConstraintElem*>::iterator& i) {
299 i = constraintElems_.begin();
300 return (i == constraintElems_.end()) ? NULL : *i;
303 ConstraintElem* nextConstraintElem(
304 std::vector<ConstraintElem*>::iterator& i) {
306 return (i == constraintElems_.end()) ? NULL : *i;
309 Atom* beginFluctuatingCharge(std::vector<Atom*>::iterator& i) {
310 i = fluctuatingCharges_.begin();
311 return (i == fluctuatingCharges_.end()) ? NULL : *i;
314 Atom* nextFluctuatingCharge(std::vector<Atom*>::iterator& i) {
316 return (i == fluctuatingCharges_.end()) ? NULL : *i;
319 HBondDonor* beginHBondDonor(std::vector<HBondDonor*>::iterator& i) {
320 i = hBondDonors_.begin();
321 return (i == hBondDonors_.end()) ? NULL : *i;
324 HBondDonor* nextHBondDonor(std::vector<HBondDonor*>::iterator& i) {
326 return (i == hBondDonors_.end()) ? NULL : *i;
329 Atom* beginHBondAcceptor(std::vector<Atom*>::iterator& i) {
330 i = hBondAcceptors_.begin();
331 return (i == hBondAcceptors_.end()) ? NULL : *i;
334 Atom* nextHBondAcceptor(std::vector<Atom*>::iterator& i) {
336 return (i == hBondAcceptors_.end()) ? NULL : *i;
370 Vector3d
getCom(
int snapshotNo);
373 void setCom(
const Vector3d& newCom);
376 void moveCom(
const Vector3d& delta);
381 std::string getMoleculeName() {
return moleculeName_; }
383 friend std::ostream& operator<<(std::ostream& o, Molecule& mol);
390 void addProperty(std::shared_ptr<GenericData> genData);
421 std::vector<Atom*> atoms_;
422 std::vector<Bond*> bonds_;
423 std::vector<Bend*> bends_;
424 std::vector<Torsion*> torsions_;
425 std::vector<Inversion*> inversions_;
426 std::vector<RigidBody*> rigidBodies_;
427 std::vector<StuntDouble*> integrableObjects_;
428 std::vector<CutoffGroup*> cutoffGroups_;
429 std::vector<ConstraintPair*> constraintPairs_;
430 std::vector<ConstraintElem*> constraintElems_;
431 std::vector<Atom*> fluctuatingCharges_;
432 std::vector<HBondDonor*> hBondDonors_;
433 std::vector<Atom*> hBondAcceptors_;
437 std::string moleculeName_;
438 PropertyMap properties_;
439 bool constrainTotalCharge_;