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

This commit is contained in:
Axel Kohlmeyer 2018-01-04 20:44:40 -05:00
parent 75f1a4f3f0
commit 5ecc3ce366
1 changed files with 1 additions and 0 deletions

View File

@ -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) *