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

Comparing branches/development/src/nonbonded/EAM.hpp (file contents):
Revision 1478 by gezelter, Fri Jul 23 20:45:40 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_EAM_HPP
44   #define NONBONDED_EAM_HPP
45  
46 + #include "nonbonded/NonBondedInteraction.hpp"
47   #include "types/AtomType.hpp"
48   #include "UseTheForce/ForceField.hpp"
49   #include "math/Vector3.hpp"
# Line 50 | Line 52 | namespace OpenMD {
52   namespace OpenMD {
53  
54    struct EAMAtomData {
55 <    CubicSpline rho;
56 <    CubicSpline F;
57 <    CubicSpline Z;
55 >    CubicSpline* rho;
56 >    CubicSpline* F;
57 >    CubicSpline* Z;
58      RealType rcut;
59    };
60    
61    struct EAMInteractionData {
62 <    CubicSpline phi;
62 >    CubicSpline* phi;
63      bool explicitlySet;
64    };
65    
# Line 67 | Line 69 | namespace OpenMD {
69      eamUnknown
70    };
71    
72 <  class EAM {
72 >  class EAM : public MetallicInteraction {
73      
74    public:    
75 <    static EAM* Instance();
76 <    static void setForceField(ForceField *ff) {forceField_ = ff;};
77 <    static void initialize();
78 <    static void addType(AtomType* atomType);
79 <    static void addExplicitInteraction(AtomType* atype1, AtomType* atype2, RealType dr, int nr, std::vector<RealType> phiAB);
80 <    
81 <    static void calcDensity(AtomType* at1, AtomType* at2, const Vector3d d, const RealType rij, const RealType r2, RealType rho_i_at_j, RealType rho_j_at_i);
75 >    EAM();
76 >    void setForceField(ForceField *ff) {forceField_ = ff;};
77 >    void addType(AtomType* atomType);
78 >    void addExplicitInteraction(AtomType* atype1, AtomType* atype2, RealType dr, int nr, std::vector<RealType> phiAB);
79 >    void calcDensity(InteractionData &idat);
80 >    void calcFunctional(SelfData &sdat);
81 >    void calcForce(InteractionData &idat);
82 >    virtual string getName() { return name_; }
83 >    virtual RealType getSuggestedCutoffRadius(pair<AtomType*,AtomType*> atypes);
84 >    void setCutoffRadius( RealType rCut );
85  
81    static void calcFunctional(AtomType* at1, const RealType rho, RealType frho, RealType* dfrhodrho);
86  
83    static void calcForce(AtomType* at1, AtomType* at2, const Vector3d d, const RealType rij, const RealType r2, const RealType sw, RealType &vpair, RealType &pot, Vector3d &f1, const RealType rho1, const RealType rho2, const RealType dfrho1, const RealType dfrho2, RealType fshift1, RealType fshift2);
84                          
85    // Fortran support routines;
86    static void calc_eam_prepair_rho(int *atid1, int *atid2, RealType *d, RealType *rij, RealType *r2, RealType* rho_i_at_j, RealType* rho_j_at_i);
87    static void calc_eam_preforce_Frho(int *atid1, RealType* rho, RealType* frho, RealType* dfrhodrho);
88    static void do_eam_pair(int *atid1, int *atid2, RealType *d, RealType *rij, RealType *r2,  RealType *sw, RealType *vpair, RealType *pot, RealType *f1, RealType* rho1, RealType* rho2, RealType* dfrho1, RealType* dfrho2, RealType* fshift1, RealType* fshift2);
89    static void setCutoffEAM(RealType *thisRcut);
90
87    private:
88 <    virtual ~EAM() { }
93 <    // singleton pattern, prevent reconstruction
94 <    EAM() { }
95 <    EAM(EAM const &) {};
96 <    EAM& operator=(EAM const&) {};
97 <    static EAM* _instance;
98 <  
88 >    void initialize();  
89      EAMParam getEAMParam(AtomType* atomType);
90      CubicSpline* getZ(AtomType* atomType);
91      CubicSpline* getRho(AtomType* atomType);
92      CubicSpline* getF(AtomType* atomType);
93 +    RealType getRcut(AtomType* atomType);
94      CubicSpline* getPhi(AtomType* atomType1, AtomType* atomType2);
95      
96 <    static bool initialized_;
97 <    static std::map<int, AtomType*> EAMlist;
98 <    static std::map<AtomType*, EAMAtomData> EAMMap;
99 <    static std::map<std::pair<AtomType*, AtomType*>, EAMInteractionData> MixingMap;
100 <    static ForceField* forceField_;
101 <    static RealType eamRcut_;
102 <    static EAMMixingMethod mixMeth_;    
96 >    bool initialized_;
97 >    bool haveCutoffRadius_;
98 >    std::map<int, AtomType*> EAMlist;
99 >    std::map<AtomType*, EAMAtomData> EAMMap;
100 >    std::map<std::pair<AtomType*, AtomType*>, EAMInteractionData> MixingMap;
101 >    ForceField* forceField_;
102 >    RealType eamRcut_;
103 >    EAMMixingMethod mixMeth_;    
104 >    string name_;
105      
106    };
107   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines