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 PairNMCut::init_one(int i, int j)
r0n[i][j] = pow(r0[i][j],nn[i][j]);
r0m[i][j] = pow(r0[i][j],mm[i][j]);
if (offset_flag) {
if (offset_flag && (cut[i][j] > 0.0)) {
offset[i][j] = e0nm[i][j] *
((mm[i][j]*r0n[i][j] / pow(cut[i][j],nn[i][j])) -
(nn[i][j]*r0m[i][j] / pow(cut[i][j],mm[i][j])));