--- trunk/src/selection/IndexFinder.cpp 2009/11/25 20:02:06 1390 +++ branches/development/src/selection/IndexFinder.cpp 2012/10/03 14:20:07 1803 @@ -36,21 +36,19 @@ * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). - * [4] Vardeman & Gezelter, in progress (2009). + * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). + * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ #include "selection/IndexFinder.hpp" #include "primitives/Molecule.hpp" namespace OpenMD { - - IndexFinder::IndexFinder(SimInfo* info) : info_(info){ nStuntDoubles_ = info_->getNGlobalAtoms() + info_->getNGlobalRigidBodies(); bitSets_.resize(info_->getNGlobalMolecules()); init(); } - void IndexFinder::init() { SimInfo::MoleculeIterator mi; @@ -60,20 +58,19 @@ namespace OpenMD { Molecule::RigidBodyIterator rbIter; RigidBody* rb; - for (mol = info_->beginMolecule(mi); mol != NULL; mol = info_->nextMolecule(mi)) { + for (mol = info_->beginMolecule(mi); mol != NULL; + mol = info_->nextMolecule(mi)) { OpenMDBitSet bs(nStuntDoubles_); for(atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) { bs.setBitOn(atom->getGlobalIndex()); } - - for (rb = mol->beginRigidBody(rbIter); rb != NULL; rb = mol->nextRigidBody(rbIter)) { + for (rb = mol->beginRigidBody(rbIter); rb != NULL; + rb = mol->nextRigidBody(rbIter)) { bs.setBitOn(rb->getGlobalIndex()); } - bitSets_[mol->getGlobalIndex()] = bs; - } - + } } OpenMDBitSet IndexFinder::find(int molIndex){ @@ -85,11 +82,8 @@ namespace OpenMD { for (int i = begMolIndex; i < endMolIndex; ++i) { bs |= bitSets_[i]; - } - + } return bs; } - - }