diff --git a/src/KSPACE/pppm.cpp b/src/KSPACE/pppm.cpp index 2f5b4fc670..328c2c2362 100644 --- a/src/KSPACE/pppm.cpp +++ b/src/KSPACE/pppm.cpp @@ -1944,7 +1944,8 @@ void PPPM::poisson_ik() // global energy and virial contribution - double scaleinv = 1.0/(nx_pppm*ny_pppm*nz_pppm); + bigint ngridtotal = (bigint) nx_pppm * ny_pppm * nz_pppm; + double scaleinv = 1.0/(ngridtotal); double s2 = scaleinv*scaleinv; if (eflag_global || vflag_global) { @@ -2145,7 +2146,8 @@ void PPPM::poisson_ad() // global energy and virial contribution - double scaleinv = 1.0/(nx_pppm*ny_pppm*nz_pppm); + bigint ngridtotal = (bigint) nx_pppm * ny_pppm * nz_pppm; + double scaleinv = 1.0/(ngridtotal); double s2 = scaleinv*scaleinv; if (eflag_global || vflag_global) { @@ -3259,7 +3261,8 @@ void PPPM::poisson_groups(int AA_flag) // keep everything in reciprocal space so // no inverse FFTs needed - double scaleinv = 1.0/(nx_pppm*ny_pppm*nz_pppm); + bigint ngridtotal = (bigint) nx_pppm * ny_pppm * nz_pppm; + double scaleinv = 1.0/(ngridtotal); double s2 = scaleinv*scaleinv; // energy