| 50 |
|
namespace OpenMD { |
| 51 |
|
|
| 52 |
|
struct EAMAtomData { |
| 53 |
< |
CubicSpline rho; |
| 54 |
< |
CubicSpline F; |
| 55 |
< |
CubicSpline Z; |
| 53 |
> |
CubicSpline* rho; |
| 54 |
> |
CubicSpline* F; |
| 55 |
> |
CubicSpline* Z; |
| 56 |
|
RealType rcut; |
| 57 |
|
}; |
| 58 |
|
|
| 59 |
|
struct EAMInteractionData { |
| 60 |
< |
CubicSpline phi; |
| 60 |
> |
CubicSpline* phi; |
| 61 |
|
bool explicitlySet; |
| 62 |
|
}; |
| 63 |
|
|
| 76 |
|
static void addType(AtomType* atomType); |
| 77 |
|
static void addExplicitInteraction(AtomType* atype1, AtomType* atype2, RealType dr, int nr, std::vector<RealType> phiAB); |
| 78 |
|
|
| 79 |
< |
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); |
| 79 |
> |
static void calcDensity(AtomType* at1, AtomType* at2, const RealType rij, RealType &rho_i_at_j, RealType &rho_j_at_i); |
| 80 |
|
|
| 81 |
< |
static void calcFunctional(AtomType* at1, const RealType rho, RealType frho, RealType* dfrhodrho); |
| 81 |
> |
static void calcFunctional(AtomType* at1, const RealType rho, RealType &frho, RealType &dfrhodrho); |
| 82 |
|
|
| 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); |
| 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); |
| 86 |
> |
static void calc_eam_prepair_rho(int *atid1, int *atid2, RealType *rij, 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 |
+ |
static RealType getEAMcut(int *atid1); |
| 91 |
|
|
| 92 |
|
private: |
| 93 |
|
virtual ~EAM() { } |
| 97 |
|
EAM& operator=(EAM const&) {}; |
| 98 |
|
static EAM* _instance; |
| 99 |
|
|
| 100 |
< |
EAMParam getEAMParam(AtomType* atomType); |
| 101 |
< |
CubicSpline* getZ(AtomType* atomType); |
| 102 |
< |
CubicSpline* getRho(AtomType* atomType); |
| 103 |
< |
CubicSpline* getF(AtomType* atomType); |
| 104 |
< |
CubicSpline* getPhi(AtomType* atomType1, AtomType* atomType2); |
| 100 |
> |
static EAMParam getEAMParam(AtomType* atomType); |
| 101 |
> |
static CubicSpline* getZ(AtomType* atomType); |
| 102 |
> |
static CubicSpline* getRho(AtomType* atomType); |
| 103 |
> |
static CubicSpline* getF(AtomType* atomType); |
| 104 |
> |
static RealType getRcut(AtomType* atomType); |
| 105 |
> |
static CubicSpline* getPhi(AtomType* atomType1, AtomType* atomType2); |
| 106 |
|
|
| 107 |
|
static bool initialized_; |
| 108 |
|
static std::map<int, AtomType*> EAMlist; |