do not allow pairwise cutoffs <= 0.0. avoids undefined behavior and division by zero errors
This commit is contained in:
@ -242,6 +242,7 @@ void Pair::init()
|
||||
for (i = 1; i <= atom->ntypes; i++)
|
||||
for (j = i; j <= atom->ntypes; j++) {
|
||||
cut = init_one(i,j);
|
||||
if (cut <= 0.0) error->all(FLERR,"Illegal pair style cutoff <= 0.0");
|
||||
cutsq[i][j] = cutsq[j][i] = cut*cut;
|
||||
cutforce = MAX(cutforce,cut);
|
||||
if (tail_flag) {
|
||||
|
||||
Reference in New Issue
Block a user