--- branches/development/src/nonbonded/InteractionManager.cpp 2012/05/18 21:44:02 1710 +++ branches/development/src/nonbonded/InteractionManager.cpp 2013/05/15 15:09:35 1874 @@ -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). */ @@ -59,8 +59,22 @@ namespace OpenMD { maw_ = new MAW(); } + InteractionManager::~InteractionManager() { + delete lj_; + delete gb_; + delete sticky_; + delete morse_; + delete repulsivePower_; + delete eam_; + delete sc_; + delete electrostatic_; + delete maw_; + } + void InteractionManager::initialize() { - + + if (initialized_) return; + ForceField* forceField_ = info_->getForceField(); lj_->setForceField(forceField_); @@ -79,7 +93,6 @@ namespace OpenMD { AtomType* atype1; AtomType* atype2; pair key; - pair::iterator, bool> ret; for (atype1 = atomTypes->beginType(i1); atype1 != NULL; atype1 = atomTypes->nextType(i1)) { @@ -106,11 +119,7 @@ namespace OpenMD { for( it2 = typeMap_.begin(); it2 != typeMap_.end(); ++it2) { atype2 = (*it2).second; - - bool vdwExplicit = false; - bool metExplicit = false; - bool hbExplicit = false; - + key = make_pair(atype1, atype2); if (atype1->isLennardJones() && atype2->isLennardJones()) { @@ -145,6 +154,10 @@ namespace OpenMD { if (nbiType != NULL) { + bool vdwExplicit = false; + bool metExplicit = false; + // bool hbExplicit = false; + if (nbiType->isLennardJones()) { // We found an explicit Lennard-Jones interaction. // override all other vdw entries for this pair of atom types: @@ -302,10 +315,6 @@ namespace OpenMD { eam_->setCutoffRadius(rcut); } - void InteractionManager::setSwitchingRadius(RealType rswitch) { - electrostatic_->setSwitchingRadius(rswitch); - } - void InteractionManager::doPrePair(InteractionData idat){ if (!initialized_) initialize(); @@ -379,7 +388,7 @@ namespace OpenMD { RealType InteractionManager::getSuggestedCutoffRadius(int *atid) { if (!initialized_) initialize(); - + AtomType* atype = typeMap_[*atid]; pair key = make_pair(atype, atype);