--- trunk/src/nonbonded/InteractionManager.cpp 2013/08/19 13:12:00 1929 +++ trunk/src/nonbonded/InteractionManager.cpp 2014/11/01 14:12:16 2033 @@ -98,8 +98,9 @@ namespace OpenMD { AtomType* atype2; int atid1, atid2; - // We only need to worry about the types that are actually in the simulation: - + // We only need to worry about the types that are actually in the + // simulation: + set atypes = info_->getSimulatedAtomTypes(); lj_->setSimulatedAtomTypes(atypes); @@ -116,10 +117,7 @@ namespace OpenMD { set::iterator at; for (at = atypes.begin(); at != atypes.end(); ++at) { - - //for (atype1 = atomTypes->beginType(i1); atype1 != NULL; - // atype1 = atomTypes->nextType(i1)) { - + atype1 = *at; atid1 = atype1->getIdent(); iHash_[atid1].resize(nTypes); @@ -136,30 +134,29 @@ namespace OpenMD { painCave.isFatal = 0; simError(); } - } - - if (atype1->isLennardJones()) { - sHash_[atid1] |= LJ_INTERACTION; - } - if (atype1->isElectrostatic()) { - sHash_[atid1] |= ELECTROSTATIC_INTERACTION; - } - if (atype1->isSticky()) { - sHash_[atid1] |= STICKY_INTERACTION; - } - if (atype1->isStickyPower()) { - sHash_[atid1] |= STICKY_INTERACTION; - } - if (atype1->isEAM()) { - sHash_[atid1] |= EAM_INTERACTION; - } - if (atype1->isSC()) { - sHash_[atid1] |= SC_INTERACTION; - } - if (atype1->isGayBerne()) { - sHash_[atid1] |= GB_INTERACTION; + + if (atype1->isLennardJones()) { + sHash_[atid1] |= LJ_INTERACTION; + } + if (atype1->isElectrostatic()) { + sHash_[atid1] |= ELECTROSTATIC_INTERACTION; + } + if (atype1->isSticky()) { + sHash_[atid1] |= STICKY_INTERACTION; + } + if (atype1->isStickyPower()) { + sHash_[atid1] |= STICKY_INTERACTION; + } + if (atype1->isEAM()) { + sHash_[atid1] |= EAM_INTERACTION; + } + if (atype1->isSC()) { + sHash_[atid1] |= SC_INTERACTION; + } + if (atype1->isGayBerne()) { + sHash_[atid1] |= GB_INTERACTION; + } } - // Now, iterate over all known types and add to the interaction map: map::iterator it1, it2; @@ -375,7 +372,7 @@ namespace OpenMD { atid1 = atype1->getIdent(); for (jt = it; jt != simTypes.end(); ++jt) { atype2 = (*jt); - atid1 = atype1->getIdent(); + atid2 = atype2->getIdent(); if (interactions_[atid1][atid2].size() == 0) { sprintf( painCave.errMsg, @@ -429,7 +426,7 @@ namespace OpenMD { int& sHash = sHash_[sdat.atid]; - if ((sHash & EAM_INTERACTION) != 0) eam_->calcFunctional(sdat); + if ((sHash & EAM_INTERACTION) != 0) eam_->calcFunctional(sdat); if ((sHash & SC_INTERACTION) != 0) sc_->calcFunctional(sdat); // set::iterator it; @@ -516,7 +513,8 @@ namespace OpenMD { for (it = interactions_[*atid][*atid].begin(); it != interactions_[*atid][*atid].end(); ++it) - cutoff = max(cutoff, (*it)->getSuggestedCutoffRadius(make_pair(atype, atype))); + cutoff = max(cutoff, (*it)->getSuggestedCutoffRadius(make_pair(atype, + atype))); return cutoff; } @@ -530,7 +528,8 @@ namespace OpenMD { for (it = interactions_[atid][atid].begin(); it != interactions_[atid][atid].end(); ++it) - cutoff = max(cutoff, (*it)->getSuggestedCutoffRadius(make_pair(atype, atype))); + cutoff = max(cutoff, (*it)->getSuggestedCutoffRadius(make_pair(atype, + atype))); return cutoff; } } //end namespace OpenMD