make checking for tersoff parameters consistent across all implementations

This commit is contained in:
Axel Kohlmeyer
2018-01-30 04:53:57 -05:00
parent 5e9d257ec2
commit 17d98d0915
6 changed files with 81 additions and 50 deletions

View File

@ -939,8 +939,10 @@ void PairTersoffTable::read_file(char *file)
params[nparams].beta = atof(words[10]);
params[nparams].lam2 = atof(words[11]);
params[nparams].bigb = atof(words[12]);
// current implementation is based on functional form
// of tersoff_2 as reported in the reference paper
double bigr = atof(words[13]);
double bigd = atof(words[14]);
params[nparams].cutoffR = bigr - bigd;
@ -948,15 +950,17 @@ void PairTersoffTable::read_file(char *file)
params[nparams].lam1 = atof(words[15]);
params[nparams].biga = atof(words[16]);
// currently only allow m exponent of 1 or 3
params[nparams].powermint = int(params[nparams].powerm);
if (params[nparams].c < 0.0 || params[nparams].d < 0.0 ||
params[nparams].powern < 0.0 || params[nparams].beta < 0.0 ||
params[nparams].lam2 < 0.0 || params[nparams].bigb < 0.0 ||
params[nparams].cutoffR < 0.0 ||params[nparams].cutoffS < 0.0 ||
if (params[nparams].c < 0.0 ||
params[nparams].d < 0.0 ||
params[nparams].powern < 0.0 ||
params[nparams].beta < 0.0 ||
params[nparams].lam2 < 0.0 ||
params[nparams].bigb < 0.0 ||
params[nparams].cutoffR < 0.0 ||
params[nparams].cutoffS < 0.0 ||
params[nparams].cutoffR > params[nparams].cutoffS ||
params[nparams].lam1 < 0.0 || params[nparams].biga < 0.0
params[nparams].lam1 < 0.0 ||
params[nparams].biga < 0.0
) error->all(FLERR,"Illegal Tersoff parameter");
// only tersoff_2 parametrization is implemented