avoid division by zero when using cutoff 0.0 with pair_modify shift yes

This commit is contained in:
Axel Kohlmeyer
2017-07-14 23:33:00 -04:00
parent 3f297382ac
commit 4ec07422f0
42 changed files with 97 additions and 88 deletions

View File

@ -243,7 +243,7 @@ double PairBorn::init_one(int i, int j)
born2[i][j] = 6.0*c[i][j];
born3[i][j] = 8.0*d[i][j];
if (offset_flag) {
if (offset_flag && (cut[i][j] > 0.0)) {
double rexp = exp((sigma[i][j]-cut[i][j])*rhoinv[i][j]);
offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut[i][j],6.0) +
d[i][j]/pow(cut[i][j],8.0);