51 |
|
*/ |
52 |
|
class SimInfo { |
53 |
|
public: |
54 |
< |
typedef std::vector<Molecule*>::iterator MoleculeIterator; |
54 |
> |
typedef MoleculeIterator MoleculeIterator; |
55 |
|
SimInfo(); |
56 |
|
virtual ~SimInfo(); |
57 |
|
|
160 |
|
* @return the first molecule, return NULL if there is not molecule in this SimInfo |
161 |
|
* @param i the iterator of molecule array (user shouldn't change it) |
162 |
|
*/ |
163 |
< |
Molecule* beginMolecule(std::vector<Molecule*>::iterator& i); |
163 |
> |
Molecule* beginMolecule(MoleculeIterator& i); |
164 |
|
|
165 |
|
/** |
166 |
|
* Returns the next avaliable Molecule based on the iterator. |
167 |
|
* @return the next avaliable molecule, return NULL if reaching the end of the array |
168 |
|
* @param i the iterator of molecule array |
169 |
|
*/ |
170 |
< |
Molecule* nextMolecule(std::vector<Molecule*>::iterator& i); |
170 |
> |
Molecule* nextMolecule(MoleculeIterator& i); |
171 |
|
|
172 |
|
/** Returns the number of degrees of freedom */ |
173 |
|
int getNdf() { |
270 |
|
*/ |
271 |
|
Molecule* getMoleculeByGlobalIndex(int index) { |
272 |
|
std::map<int, Molecule*> i; |
273 |
< |
i = globalIndexToMol_.find(index); |
273 |
> |
i = molecules_.find(index); |
274 |
|
|
275 |
< |
return i != globalIndexToMol_.end() ? i->second : NULL; |
275 |
> |
return i != molecules_.end() ? i->second : NULL; |
276 |
|
} |
277 |
|
|
278 |
– |
|
278 |
|
friend std::ostream& operator <<(ostream& o, SimInfo& info); |
279 |
|
|
280 |
|
private: |
309 |
|
Exclude exclude_; |
310 |
|
ForceField* forceField_; |
311 |
|
|
312 |
< |
std::vector<Molecule*> molecules_; /**< Molecule array */ |
312 |
> |
std::map<int, Molecule*> molecules_; /**< Molecule array */ |
313 |
|
PropertyMap properties_; /**< Generic Property */ |
314 |
|
SnapshotManager* sman_; /**< SnapshotManager */ |
315 |
|
|
321 |
|
|
322 |
|
// |
323 |
|
std::vector<int> molToProcMap_; |
325 |
– |
std::map<int, Molecule*> globalIndexToMol_; |
324 |
|
std::vector<int> molStampIds_; /**< stamp id array of all molecules in the system */ |
325 |
|
std::vector<MoleculeStamp*> moleculeStamps_; /**< molecule stamps array */ |
326 |
|
|