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). |
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 |
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 |
|
/** |
64 |
|
* @class InteractionManager InteractionManager is responsible for |
65 |
< |
* keeping track of the non-bonded interactions (C++) and providing |
70 |
< |
* an interface to the low-level loop (Fortran). |
65 |
> |
* keeping track of the non-bonded interactions (C++) |
66 |
|
*/ |
67 |
|
class InteractionManager { |
68 |
|
|
69 |
|
public: |
70 |
< |
static InteractionManager* Instance(); |
71 |
< |
static void setSimInfo(SimInfo* info) {info_ = info;} |
72 |
< |
static void initialize(); |
70 |
> |
InteractionManager(); |
71 |
> |
~InteractionManager(); |
72 |
> |
void setSimInfo(SimInfo* info) {info_ = info;} |
73 |
> |
void initialize(); |
74 |
|
|
75 |
|
// Fortran support routines |
76 |
|
|
77 |
< |
static void doPrePair(InteractionData idat); |
78 |
< |
static void doPreForce(SelfData sdat); |
79 |
< |
static void doPair(InteractionData idat); |
80 |
< |
static void doSkipCorrection(InteractionData idat); |
81 |
< |
static void doSelfCorrection(SelfData sdat); |
82 |
< |
static RealType getSuggestedCutoffRadius(int *atid1); |
83 |
< |
static RealType getSuggestedCutoffRadius(AtomType *atype); |
84 |
< |
SwitchingFunction* getSwitchingFunction() {return switcher_;} |
77 |
> |
void doPrePair(InteractionData idat); |
78 |
> |
void doPreForce(SelfData sdat); |
79 |
> |
void doPair(InteractionData idat); |
80 |
> |
void doSkipCorrection(InteractionData idat); |
81 |
> |
void doSelfCorrection(SelfData sdat); |
82 |
> |
void setCutoffRadius(RealType rCut); |
83 |
> |
void setSwitchingRadius(RealType rSwitch); |
84 |
> |
RealType getSuggestedCutoffRadius(int *atid1); |
85 |
> |
RealType getSuggestedCutoffRadius(AtomType *atype); |
86 |
|
|
87 |
|
private: |
88 |
< |
virtual ~InteractionManager() { } |
92 |
< |
// singleton pattern, prevent reconstruction |
93 |
< |
InteractionManager() { } |
94 |
< |
InteractionManager(InteractionManager const&) {}; |
95 |
< |
InteractionManager& operator=(InteractionManager const&) {}; |
96 |
< |
static InteractionManager* _instance; |
88 |
> |
bool initialized_; |
89 |
|
|
90 |
< |
static bool initialized_; |
90 |
> |
void setupElectrostatics(); |
91 |
|
|
92 |
< |
static void setupCutoffs(); |
93 |
< |
static void setupSwitching(); |
94 |
< |
static void setupElectrostatics(); |
95 |
< |
|
96 |
< |
static SimInfo* info_; |
97 |
< |
static LJ* lj_; |
98 |
< |
static GB* gb_; |
99 |
< |
static Sticky* sticky_; |
100 |
< |
static EAM* eam_; |
101 |
< |
static SC* sc_; |
102 |
< |
static Morse* morse_; |
103 |
< |
static Electrostatic* electrostatic_; |
112 |
< |
static MAW* maw_; |
113 |
< |
static SwitchingFunction* switcher_; |
114 |
< |
|
115 |
< |
static RealType rCut_; /**< cutoff radius for non-bonded interactions */ |
116 |
< |
static RealType rSwitch_; /**< inner radius of switching function */ |
117 |
< |
static CutoffMethod cutoffMethod_;/**< Cutoff Method for most non-bonded interactions */ |
118 |
< |
static SwitchingFunctionType sft_;/**< Type of switching function in use */ |
119 |
< |
|
120 |
< |
static RealType vdwScale_[4]; |
121 |
< |
static RealType electrostaticScale_[4]; |
122 |
< |
|
123 |
< |
static map<int, AtomType*> typeMap_; |
92 |
> |
SimInfo* info_; |
93 |
> |
LJ* lj_; |
94 |
> |
GB* gb_; |
95 |
> |
Sticky* sticky_; |
96 |
> |
EAM* eam_; |
97 |
> |
SC* sc_; |
98 |
> |
Morse* morse_; |
99 |
> |
Electrostatic* electrostatic_; |
100 |
> |
RepulsivePower* repulsivePower_; |
101 |
> |
MAW* maw_; |
102 |
> |
|
103 |
> |
map<int, AtomType*> typeMap_; |
104 |
|
/** |
105 |
|
* Each pair of atom types can have multiple interactions, so the |
106 |
|
* natural data structures are a map between the pair, and a set |
107 |
|
* of non-bonded interactions. |
108 |
|
*/ |
109 |
< |
static map<pair<AtomType*, AtomType*>, set<NonBondedInteraction*> > interactions_; |
109 |
> |
map<pair<AtomType*, AtomType*>, set<NonBondedInteraction*> > interactions_; |
110 |
|
}; |
111 |
|
} |
112 |
|
#endif |