--- branches/development/src/nonbonded/InteractionManager.cpp 2010/10/03 22:18:59 1505 +++ branches/development/src/nonbonded/InteractionManager.cpp 2010/12/17 20:11:05 1528 @@ -48,6 +48,14 @@ namespace OpenMD { InteractionManager* InteractionManager::_instance = NULL; map InteractionManager::typeMap_; map, set > InteractionManager::interactions_; + + LJ* InteractionManager::lj_ = new LJ(); + GB* InteractionManager::gb_ = new GB(); + Sticky* InteractionManager::sticky_ = new Sticky(); + Morse* InteractionManager::morse_ = new Morse(); + EAM* InteractionManager::eam_ = new EAM(); + SC* InteractionManager::sc_ = new SC(); + Electrostatic* InteractionManager::electrostatic_ = new Electrostatic(); InteractionManager* InteractionManager::Instance() { if (!_instance) { @@ -58,14 +66,6 @@ namespace OpenMD { void InteractionManager::initialize() { - lj_ = new LJ(); - gb_ = new GB(); - sticky_ = new Sticky(); - eam_ = new EAM(); - sc_ = new SC(); - morse_ = new Morse(); - electrostatic_ = new Electrostatic(); - lj_->setForceField(forceField_); gb_->setForceField(forceField_); sticky_->setForceField(forceField_); @@ -410,7 +410,19 @@ namespace OpenMD { if (!initialized_) initialize(); AtomType* atype = typeMap_[*atid]; + + pair key = make_pair(atype, atype); + set::iterator it; + RealType cutoff = 0.0; + + for (it = interactions_[key].begin(); it != interactions_[key].end(); ++it) + cutoff = max(cutoff, (*it)->getSuggestedCutoffRadius(atype, atype)); + return cutoff; + } + RealType InteractionManager::getSuggestedCutoffRadius(AtomType* atype) { + if (!initialized_) initialize(); + pair key = make_pair(atype, atype); set::iterator it; RealType cutoff = 0.0; @@ -438,7 +450,7 @@ extern "C" { rho_i_at_j, rho_j_at_i); } - void fortranDoPreforce(int *atid, RealType *rho, RealType *frho, + void fortranDoPreForce(int *atid, RealType *rho, RealType *frho, RealType *dfrhodrho) { return OpenMD::InteractionManager::Instance()->doPreForce(atid, rho, frho,