From 3293a669c11cd7d98e2b9dc1dd4e5fc613c439e4 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 19 Aug 2013 19:25:51 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@10601 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/USER-CUDA/pppm_cuda.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/USER-CUDA/pppm_cuda.cpp b/src/USER-CUDA/pppm_cuda.cpp index 565f59b747..6e09fde133 100644 --- a/src/USER-CUDA/pppm_cuda.cpp +++ b/src/USER-CUDA/pppm_cuda.cpp @@ -1425,7 +1425,10 @@ void PPPMCuda::slabcorr(int eflag) double e_slabcorr = 2.0*MY_PI*dipole_all*dipole_all/volume; - if (eflag) energy += qqrd2e*scale * e_slabcorr; + //if (eflag) energy += qqrd2e*scale * e_slabcorr; + // need to add a correction to make non-neutral systems and per-atom energy translationally invariant + if (eflag || fabs(qsum) > SMALL) + error->all(FLERR,"Cannot (yet) use slab correction with kspace_style pppm/cuda for non-neutral systems or to get per-atom energy. Aborting."); double ffact = -4.0*MY_PI*dipole_all/volume;