Commit a04711b2 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

do not allow pairwise cutoffs <= 0.0. avoids undefined behavior and division by zero errors

parent e084d4da
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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) {