avoid uninitialized memory access when used with hybrid styles

This commit is contained in:
Axel Kohlmeyer 2020-01-07 11:14:22 -05:00
parent 7470a120bb
commit 4c974c6d5e
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 3 additions and 1 deletions

View File

@ -525,8 +525,10 @@ void PairLJCutCoulLongIntel::pack_force_const(ForceConst<flt_t> &fc,
double cut;
if (setflag[i][j] != 0 || (setflag[i][i] != 0 && setflag[j][j] != 0))
cut = init_one(i, j);
else
else { // need to set cutsq and cut_ljsq for hybrid pair_style
cut = 0.0;
cut_ljsq[i][j] = cut_ljsq[j][i] = 0.0;
}
cutsq[i][j] = cutsq[j][i] = cut*cut;
}
}