| 6 |
|
* redistribute this software in source and binary code form, provided |
| 7 |
|
* that the following conditions are met: |
| 8 |
|
* |
| 9 |
< |
* 1. Acknowledgement of the program authors must be made in any |
| 10 |
< |
* publication of scientific results based in part on use of the |
| 11 |
< |
* program. An acceptable form of acknowledgement is citation of |
| 12 |
< |
* the article in which the program was described (Matthew |
| 13 |
< |
* A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher |
| 14 |
< |
* J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented |
| 15 |
< |
* Parallel Simulation Engine for Molecular Dynamics," |
| 16 |
< |
* J. Comput. Chem. 26, pp. 252-271 (2005)) |
| 17 |
< |
* |
| 18 |
< |
* 2. Redistributions of source code must retain the above copyright |
| 9 |
> |
* 1. Redistributions of source code must retain the above copyright |
| 10 |
|
* notice, this list of conditions and the following disclaimer. |
| 11 |
|
* |
| 12 |
< |
* 3. Redistributions in binary form must reproduce the above copyright |
| 12 |
> |
* 2. Redistributions in binary form must reproduce the above copyright |
| 13 |
|
* notice, this list of conditions and the following disclaimer in the |
| 14 |
|
* documentation and/or other materials provided with the |
| 15 |
|
* distribution. |
| 28 |
|
* arising out of the use of or inability to use software, even if the |
| 29 |
|
* University of Notre Dame has been advised of the possibility of |
| 30 |
|
* such damages. |
| 31 |
+ |
* |
| 32 |
+ |
* SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your |
| 33 |
+ |
* research, please cite the appropriate papers when you publish your |
| 34 |
+ |
* work. Good starting points are: |
| 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] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
| 40 |
+ |
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
| 41 |
|
*/ |
| 42 |
|
|
| 43 |
|
/** |
| 61 |
|
#include "primitives/Torsion.hpp" |
| 62 |
|
#include "primitives/Inversion.hpp" |
| 63 |
|
#include "primitives/CutoffGroup.hpp" |
| 64 |
+ |
#include "utils/PropertyMap.hpp" |
| 65 |
|
|
| 66 |
< |
namespace oopse{ |
| 66 |
> |
namespace OpenMD{ |
| 67 |
|
|
| 68 |
|
class Constraint; |
| 69 |
|
|
| 84 |
|
typedef std::vector<StuntDouble*>::iterator IntegrableObjectIterator; |
| 85 |
|
typedef std::vector<ConstraintPair*>::iterator ConstraintPairIterator; |
| 86 |
|
typedef std::vector<ConstraintElem*>::iterator ConstraintElemIterator; |
| 87 |
+ |
typedef std::vector<Atom*>::iterator FluctuatingChargeIterator; |
| 88 |
|
|
| 86 |
– |
|
| 89 |
|
Molecule(int stampId, int globalIndex, const std::string& molName); |
| 90 |
|
virtual ~Molecule(); |
| 91 |
< |
|
| 91 |
> |
|
| 92 |
|
/** |
| 93 |
|
* Returns the global index of this molecule. |
| 94 |
|
* @return the global index of this molecule |
| 120 |
|
void setGlobalIndex(int index) { |
| 121 |
|
globalIndex_ = index; |
| 122 |
|
} |
| 123 |
+ |
|
| 124 |
+ |
void setConstrainTotalCharge(bool ctc) { |
| 125 |
+ |
constrainTotalCharge_ = ctc; |
| 126 |
+ |
} |
| 127 |
|
|
| 128 |
< |
|
| 128 |
> |
bool constrainTotalCharge() { |
| 129 |
> |
return constrainTotalCharge_; |
| 130 |
> |
} |
| 131 |
> |
|
| 132 |
|
/** add an atom into this molecule */ |
| 133 |
|
void addAtom(Atom* atom); |
| 134 |
|
|
| 201 |
|
unsigned int getNConstraintPairs() { |
| 202 |
|
return constraintPairs_.size(); |
| 203 |
|
} |
| 204 |
< |
|
| 204 |
> |
|
| 205 |
> |
/** Returns the total number of fluctuating charges in this molecule */ |
| 206 |
> |
unsigned int getNFluctuatingCharges() { |
| 207 |
> |
return fluctuatingCharges_.size(); |
| 208 |
> |
} |
| 209 |
> |
|
| 210 |
|
Atom* getAtomAt(unsigned int i) { |
| 211 |
|
assert(i < atoms_.size()); |
| 212 |
|
return atoms_[i]; |
| 317 |
|
++i; |
| 318 |
|
return (i == constraintElems_.end()) ? NULL : *i; |
| 319 |
|
} |
| 320 |
+ |
|
| 321 |
+ |
Atom* beginFluctuatingCharge(std::vector<Atom*>::iterator& i) { |
| 322 |
+ |
i = fluctuatingCharges_.begin(); |
| 323 |
+ |
return (i == fluctuatingCharges_.end()) ? NULL : *i; |
| 324 |
+ |
} |
| 325 |
|
|
| 326 |
+ |
Atom* nextFluctuatingCharge(std::vector<Atom*>::iterator& i) { |
| 327 |
+ |
++i; |
| 328 |
+ |
return (i == fluctuatingCharges_.end()) ? NULL : *i; |
| 329 |
+ |
} |
| 330 |
+ |
|
| 331 |
+ |
|
| 332 |
|
/** |
| 333 |
|
* Returns the total potential energy of short range interaction |
| 334 |
|
* of this molecule |
| 352 |
|
} |
| 353 |
|
|
| 354 |
|
friend std::ostream& operator <<(std::ostream& o, Molecule& mol); |
| 355 |
+ |
|
| 356 |
+ |
//below functions are just forward functions |
| 357 |
+ |
/** |
| 358 |
+ |
* Adds property into property map |
| 359 |
+ |
* @param genData GenericData to be added into PropertyMap |
| 360 |
+ |
*/ |
| 361 |
+ |
void addProperty(GenericData* genData); |
| 362 |
+ |
|
| 363 |
+ |
/** |
| 364 |
+ |
* Removes property from PropertyMap by name |
| 365 |
+ |
* @param propName the name of property to be removed |
| 366 |
+ |
*/ |
| 367 |
+ |
void removeProperty(const std::string& propName); |
| 368 |
+ |
|
| 369 |
+ |
/** |
| 370 |
+ |
* clear all of the properties |
| 371 |
+ |
*/ |
| 372 |
+ |
void clearProperties(); |
| 373 |
+ |
|
| 374 |
+ |
/** |
| 375 |
+ |
* Returns all names of properties |
| 376 |
+ |
* @return all names of properties |
| 377 |
+ |
*/ |
| 378 |
+ |
std::vector<std::string> getPropertyNames(); |
| 379 |
+ |
|
| 380 |
+ |
/** |
| 381 |
+ |
* Returns all of the properties in PropertyMap |
| 382 |
+ |
* @return all of the properties in PropertyMap |
| 383 |
+ |
*/ |
| 384 |
+ |
std::vector<GenericData*> getProperties(); |
| 385 |
+ |
|
| 386 |
+ |
/** |
| 387 |
+ |
* Returns property |
| 388 |
+ |
* @param propName name of property |
| 389 |
+ |
* @return a pointer point to property with propName. If no property named propName |
| 390 |
+ |
* exists, return NULL |
| 391 |
+ |
*/ |
| 392 |
+ |
GenericData* getPropertyByName(const std::string& propName); |
| 393 |
|
|
| 394 |
|
private: |
| 395 |
|
|
| 405 |
|
std::vector<CutoffGroup*> cutoffGroups_; |
| 406 |
|
std::vector<ConstraintPair*> constraintPairs_; |
| 407 |
|
std::vector<ConstraintElem*> constraintElems_; |
| 408 |
+ |
std::vector<Atom*> fluctuatingCharges_; |
| 409 |
|
int stampId_; |
| 410 |
|
std::string moleculeName_; |
| 411 |
+ |
PropertyMap properties_; |
| 412 |
+ |
bool constrainTotalCharge_; |
| 413 |
+ |
|
| 414 |
|
}; |
| 415 |
|
|
| 416 |
< |
} //namespace oopse |
| 416 |
> |
} //namespace OpenMD |
| 417 |
|
#endif // |