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 |
|
|
88 |
– |
|
89 |
|
Molecule(int stampId, int globalIndex, const std::string& molName); |
90 |
|
virtual ~Molecule(); |
91 |
|
|
115 |
|
|
116 |
|
/** |
117 |
|
* Sets the global index of this molecule. |
118 |
< |
* @param new global index to be set |
118 |
> |
* @param index new global index to be set |
119 |
|
*/ |
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 |
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 |
|
|