| 35 |
|
* |
| 36 |
|
* [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |
| 37 |
|
* [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |
| 38 |
< |
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |
| 39 |
< |
* [4] Vardeman & Gezelter, in progress (2009). |
| 38 |
> |
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). |
| 39 |
> |
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
| 40 |
> |
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
| 41 |
|
*/ |
| 42 |
|
|
| 43 |
|
/** |
| 63 |
|
#include "primitives/CutoffGroup.hpp" |
| 64 |
|
#include "utils/PropertyMap.hpp" |
| 65 |
|
|
| 66 |
+ |
|
| 67 |
|
namespace OpenMD{ |
| 68 |
|
|
| 69 |
|
class Constraint; |
| 70 |
< |
|
| 70 |
> |
|
| 71 |
|
/** |
| 72 |
|
* @class Molecule Molecule.hpp "primitives/Molecule.hpp" |
| 73 |
|
* @brief |
| 75 |
|
class Molecule { |
| 76 |
|
public: |
| 77 |
|
|
| 78 |
+ |
struct HBondDonor { |
| 79 |
+ |
Atom* donorAtom; |
| 80 |
+ |
Atom* donatedHydrogen; |
| 81 |
+ |
}; |
| 82 |
+ |
|
| 83 |
|
typedef std::vector<Atom*>::iterator AtomIterator; |
| 84 |
|
typedef std::vector<Bond*>::iterator BondIterator; |
| 85 |
|
typedef std::vector<Bend*>::iterator BendIterator; |
| 90 |
|
typedef std::vector<StuntDouble*>::iterator IntegrableObjectIterator; |
| 91 |
|
typedef std::vector<ConstraintPair*>::iterator ConstraintPairIterator; |
| 92 |
|
typedef std::vector<ConstraintElem*>::iterator ConstraintElemIterator; |
| 93 |
< |
|
| 94 |
< |
|
| 95 |
< |
Molecule(int stampId, int globalIndex, const std::string& molName); |
| 93 |
> |
typedef std::vector<Atom*>::iterator FluctuatingChargeIterator; |
| 94 |
> |
typedef std::vector<HBondDonor*>::iterator HBondDonorIterator; |
| 95 |
> |
typedef std::vector<Atom*>::iterator HBondAcceptorIterator; |
| 96 |
> |
|
| 97 |
> |
Molecule(int stampId, int globalIndex, const std::string& molName, int region); |
| 98 |
|
virtual ~Molecule(); |
| 99 |
|
|
| 100 |
|
/** |
| 115 |
|
int getStampId() { |
| 116 |
|
return stampId_; |
| 117 |
|
} |
| 118 |
+ |
int getRegion() { |
| 119 |
+ |
return region_; |
| 120 |
+ |
} |
| 121 |
|
|
| 122 |
|
/** Returns the name of the molecule */ |
| 123 |
|
std::string getType() { |
| 126 |
|
|
| 127 |
|
/** |
| 128 |
|
* Sets the global index of this molecule. |
| 129 |
< |
* @param new global index to be set |
| 129 |
> |
* @param index new global index to be set |
| 130 |
|
*/ |
| 131 |
|
void setGlobalIndex(int index) { |
| 132 |
|
globalIndex_ = index; |
| 133 |
|
} |
| 134 |
+ |
|
| 135 |
+ |
void setConstrainTotalCharge(bool ctc) { |
| 136 |
+ |
constrainTotalCharge_ = ctc; |
| 137 |
+ |
} |
| 138 |
|
|
| 139 |
< |
|
| 139 |
> |
bool constrainTotalCharge() { |
| 140 |
> |
return constrainTotalCharge_; |
| 141 |
> |
} |
| 142 |
> |
|
| 143 |
|
/** add an atom into this molecule */ |
| 144 |
|
void addAtom(Atom* atom); |
| 145 |
|
|
| 212 |
|
unsigned int getNConstraintPairs() { |
| 213 |
|
return constraintPairs_.size(); |
| 214 |
|
} |
| 215 |
+ |
|
| 216 |
+ |
/** Returns the total number of fluctuating charges in this molecule */ |
| 217 |
+ |
unsigned int getNFluctuatingCharges() { |
| 218 |
+ |
return fluctuatingCharges_.size(); |
| 219 |
+ |
} |
| 220 |
+ |
/** Returns the total number of Hydrogen Bond donors in this molecule */ |
| 221 |
+ |
unsigned int getNHBondDonors() { |
| 222 |
+ |
return hBondDonors_.size(); |
| 223 |
+ |
} |
| 224 |
|
|
| 225 |
+ |
/** Returns the total number of Hydrogen Bond acceptors in this molecule */ |
| 226 |
+ |
unsigned int getNHBondAcceptors() { |
| 227 |
+ |
return hBondAcceptors_.size(); |
| 228 |
+ |
} |
| 229 |
+ |
|
| 230 |
|
Atom* getAtomAt(unsigned int i) { |
| 231 |
|
assert(i < atoms_.size()); |
| 232 |
|
return atoms_[i]; |
| 336 |
|
ConstraintElem* nextConstraintElem(std::vector<ConstraintElem*>::iterator& i) { |
| 337 |
|
++i; |
| 338 |
|
return (i == constraintElems_.end()) ? NULL : *i; |
| 339 |
+ |
} |
| 340 |
+ |
|
| 341 |
+ |
Atom* beginFluctuatingCharge(std::vector<Atom*>::iterator& i) { |
| 342 |
+ |
i = fluctuatingCharges_.begin(); |
| 343 |
+ |
return (i == fluctuatingCharges_.end()) ? NULL : *i; |
| 344 |
|
} |
| 345 |
+ |
|
| 346 |
+ |
Atom* nextFluctuatingCharge(std::vector<Atom*>::iterator& i) { |
| 347 |
+ |
++i; |
| 348 |
+ |
return (i == fluctuatingCharges_.end()) ? NULL : *i; |
| 349 |
+ |
} |
| 350 |
+ |
|
| 351 |
+ |
HBondDonor* beginHBondDonor(std::vector<HBondDonor*>::iterator& i) { |
| 352 |
+ |
i = hBondDonors_.begin(); |
| 353 |
+ |
return (i == hBondDonors_.end()) ? NULL : *i; |
| 354 |
+ |
} |
| 355 |
+ |
|
| 356 |
+ |
HBondDonor* nextHBondDonor(std::vector<HBondDonor*>::iterator& i) { |
| 357 |
+ |
++i; |
| 358 |
+ |
return (i == hBondDonors_.end()) ? NULL : *i; |
| 359 |
+ |
} |
| 360 |
+ |
|
| 361 |
+ |
Atom* beginHBondAcceptor(std::vector<Atom*>::iterator& i) { |
| 362 |
+ |
i = hBondAcceptors_.begin(); |
| 363 |
+ |
return (i == hBondAcceptors_.end()) ? NULL : *i; |
| 364 |
+ |
} |
| 365 |
+ |
|
| 366 |
+ |
Atom* nextHBondAcceptor(std::vector<Atom*>::iterator& i) { |
| 367 |
+ |
++i; |
| 368 |
+ |
return (i == hBondAcceptors_.end()) ? NULL : *i; |
| 369 |
+ |
} |
| 370 |
+ |
|
| 371 |
|
|
| 372 |
|
/** |
| 373 |
|
* Returns the total potential energy of short range interaction |
| 378 |
|
/** get total mass of this molecule */ |
| 379 |
|
RealType getMass(); |
| 380 |
|
|
| 381 |
< |
/** return the center of mass of this molecule */ |
| 381 |
> |
/** |
| 382 |
> |
* Returns the current center of mass position of this molecule. |
| 383 |
> |
* |
| 384 |
> |
* @return the center of mass position of this molecule. |
| 385 |
> |
*/ |
| 386 |
|
Vector3d getCom(); |
| 387 |
|
|
| 388 |
+ |
/** |
| 389 |
+ |
* Returns the center of mass position of this molecule in |
| 390 |
+ |
* specified snapshot |
| 391 |
+ |
* |
| 392 |
+ |
* @return the center of mass position of this molecule |
| 393 |
+ |
* @param snapshotNo |
| 394 |
+ |
*/ |
| 395 |
+ |
Vector3d getCom(int snapshotNo); |
| 396 |
+ |
|
| 397 |
+ |
|
| 398 |
|
/** Moves the center of this molecule */ |
| 399 |
|
void moveCom(const Vector3d& delta); |
| 400 |
|
|
| 459 |
|
std::vector<CutoffGroup*> cutoffGroups_; |
| 460 |
|
std::vector<ConstraintPair*> constraintPairs_; |
| 461 |
|
std::vector<ConstraintElem*> constraintElems_; |
| 462 |
+ |
std::vector<Atom*> fluctuatingCharges_; |
| 463 |
+ |
std::vector<HBondDonor*> hBondDonors_; |
| 464 |
+ |
std::vector<Atom*> hBondAcceptors_; |
| 465 |
+ |
|
| 466 |
|
int stampId_; |
| 467 |
+ |
int region_; |
| 468 |
|
std::string moleculeName_; |
| 469 |
|
PropertyMap properties_; |
| 470 |
+ |
bool constrainTotalCharge_; |
| 471 |
|
|
| 472 |
|
}; |
| 473 |
|
|