Merge pull request #1101 from Pakketeretet2/bugfix-pair-morse-smooth-linear
Bugfix pair morse smooth linear
This commit is contained in:
@ -30,7 +30,6 @@ using namespace LAMMPS_NS;
|
||||
PairMorseSmoothLinear::PairMorseSmoothLinear(LAMMPS *lmp) : Pair(lmp)
|
||||
{
|
||||
writedata = 1;
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -117,7 +116,7 @@ void PairMorseSmoothLinear::compute(int eflag, int vflag)
|
||||
|
||||
if (eflag) {
|
||||
evdwl = d0[itype][jtype] * (dexp*dexp - 2.0*dexp) -
|
||||
offset[itype][jtype];
|
||||
offset[itype][jtype];
|
||||
evdwl -= ( r - cut[itype][jtype] ) * der_at_cutoff[itype][jtype];
|
||||
evdwl *= factor_lj;
|
||||
}
|
||||
@ -203,6 +202,14 @@ void PairMorseSmoothLinear::coeff(int narg, char **arg)
|
||||
alpha[i][j] = alpha_one;
|
||||
r0[i][j] = r0_one;
|
||||
cut[i][j] = cut_one;
|
||||
|
||||
morse1[i][j] = 2.0*d0[i][j]*alpha[i][j];
|
||||
|
||||
double alpha_dr = -alpha[i][j] * (cut[i][j] - r0[i][j]);
|
||||
|
||||
offset[i][j] = d0[i][j] * (exp(2.0*alpha_dr) - 2.0*exp(alpha_dr));
|
||||
der_at_cutoff[i][j] = -2.0*alpha[i][j]*d0[i][j] * (exp(2.0*alpha_dr) - exp(alpha_dr));
|
||||
|
||||
setflag[i][j] = 1;
|
||||
count++;
|
||||
}
|
||||
@ -222,17 +229,13 @@ double PairMorseSmoothLinear::init_one(int i, int j)
|
||||
|
||||
morse1[i][j] = 2.0*d0[i][j]*alpha[i][j];
|
||||
|
||||
double alpha_dr = -alpha[i][j] * (cut[i][j] - r0[i][j]);
|
||||
|
||||
offset[i][j] = d0[i][j] * (exp(2.0*alpha_dr) - 2.0*exp(alpha_dr));
|
||||
der_at_cutoff[i][j] = -2.0*alpha[i][j]*d0[i][j] * (exp(2.0*alpha_dr) - exp(alpha_dr));
|
||||
|
||||
d0[j][i] = d0[i][j];
|
||||
alpha[j][i] = alpha[i][j];
|
||||
r0[j][i] = r0[i][j];
|
||||
morse1[j][i] = morse1[i][j];
|
||||
der_at_cutoff[j][i] = der_at_cutoff[i][j];
|
||||
offset[j][i] = offset[i][j];
|
||||
cut[j][i] = cut[i][j];
|
||||
|
||||
return cut[i][j];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user