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 1665 by gezelter, Tue Nov 22 20:38:56 2011 UTC

# Line 36 | Line 36
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_LJ_HPP
44   #define NONBONDED_LJ_HPP
45  
46 + #include "nonbonded/NonBondedInteraction.hpp"
47   #include "types/AtomType.hpp"
48   #include "UseTheForce/ForceField.hpp"
49   #include "math/Vector3.hpp"
50  
51 + using namespace std;
52   namespace OpenMD {
53  
54    struct LJInteractionData {
# Line 55 | Line 58 | namespace OpenMD {
58      bool explicitlySet;
59    };
60  
61 <  class LJ {
61 >  class LJ : public VanDerWaalsInteraction {
62      
63    public:    
64 <    static LJ* Instance();
65 <    static void setForceField(ForceField *ff) {forceField_ = ff;};
66 <    static void initialize();
67 <    static void addType(AtomType* atomType);
68 <    static void addExplicitInteraction(AtomType* atype1, AtomType* atype2, RealType sigma, RealType epsilon);
69 <    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);
70 <    static RealType getSigma(AtomType* atomType);
71 <    static RealType getEpsilon(AtomType* atomType);
72 <    
73 <    // 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 <
64 >    LJ();
65 >    void setForceField(ForceField *ff) {forceField_ = ff;};
66 >    void addType(AtomType* atomType);
67 >    void addExplicitInteraction(AtomType* atype1, AtomType* atype2, RealType sigma, RealType epsilon);
68 >    RealType getSigma(AtomType* atomType);
69 >    RealType getEpsilon(AtomType* atomType);
70 >    virtual void calcForce(InteractionData &idat);
71 >    virtual string getName() {return name_;}
72 >    virtual RealType getSuggestedCutoffRadius(pair<AtomType*, AtomType*> atypes);    
73 >            
74    private:
75 <    virtual ~LJ() { }
76 <    // singleton pattern, prevent reconstruction
77 <    LJ() { }
78 <    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);
75 >    void initialize();
76 >    LJParam  getLJParam(AtomType* atomType);
77 >    RealType getSigma(AtomType* atomType1, AtomType* atomType2);
78 >    RealType getEpsilon(AtomType* atomType1, AtomType* atomType2);
79      
80 <    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_;
80 >    void getLJfunc(const RealType r, RealType &pot, RealType &deriv);
81      
82 +    bool initialized_;
83 +
84 +    map<int, AtomType*> LJMap;
85 +    map<pair<AtomType*, AtomType*>, LJInteractionData> MixingMap;
86 +    ForceField* forceField_;
87 +    string name_;
88    };
89   }
90  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines