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 1505 by gezelter, Sun Oct 3 22:18:59 2010 UTC vs.
Revision 1576 by gezelter, Wed Jun 8 16:05:07 2011 UTC

# Line 44 | Line 44
44  
45   #include "brains/SimInfo.hpp"
46   #include "types/AtomType.hpp"
47 #include "UseTheForce/ForceField.hpp"
47   #include "nonbonded/LJ.hpp"
48   #include "nonbonded/GB.hpp"
49   #include "nonbonded/Sticky.hpp"
# Line 52 | Line 51
51   #include "nonbonded/SC.hpp"
52   #include "nonbonded/Morse.hpp"
53   #include "nonbonded/Electrostatic.hpp"
54 + #include "nonbonded/MAW.hpp"
55 + #include "nonbonded/SwitchingFunction.hpp"
56  
57   using namespace std;
58  
59   namespace OpenMD {
60 +
61    /**
62     * @class InteractionManager InteractionManager is responsible for
63 <   * keeping track of the non-bonded interactions (C++) and providing
62 <   * an interface to the low-level loop (Fortran).
63 >   * keeping track of the non-bonded interactions (C++)
64     */
65    class InteractionManager {
66  
67    public:
68 <    static InteractionManager* Instance();
69 <    static void setForceField(ForceField *ff) {forceField_ = ff;};    
68 >    InteractionManager();
69 >    ~InteractionManager();
70 >    void setSimInfo(SimInfo* info) {info_ = info;}
71 >    void initialize();
72  
70
71
73      // Fortran support routines
74  
75 <    static void doPrePair(int *atid1, int *atid2, RealType *rij, RealType *rho_i_at_j, RealType *rho_j_at_i);
76 <    static void doPreForce(int *atid, RealType *rho, RealType *frho, RealType *dfrhodrho);
77 <    static void doPair(int *atid1, int *atid2, RealType *d, RealType *r, RealType *r2, RealType *rcut, RealType *sw, RealType *vdwMult,RealType *electroMult, 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);    
78 <    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);
79 <    static void doSelfCorrection(int *atid, RealType *eFrame, RealType *skippedCharge, RealType *pot, RealType *t);
80 <    static RealType getSuggestedCutoffRadius(int *atid1);  
75 >    void doPrePair(InteractionData idat);
76 >    void doPreForce(SelfData sdat);
77 >    void doPair(InteractionData idat);    
78 >    void doSkipCorrection(InteractionData idat);
79 >    void doSelfCorrection(SelfData sdat);
80 >    RealType getSuggestedCutoffRadius(int *atid1);  
81 >    RealType getSuggestedCutoffRadius(AtomType *atype);
82      
83    private:
84 <    virtual ~InteractionManager() { }
83 <    // singleton pattern, prevent reconstruction
84 <    InteractionManager() { }
85 <    InteractionManager(InteractionManager const&) {};
86 <    InteractionManager& operator=(InteractionManager const&) {};
87 <    static InteractionManager* _instance;
84 >    bool initialized_;
85  
86 <    static void initialize();
90 <    static bool initialized_;
86 >    void setupElectrostatics();
87  
88 <    static ForceField* forceField_;
89 <    static LJ* lj_;
90 <    static GB* gb_;
91 <    static Sticky* sticky_;
92 <    static EAM* eam_;
93 <    static SC* sc_;
94 <    static Morse* morse_;
95 <    static Electrostatic* electrostatic_;
96 <
97 <    static map<int, AtomType*> typeMap_;
88 >    SimInfo* info_;
89 >    LJ* lj_;
90 >    GB* gb_;
91 >    Sticky* sticky_;
92 >    EAM* eam_;
93 >    SC* sc_;
94 >    Morse* morse_;
95 >    Electrostatic* electrostatic_;
96 >    MAW* maw_;
97 >    
98 >    map<int, AtomType*> typeMap_;
99      /**
100       * Each pair of atom types can have multiple interactions, so the
101       * natural data structures are a map between the pair, and a set
102       * of non-bonded interactions.
103       */
104 <    static map<pair<AtomType*, AtomType*>, set<NonBondedInteraction*> > interactions_;
108 <    
104 >    map<pair<AtomType*, AtomType*>, set<NonBondedInteraction*> > interactions_;    
105    };
106   }
107   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines