Commit 8f145118 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

avoid division by zero by initializing unset (=automatic) g_ewald parameters to some number > 0.

parent 396e0b54
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -380,6 +380,12 @@ void PPPMDisp::init()
    alpha = qdist / (cos(0.5*theta) * blen);
  }

  //if g_ewald and g_ewald_6 have not been specified, set some initial value
  //  to avoid problems when calculating the energies!

  if (!gewaldflag) g_ewald = 1;
  if (!gewaldflag_6) g_ewald_6 = 1;

  // initialize the pair style to get the coefficients

  neighrequest_flag = 0;
@@ -387,12 +393,6 @@ void PPPMDisp::init()
  neighrequest_flag = 1;
  init_coeffs();

  //if g_ewald and g_ewald_6 have not been specified, set some initial value
  //  to avoid problems when calculating the energies!

  if (!gewaldflag) g_ewald = 1;
  if (!gewaldflag_6) g_ewald_6 = 1;

  // set accuracy (force units) from accuracy_relative or accuracy_absolute

  if (accuracy_absolute >= 0.0) accuracy = accuracy_absolute;