ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/nonbonded/InteractionManager.hpp
(Generate patch)

Comparing branches/development/src/nonbonded/InteractionManager.hpp (file contents):
Revision 1535 by gezelter, Fri Dec 31 18:31:56 2010 UTC vs.
Revision 1877 by gezelter, Thu Jun 6 15:43:35 2013 UTC

# Line 35 | Line 35
35   *                                                                      
36   * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).            
37   * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).          
38 < * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).          
39 < * [4]  Vardeman & Gezelter, in progress (2009).                        
38 > * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).          
39 > * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40 > * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
42  
43   #ifndef NONBONDED_INTERACTIONMANAGER_HPP
# Line 52 | Line 53
53   #include "nonbonded/Morse.hpp"
54   #include "nonbonded/Electrostatic.hpp"
55   #include "nonbonded/MAW.hpp"
56 + #include "nonbonded/RepulsivePower.hpp"
57   #include "nonbonded/SwitchingFunction.hpp"
58  
59   using namespace std;
60  
61   namespace OpenMD {
60  enum CutoffMethod {
61    HARD,
62    SWITCHED,
63    SHIFTED_POTENTIAL,
64    SHIFTED_FORCE
65  };
62  
63 +  const static int ELECTROSTATIC_PAIR  = (1 << 0);  
64 +  const static int LJ_PAIR             = (1 << 1);
65 +  const static int EAM_PAIR            = (1 << 2);
66 +  const static int SC_PAIR             = (1 << 3);
67 +  const static int STICKY_PAIR         = (1 << 4);
68 +  const static int GB_PAIR             = (1 << 5);
69 +  const static int MORSE_PAIR          = (1 << 6);
70 +  const static int REPULSIVEPOWER_PAIR = (1 << 7);
71 +  const static int MAW_PAIR            = (1 << 8);
72 +
73    /**
74 <   * @class InteractionManager InteractionManager is responsible for
75 <   * keeping track of the non-bonded interactions (C++) and providing
76 <   * an interface to the low-level loop (Fortran).
74 >   * @class InteractionManager
75 >   * InteractionManager is responsible for
76 >   * keeping track of the non-bonded interactions (C++)
77     */
78    class InteractionManager {
79  
80    public:
81 <    static InteractionManager* Instance();
82 <    static void setSimInfo(SimInfo* info) {info_ = info;}
83 <    static void initialize();
81 >    InteractionManager();
82 >    virtual ~InteractionManager();
83 >    void setSimInfo(SimInfo* info) {info_ = info;}
84 >    void initialize();
85  
86      // Fortran support routines
87  
88 <    static void doPrePair(int *atid1, int *atid2, RealType *rij, RealType *rho_i_at_j, RealType *rho_j_at_i);
89 <    static void doPreForce(int *atid, RealType *rho, RealType *frho, RealType *dfrhodrho);
90 <    static void doPair(int *atid1, int *atid2, RealType *d, RealType *r, RealType *r2, RealType *rcut, RealType *sw, int *topoDist, RealType *pot, RealType *vpair, RealType *f1, RealType *eFrame1, RealType *eFrame2, RealType *A1, RealType *A2, RealType *t1, RealType *t2, RealType *rho1, RealType *rho2, RealType *dfrho1, RealType *dfrho2, RealType *fshift1, RealType *fshift2);    
91 <    static void doSkipCorrection(int *atid1, int *atid2, RealType *d, RealType *r, RealType *skippedCharge1, RealType *skippedCharge2, RealType *sw, RealType *electroMult, RealType *pot, RealType *vpair, RealType *f1, RealType *eFrame1, RealType *eFrame2, RealType *t1, RealType *t2);
92 <    static void doSelfCorrection(int *atid, RealType *eFrame, RealType *skippedCharge, RealType *pot, RealType *t);
93 <    static RealType getSuggestedCutoffRadius(int *atid1);  
94 <    static RealType getSuggestedCutoffRadius(AtomType *atype);
95 <    static void setSwitch(RealType *rIn, RealType *rOut);
89 <    static void getSwitch(RealType *r2, RealType *sw, RealType *dswdr, RealType *r, int *in_switching_region);
88 >    void doPrePair(InteractionData idat);
89 >    void doPreForce(SelfData sdat);
90 >    void doPair(InteractionData idat);    
91 >    void doSkipCorrection(InteractionData idat);
92 >    void doSelfCorrection(SelfData sdat);
93 >    void setCutoffRadius(RealType rCut);
94 >    RealType getSuggestedCutoffRadius(int *atid1);  
95 >    RealType getSuggestedCutoffRadius(AtomType *atype);
96      
97    private:
98 <    virtual ~InteractionManager() { }
93 <    // singleton pattern, prevent reconstruction
94 <    InteractionManager() { }
95 <    InteractionManager(InteractionManager const&) {};
96 <    InteractionManager& operator=(InteractionManager const&) {};
97 <    static InteractionManager* _instance;
98 >    bool initialized_;
99  
100 <    static bool initialized_;
100 >    void setupElectrostatics();
101  
102 <    static void setupCutoffs();
103 <    static void setupSwitching();
104 <    static void setupNeighborlists();
105 <
106 <    static SimInfo* info_;
107 <    static LJ* lj_;
108 <    static GB* gb_;
109 <    static Sticky* sticky_;
110 <    static EAM* eam_;
111 <    static SC* sc_;
112 <    static Morse* morse_;
113 <    static Electrostatic* electrostatic_;
113 <    static MAW* maw_;
114 <    static SwitchingFunction* switcher_;
115 <
116 <    static RealType rCut_;            /**< cutoff radius for non-bonded interactions */
117 <    static RealType rSwitch_;         /**< inner radius of switching function */
118 <    static CutoffMethod cutoffMethod_;/**< Cutoff Method for most non-bonded interactions */
119 <    static SwitchingFunctionType sft_;/**< Type of switching function in use */
120 <    static RealType listRadius_;      /**< Verlet neighbor list radius */
121 <    static RealType skinThickness_;   /**< Verlet neighbor list skin thickness */    
122 <
123 <    static RealType vdwScale_[4];
124 <    static RealType electrostaticScale_[4];
125 <  
126 <    static map<int, AtomType*> typeMap_;
102 >    SimInfo* info_;
103 >    LJ* lj_;
104 >    GB* gb_;
105 >    Sticky* sticky_;
106 >    EAM* eam_;
107 >    SC* sc_;
108 >    Morse* morse_;
109 >    Electrostatic* electrostatic_;
110 >    RepulsivePower* repulsivePower_;
111 >    MAW* maw_;
112 >    
113 >    map<int, AtomType*> typeMap_;
114      /**
115       * Each pair of atom types can have multiple interactions, so the
116       * natural data structures are a map between the pair, and a set
117       * of non-bonded interactions.
118       */
119 <    static map<pair<AtomType*, AtomType*>, set<NonBondedInteraction*> > interactions_;    
119 >    map<pair<AtomType*, AtomType*>, set<NonBondedInteraction*> > interactions_;
120 >    map<pair<AtomType*, AtomType*>, int> iHash_;
121 >
122    };
123   }
124   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines