Commit 5ecc3ce3 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

avoid division by zero when trying to run PPPM on a system without atoms

parent 75f1a4f3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1268,6 +1268,7 @@ double PPPM::compute_qopt()
double PPPM::estimate_ik_error(double h, double prd, bigint natoms)
{
  double sum = 0.0;
  if (natoms == 0) return 0.0;
  for (int m = 0; m < order; m++)
    sum += acons[order][m] * pow(h*g_ewald,2.0*m);
  double value = q2 * pow(h*g_ewald,(double)order) *