--- trunk/src/brains/SimInfo.cpp 2012/09/10 18:38:44 1796 +++ trunk/src/brains/SimInfo.cpp 2013/08/19 13:51:04 1930 @@ -35,7 +35,7 @@ * * [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). + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ @@ -91,6 +91,13 @@ namespace OpenMD { for (vector::iterator i = components.begin(); i !=components.end(); ++i) { molStamp = (*i)->getMoleculeStamp(); + if ( (*i)->haveRegion() ) { + molStamp->setRegion( (*i)->getRegion() ); + } else { + // set the region to a disallowed value: + molStamp->setRegion( -1 ); + } + nMolWithSameStamp = (*i)->getNMol(); addMoleculeStamp(molStamp, nMolWithSameStamp); @@ -365,10 +372,12 @@ namespace OpenMD { void SimInfo::addInteractionPairs(Molecule* mol) { ForceFieldOptions& options_ = forceField_->getForceFieldOptions(); + vector::iterator atomIter; vector::iterator bondIter; vector::iterator bendIter; vector::iterator torsionIter; vector::iterator inversionIter; + Atom* atom; Bond* bond; Bend* bend; Torsion* torsion; @@ -411,6 +420,7 @@ namespace OpenMD { atomGroups.insert(map >::value_type(sd->getGlobalIndex(), oneAtomSet)); } } + for (bond= mol->beginBond(bondIter); bond != NULL; bond = mol->nextBond(bondIter)) { @@ -780,6 +790,22 @@ namespace OpenMD { #endif return atomTypes; + } + + + int getGlobalCountOfType(AtomType* atype) { + /* + set atypes = getSimulatedAtomTypes(); + map counts_; + + for(mol = beginMolecule(mi); mol != NULL; mol = nextMolecule(mi)) { + for(atom = mol->beginAtom(ai); atom != NULL; + atom = mol->nextAtom(ai)) { + atom->getAtomType(); + } + } + */ + return 0; } void SimInfo::setupSimVariables() { @@ -915,23 +941,21 @@ namespace OpenMD { } } - // Build the identArray_ + // Build the identArray_ and regions_ identArray_.clear(); - identArray_.reserve(getNAtoms()); - for(mol = beginMolecule(mi); mol != NULL; mol = nextMolecule(mi)) { + identArray_.reserve(getNAtoms()); + regions_.clear(); + regions_.reserve(getNAtoms()); + + for(mol = beginMolecule(mi); mol != NULL; mol = nextMolecule(mi)) { + int reg = mol->getRegion(); for(atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) { identArray_.push_back(atom->getIdent()); + regions_.push_back(reg); } } - - //scan topology - - int* excludeList = excludedInteractions_.getPairList(); - int* oneTwoList = oneTwoInteractions_.getPairList(); - int* oneThreeList = oneThreeInteractions_.getPairList(); - int* oneFourList = oneFourInteractions_.getPairList(); - + topologyDone_ = true; } @@ -1003,7 +1027,7 @@ namespace OpenMD { StuntDouble* SimInfo::getIOIndexToIntegrableObject(int index) { - if (index >= IOIndexToIntegrableObject.size()) { + if (index >= int(IOIndexToIntegrableObject.size())) { sprintf(painCave.errMsg, "SimInfo::getIOIndexToIntegrableObject Error: Integrable Object\n" "\tindex exceeds number of known objects!\n");