--- trunk/src/brains/ForceManager.hpp 2009/11/25 20:02:06 1390 +++ trunk/src/brains/ForceManager.hpp 2014/04/29 17:32:31 1993 @@ -35,15 +35,15 @@ * * [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] Vardeman & Gezelter, in progress (2009). + * [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 */ @@ -52,48 +52,76 @@ #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" + +#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 the - * Fortran side is not set up before the force calculation, call - * SimInfo's update function to settle it down. + * ForceManager is responsible for calculating both the short range + * (bonded) interactions and long range (non-bonded) interactions. * - * @note the reason we delay fortran side's setup is that some - * applications (Dump2XYZ etc.) may not need force calculation, so why - * bother? + * @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 functions should be avoided - /**@todo needs refactoring */ - 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(bool needStress); - - SimInfo * info_; + set atomTypes_; + vector > interactions_; + map bendDataSets; + map torsionDataSets; + map inversionDataSets; + vector > neighborList_; - std::map bendDataSets; - std::map torsionDataSets; - std::map inversionDataSets; - Mat3x3d tau; - - }; + vector vdwScale_; + vector electrostaticScale_; -} //end namespace OpenMD + Mat3x3d stressTensor; + + vector perturbations_; + }; +} #endif //BRAINS_FORCEMANAGER_HPP