--- trunk/src/UseTheForce/ForceField.hpp 2006/05/17 21:51:42 963 +++ branches/development/src/brains/ForceField.hpp 2012/05/26 18:13:43 1725 @@ -6,19 +6,10 @@ * redistribute this software in source and binary code form, provided * that the following conditions are met: * - * 1. Acknowledgement of the program authors must be made in any - * publication of scientific results based in part on use of the - * program. An acceptable form of acknowledgement is citation of - * the article in which the program was described (Matthew - * A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher - * J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented - * Parallel Simulation Engine for Molecular Dynamics," - * J. Comput. Chem. 26, pp. 252-271 (2005)) - * - * 2. Redistributions of source code must retain the above copyright + * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 3. Redistributions in binary form must reproduce the above copyright + * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. @@ -37,6 +28,16 @@ * arising out of the use of or inability to use software, even if the * University of Notre Dame has been advised of the possibility of * such damages. + * + * SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your + * research, please cite the appropriate papers when you publish your + * work. Good starting points are: + * + * [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). + * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). + * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ /** @@ -53,34 +54,36 @@ #include "config.h" #include #include +#include -#include "io/basic_ifstrstream.hpp" +#include "io/ifstrstream.hpp" #include "io/ForceFieldOptions.hpp" +#include "io/SectionParserManager.hpp" #include "utils/TypeContainer.hpp" +#include "utils/Tuple.hpp" #include "types/AtomType.hpp" #include "types/BondType.hpp" #include "types/BendType.hpp" #include "types/TorsionType.hpp" -#include "UseTheForce/fForceOptions.h" -namespace oopse { +#include "types/InversionType.hpp" +#include "types/NonBondedInteractionType.hpp" - /** - * @class ForceField ForceField.hpp ''UseTheForce/ForceField.hpp" - * @brief - */ +namespace OpenMD { + class ForceField{ public: - typedef TypeContainer AtomTypeContainer; typedef TypeContainer BondTypeContainer; typedef TypeContainer BendTypeContainer; typedef TypeContainer TorsionTypeContainer; - - ForceField(); + typedef TypeContainer InversionTypeContainer; + typedef TypeContainer NonBondedInteractionTypeContainer; + + ForceField(std::string ffName); + + virtual ~ForceField() {}; - virtual ~ForceField(); - std::string getForceFieldFileName() { return forceFieldFileName_; } @@ -89,15 +92,21 @@ namespace oopse { forceFieldFileName_ = filename; } - virtual void parse(const std::string& filename) = 0; + virtual void parse(const std::string& filename); AtomType* getAtomType(const std::string &at); + AtomType* getAtomType(int ident); BondType* getBondType(const std::string &at1, const std::string &at2); BendType* getBendType(const std::string &at1, const std::string &at2, const std::string &at3); TorsionType* getTorsionType(const std::string &at1, const std::string &at2, const std::string &at3, const std::string &at4); - + InversionType* getInversionType(const std::string &at1, + const std::string &at2, + const std::string &at3, + const std::string &at4); + NonBondedInteractionType* getNonBondedInteractionType(const std::string &at1, const std::string &at2); + BondType* getExactBondType(const std::string &at1, const std::string &at2); BendType* getExactBendType(const std::string &at1, const std::string &at2, const std::string &at3); @@ -105,27 +114,41 @@ namespace oopse { const std::string &at2, const std::string &at3, const std::string &at4); - - + InversionType* getExactInversionType(const std::string &at1, + const std::string &at2, + const std::string &at3, + const std::string &at4); + NonBondedInteractionType* getExactNonBondedInteractionType(const std::string &at1, const std::string &at2); + + //avoid make virtual function public //Herb Sutter and Andrei Alexandrescu, C++ coding Standards, Addision-Wesley virtual RealType getRcutFromAtomType(AtomType* at); - + std::string getWildCard() { return wildCardAtomTypeName_; } - + void setWildCard(const std::string& wildCard) { wildCardAtomTypeName_ = wildCard; } - - + unsigned int getNAtomType() { return atomTypeCont_.size(); } + + AtomTypeContainer* getAtomTypes() { + return &atomTypeCont_; + } + + NonBondedInteractionTypeContainer* getNonBondedInteractionTypes() { + return &nonBondedInteractionTypeCont_; + } bool addAtomType(const std::string &at, AtomType* atomType); + bool replaceAtomType(const std::string &at, AtomType* atomType); + bool addBondType(const std::string &at1, const std::string &at2, BondType* bondType); @@ -133,30 +156,40 @@ namespace oopse { const std::string &at3, BendType* bendType); bool addTorsionType(const std::string &at1, const std::string &at2, - const std::string &at3, const std::string &at4, TorsionType* torsionType); + const std::string &at3, const std::string &at4, + TorsionType* torsionType); + bool addInversionType(const std::string &at1, const std::string &at2, + const std::string &at3, const std::string &at4, + InversionType* inversionType); + + bool addNonBondedInteractionType(const std::string &at1, + const std::string &at2, + NonBondedInteractionType* nbiType); + ifstrstream* openForceFieldFile(const std::string& filename); - + ForceFieldOptions& getForceFieldOptions() {return forceFieldOptions_;} - void setFortranForceOptions(void); protected: AtomTypeContainer atomTypeCont_; BondTypeContainer bondTypeCont_; BendTypeContainer bendTypeCont_; TorsionTypeContainer torsionTypeCont_; + InversionTypeContainer inversionTypeCont_; + NonBondedInteractionTypeContainer nonBondedInteractionTypeCont_; ForceFieldOptions forceFieldOptions_; + std::map atypeIdentToName; + SectionParserManager spMan_; + private: - std::string ffPath_; - - std::string wildCardAtomTypeName_; - - std::string forceFieldFileName_; + std::string ffPath_; + std::string wildCardAtomTypeName_; + std::string forceFieldFileName_; + }; - - -}//end namespace oopse +}//end namespace OpenMD #endif