| 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 |
> |
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 |