Fix potential integer overflow in PPPM
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user