diff --git a/src/KSPACE/pppm_disp.cpp b/src/KSPACE/pppm_disp.cpp index aa7dcc6b0c..f3bc0754c8 100755 --- a/src/KSPACE/pppm_disp.cpp +++ b/src/KSPACE/pppm_disp.cpp @@ -1137,7 +1137,8 @@ void PPPMDisp::compute(int eflag, int vflag) // 2d slab correction if (slabflag) slabcorr(eflag); - energy = energy_1 + energy_6; + if (function[0]) energy += energy_1; + if (function[1]) energy += energy_6; // convert atoms back from lamda to box coords @@ -4168,7 +4169,7 @@ void PPPMDisp::poisson_2s_ik(FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, } fft1_6->compute(work1_6,work1_6,1); - fft2_6->compute(work2_6,work2_6,1); + fft1_6->compute(work2_6,work2_6,1); double s2 = scaleinv*scaleinv; @@ -4334,7 +4335,7 @@ void PPPMDisp::poisson_2s_ad(FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, } fft1_6->compute(work1_6,work1_6,1); - fft2_6->compute(work2_6,work2_6,1); + fft1_6->compute(work2_6,work2_6,1); double s2 = scaleinv*scaleinv; diff --git a/src/KSPACE/pppm_tip4p.cpp b/src/KSPACE/pppm_tip4p.cpp index 772c156a1e..528a3c1848 100644 --- a/src/KSPACE/pppm_tip4p.cpp +++ b/src/KSPACE/pppm_tip4p.cpp @@ -388,6 +388,7 @@ void PPPMTIP4P::fieldforce_peratom() // (dx,dy,dz) = distance to "lower left" grid pt // (mx,my,mz) = global coords of moving stencil pt // ek = 3 components of E-field on particle + double *q = atom->q; double **x = atom->x; @@ -432,7 +433,6 @@ void PPPMTIP4P::fieldforce_peratom() } } - if (eflag_atom) { if (type[i] != typeO) { eatom[i] += q[i]*u_pa;