--- trunk/src/UseTheForce/ForceField.cpp 2005/12/28 21:42:43 821 +++ trunk/src/UseTheForce/ForceField.cpp 2007/07/06 18:15:03 1151 @@ -51,6 +51,7 @@ #include "utils/simError.h" #include "UseTheForce/DarkSide/atype_interface.h" #include "UseTheForce/DarkSide/fForceOptions_interface.h" +#include "UseTheForce/DarkSide/switcheroo_interface.h" namespace oopse { ForceField::ForceField() { @@ -68,6 +69,7 @@ namespace oopse { ForceField::~ForceField() { deleteAtypes(); + deleteSwitch(); } AtomType* ForceField::getAtomType(const std::string &at) { @@ -129,6 +131,22 @@ namespace oopse { } + NonBondedInteractionType* ForceField::getNonBondedInteractionType(const std::string &at1, const std::string &at2) { + std::vector keys; + keys.push_back(at1); + keys.push_back(at2); + + //try exact match first + NonBondedInteractionType* nbiType = nonBondedInteractionTypeCont_.find(keys); + if (nbiType) { + return nbiType; + } else { + //if no exact match found, try wild card match + return nonBondedInteractionTypeCont_.find(keys, wildCardAtomTypeName_); + } + + } + BondType* ForceField::getExactBondType(const std::string &at1, const std::string &at2){ std::vector keys; keys.push_back(at1); @@ -154,6 +172,15 @@ namespace oopse { keys.push_back(at4); return torsionTypeCont_.find(keys); } + + NonBondedInteractionType* ForceField::getExactNonBondedInteractionType(const std::string &at1, const std::string &at2){ + std::vector keys; + keys.push_back(at1); + keys.push_back(at2); + return nonBondedInteractionTypeCont_.find(keys); + } + + bool ForceField::addAtomType(const std::string &at, AtomType* atomType) { std::vector keys; keys.push_back(at); @@ -187,10 +214,18 @@ namespace oopse { return torsionTypeCont_.add(keys, torsionType); } - double ForceField::getRcutFromAtomType(AtomType* at) { + bool ForceField::addNonBondedInteractionType(const std::string &at1, const std::string &at2, NonBondedInteractionType* nbiType) { + std::vector keys; + keys.push_back(at1); + keys.push_back(at2); + return nonBondedInteractionTypeCont_.add(keys, nbiType); + + } + + RealType ForceField::getRcutFromAtomType(AtomType* at) { /**@todo */ GenericData* data; - double rcut = 0.0; + RealType rcut = 0.0; if (at->isLennardJones()) { data = at->getPropertyByName("LennardJones");