--- branches/development/src/nonbonded/InteractionManager.cpp 2010/10/03 22:18:59 1505 +++ branches/development/src/nonbonded/InteractionManager.cpp 2010/12/27 18:35:59 1529 @@ -44,10 +44,20 @@ namespace OpenMD { namespace OpenMD { bool InteractionManager::initialized_ = false; + RealType InteractionManager::rCut_ = -1.0; + RealType InteractionManager::rSwitch_ = -1.0; ForceField* InteractionManager::forceField_ = NULL; 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 +68,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_); @@ -420,6 +422,18 @@ namespace OpenMD { return cutoff; } + RealType InteractionManager::getSuggestedCutoffRadius(AtomType* atype) { + if (!initialized_) initialize(); + + 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; + } + } //end namespace OpenMD extern "C" { @@ -438,7 +452,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,