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

Comparing branches/development/src/nonbonded/LJ.hpp (file contents):
Revision 1483 by gezelter, Tue Jul 27 21:17:31 2010 UTC vs.
Revision 1850 by gezelter, Wed Feb 20 15:39:39 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_LJ_HPP
44   #define NONBONDED_LJ_HPP
45  
46 < #include "types/AtomType.hpp"
47 < #include "UseTheForce/ForceField.hpp"
46 > #include "nonbonded/NonBondedInteraction.hpp"
47 > #include "brains/ForceField.hpp"
48   #include "math/Vector3.hpp"
49  
50 + using namespace std;
51   namespace OpenMD {
52  
53    struct LJInteractionData {
# Line 55 | Line 57 | namespace OpenMD {
57      bool explicitlySet;
58    };
59  
60 <  class LJ {
60 >  class LJ : public VanDerWaalsInteraction {
61      
62    public:    
63 <    static LJ* Instance();
64 <    static void setForceField(ForceField *ff) {forceField_ = ff;};
65 <    static void initialize();
66 <    static void addType(AtomType* atomType);
67 <    static void addExplicitInteraction(AtomType* atype1, AtomType* atype2, RealType sigma, RealType epsilon);
68 <    static void calcForce(AtomType* at1, AtomType* at2, const Vector3d d, const RealType rij, const RealType r2, const RealType rcut, const RealType sw, const RealType vdwMult, RealType &vpair, RealType &pot, Vector3d &f1);
69 <    static RealType getSigma(AtomType* atomType);
70 <    static RealType getEpsilon(AtomType* atomType);
69 <    
70 <    // Fortran support routines;
71 <    static RealType getSigma(int atid);
72 <    static RealType getEpsilon(int atid);
73 <    static void do_lj_pair(int *atid1, int *atid2, RealType *d, RealType *rij, RealType *r2, RealType *rcut, RealType *sw, RealType *vdwMult, RealType *vpair, RealType *pot, RealType *f1);
74 <    static void setLJDefaultCutoff(RealType *thisRcut, int *sP, int *sF);
75 <
63 >    LJ();
64 >    void setForceField(ForceField *ff) {forceField_ = ff;};
65 >    void addType(AtomType* atomType);
66 >    void addExplicitInteraction(AtomType* atype1, AtomType* atype2, RealType sigma, RealType epsilon);
67 >    virtual void calcForce(InteractionData &idat);
68 >    virtual string getName() {return name_;}
69 >    virtual RealType getSuggestedCutoffRadius(pair<AtomType*, AtomType*> atypes);    
70 >            
71    private:
72 <    virtual ~LJ() { }
73 <    // singleton pattern, prevent reconstruction
74 <    LJ() { }
80 <    LJ(LJ const &) {};
81 <    LJ& operator=(LJ const&) {};
82 <    static LJ* _instance;
83 <  
84 <    static LJParam  getLJParam(AtomType* atomType);
85 <    static RealType getSigma(AtomType* atomType1, AtomType* atomType2);
86 <    static RealType getEpsilon(AtomType* atomType1, AtomType* atomType2);
72 >    void initialize();
73 >    RealType getSigma(AtomType* atomType1, AtomType* atomType2);
74 >    RealType getEpsilon(AtomType* atomType1, AtomType* atomType2);
75      
76 <    static void getLJfunc(const RealType r, RealType &pot, RealType &deriv);
89 <
90 <    static bool initialized_;
91 <    // LJMap will be used for providing access from Fortran.
92 <    // All of the C++ native classes should use AtomType*, but the
93 <    // fortran calls use int, so we need to look these up first before
94 <    // we can do anything else;
95 <    static std::map<int, AtomType*> LJMap;
96 <    static std::map<std::pair<AtomType*, AtomType*>, LJInteractionData> MixingMap;
97 <    static bool shiftedPot_;
98 <    static bool shiftedFrc_;
99 <    static ForceField* forceField_;
76 >    void getLJfunc(const RealType r, RealType &pot, RealType &deriv);
77      
78 +    bool initialized_;
79 +
80 +    map<int, AtomType*> LJMap;
81 +    map<pair<AtomType*, AtomType*>, LJInteractionData> MixingMap;
82 +    ForceField* forceField_;
83 +    string name_;
84    };
85   }
86  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines