--- trunk/src/brains/ForceManager.hpp 2005/04/15 22:04:00 507 +++ trunk/src/brains/ForceManager.hpp 2014/04/29 17:32:31 1993 @@ -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,13 +28,22 @@ * 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, 234107 (2008). + * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). + * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ /** * @file ForceManager.hpp * @author tlin * @date 11/09/2004 - * @time 10:36am * @version 1.0 */ @@ -51,42 +51,77 @@ #define BRAINS_FORCEMANAGER_HPP #include "brains/SimInfo.hpp" +#include "primitives/Molecule.hpp" +#include "nonbonded/Cutoffs.hpp" +#include "nonbonded/SwitchingFunction.hpp" +#include "nonbonded/InteractionManager.hpp" +#include "perturbations/Perturbation.hpp" +#include "parallel/ForceDecomposition.hpp" +#include "brains/Thermo.hpp" -namespace oopse { +#define PREPAIR_LOOP 0 +#define PAIR_LOOP 1 +using namespace std; +namespace OpenMD { /** * @class ForceManager ForceManager.hpp "brains/ForceManager.hpp" - * ForceManager is responsible for calculating the short range interactions (c++) and - * long range interactions(fortran). If fortran side is not setup before the force calculation, - * call SimInfo's update function to settle it down. - * @note the reason we delay fortran side's setup is that some applications (Dump2XYZ etc.) - * may not need force calculation, why bother? + * ForceManager is responsible for calculating both the short range + * (bonded) interactions and long range (non-bonded) interactions. + * + * @note the reason we delay some of the setup is that + * initialization must wait until after the force field has been + * parsed so that the atom types are known. */ class ForceManager { public: - ForceManager(SimInfo * info) : info_(info) {} - - virtual ~ForceManager() {} + ForceManager(SimInfo * info); + virtual ~ForceManager(); + virtual void calcForces(); + void initialize(); - //public virtual function should be avoided - /**@todo need refactory */ - virtual void calcForces(bool needPotential, bool needStress); + protected: + bool initialized_; + bool doParticlePot_; + bool doElectricField_; + bool doSitePotential_; + bool doHeatFlux_; + bool doLongRangeCorrections_; + bool usePeriodicBoundaryConditions_; - virtual void init() {} - protected: + virtual void setupCutoffs(); + virtual void preCalculation(); + virtual void shortRangeInteractions(); + virtual void longRangeInteractions(); + virtual void postCalculation(); - virtual void preCalculation(); - - virtual void calcShortRangeInteraction(); + SimInfo* info_; + ForceField* forceField_; + InteractionManager* interactionMan_; + ForceDecomposition* fDecomp_; + SwitchingFunction* switcher_; + Thermo* thermo; - virtual void calcLongRangeInteraction(bool needPotential, bool needStress); + SwitchingFunctionType sft_;/**< Type of switching function in use */ + RealType rCut_; /**< cutoff radius for non-bonded interactions */ + RealType rSwitch_; /**< inner radius of switching function */ + CutoffMethod cutoffMethod_;/**< Cutoff Method for most non-bonded interactions */ + CutoffPolicy cutoffPolicy_;/**< Cutoff Policy for non-bonded interactions */ - virtual void postCalculation(); - - SimInfo * info_; + set atomTypes_; + vector > interactions_; + map bendDataSets; + map torsionDataSets; + map inversionDataSets; + vector > neighborList_; - }; + vector vdwScale_; + vector electrostaticScale_; -} //end namespace oopse + Mat3x3d stressTensor; + + vector perturbations_; + }; +} #endif //BRAINS_FORCEMANAGER_HPP