52 |
|
#include "nonbonded/Morse.hpp" |
53 |
|
#include "nonbonded/Electrostatic.hpp" |
54 |
|
#include "nonbonded/MAW.hpp" |
55 |
+ |
#include "nonbonded/RepulsivePower.hpp" |
56 |
|
#include "nonbonded/SwitchingFunction.hpp" |
57 |
|
|
58 |
|
using namespace std; |
59 |
|
|
60 |
|
namespace OpenMD { |
60 |
– |
enum CutoffMethod { |
61 |
– |
HARD, |
62 |
– |
SWITCHED, |
63 |
– |
SHIFTED_POTENTIAL, |
64 |
– |
SHIFTED_FORCE |
65 |
– |
}; |
61 |
|
|
62 |
|
/** |
63 |
|
* @class InteractionManager InteractionManager is responsible for |
64 |
< |
* keeping track of the non-bonded interactions (C++) and providing |
70 |
< |
* an interface to the low-level loop (Fortran). |
64 |
> |
* keeping track of the non-bonded interactions (C++) |
65 |
|
*/ |
66 |
|
class InteractionManager { |
67 |
|
|
68 |
|
public: |
69 |
< |
static InteractionManager* Instance(); |
70 |
< |
static void setSimInfo(SimInfo* info) {info_ = info;} |
71 |
< |
static void initialize(); |
69 |
> |
InteractionManager(); |
70 |
> |
~InteractionManager(); |
71 |
> |
void setSimInfo(SimInfo* info) {info_ = info;} |
72 |
> |
void initialize(); |
73 |
|
|
74 |
|
// Fortran support routines |
75 |
|
|
76 |
< |
static void doPrePair(InteractionData idat); |
77 |
< |
static void doPreForce(SelfData sdat); |
78 |
< |
static void doPair(InteractionData idat); |
79 |
< |
static void doSkipCorrection(InteractionData idat); |
80 |
< |
static void doSelfCorrection(SelfData sdat); |
81 |
< |
static RealType getSuggestedCutoffRadius(int *atid1); |
82 |
< |
static RealType getSuggestedCutoffRadius(AtomType *atype); |
83 |
< |
SwitchingFunction* getSwitchingFunction() {return switcher_;} |
76 |
> |
void doPrePair(InteractionData idat); |
77 |
> |
void doPreForce(SelfData sdat); |
78 |
> |
void doPair(InteractionData idat); |
79 |
> |
void doSkipCorrection(InteractionData idat); |
80 |
> |
void doSelfCorrection(SelfData sdat); |
81 |
> |
void setCutoffRadius(RealType rCut); |
82 |
> |
void setSwitchingRadius(RealType rSwitch); |
83 |
> |
RealType getSuggestedCutoffRadius(int *atid1); |
84 |
> |
RealType getSuggestedCutoffRadius(AtomType *atype); |
85 |
|
|
86 |
|
private: |
87 |
< |
virtual ~InteractionManager() { } |
92 |
< |
// singleton pattern, prevent reconstruction |
93 |
< |
InteractionManager() { } |
94 |
< |
InteractionManager(InteractionManager const&) {}; |
95 |
< |
InteractionManager& operator=(InteractionManager const&) {}; |
96 |
< |
static InteractionManager* _instance; |
87 |
> |
bool initialized_; |
88 |
|
|
89 |
< |
static bool initialized_; |
89 |
> |
void setupElectrostatics(); |
90 |
|
|
91 |
< |
static void setupCutoffs(); |
92 |
< |
static void setupSwitching(); |
93 |
< |
static void setupElectrostatics(); |
94 |
< |
|
95 |
< |
static SimInfo* info_; |
96 |
< |
static LJ* lj_; |
97 |
< |
static GB* gb_; |
98 |
< |
static Sticky* sticky_; |
99 |
< |
static EAM* eam_; |
100 |
< |
static SC* sc_; |
101 |
< |
static Morse* morse_; |
102 |
< |
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_; |
91 |
> |
SimInfo* info_; |
92 |
> |
LJ* lj_; |
93 |
> |
GB* gb_; |
94 |
> |
Sticky* sticky_; |
95 |
> |
EAM* eam_; |
96 |
> |
SC* sc_; |
97 |
> |
Morse* morse_; |
98 |
> |
Electrostatic* electrostatic_; |
99 |
> |
RepulsivePower* repulsivePower_; |
100 |
> |
MAW* maw_; |
101 |
> |
|
102 |
> |
map<int, AtomType*> typeMap_; |
103 |
|
/** |
104 |
|
* Each pair of atom types can have multiple interactions, so the |
105 |
|
* natural data structures are a map between the pair, and a set |
106 |
|
* of non-bonded interactions. |
107 |
|
*/ |
108 |
< |
static map<pair<AtomType*, AtomType*>, set<NonBondedInteraction*> > interactions_; |
108 |
> |
map<pair<AtomType*, AtomType*>, set<NonBondedInteraction*> > interactions_; |
109 |
|
}; |
110 |
|
} |
111 |
|
#endif |