fix bug in pair style tersoff/zbl/omp

This commit is contained in:
Axel Kohlmeyer 2020-05-27 10:53:29 -04:00
parent b5b66d0e78
commit 7c9ad91d8f
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 5 additions and 5 deletions

View File

@ -88,7 +88,7 @@ void PairTersoffZBLOMP::read_file(char *file)
memory->sfree(params);
params = NULL;
nparams = 0;
nparams = maxparam = 0;
// open file on proc 0
@ -204,8 +204,7 @@ void PairTersoffZBLOMP::read_file(char *file)
params[nparams].powermint = int(params[nparams].powerm);
if (
params[nparams].c < 0.0 ||
if (params[nparams].c < 0.0 ||
params[nparams].d < 0.0 ||
params[nparams].powern < 0.0 ||
params[nparams].beta < 0.0 ||
@ -214,6 +213,7 @@ void PairTersoffZBLOMP::read_file(char *file)
params[nparams].bigr < 0.0 ||
params[nparams].bigd < 0.0 ||
params[nparams].bigd > params[nparams].bigr ||
params[nparams].lam1 < 0.0 ||
params[nparams].biga < 0.0 ||
params[nparams].powerm - params[nparams].powermint != 0.0 ||
(params[nparams].powermint != 3 &&
@ -287,8 +287,8 @@ void PairTersoffZBLOMP::repulsive(Param *param, double rsq, double &fforce,
0.9423*0.5099*exp(-0.9423*r_ov_a) -
0.4029*0.2802*exp(-0.4029*r_ov_a) -
0.2016*0.02817*exp(-0.2016*r_ov_a));
double fforce_ZBL = premult*-rsq* phi + premult/r*dphi;
double eng_ZBL = premult/r*phi;
double fforce_ZBL = premult*-phi/rsq + premult*dphi/r;
double eng_ZBL = premult*(1.0/r)*phi;
// combine two parts with smoothing by Fermi-like function