Kspace energy between groups for slab geometry

Hi LAMMPS users,

LAMMPS threw out the error “ERROR: Cannot (yet) use Kspace slab correction with compute group/group (…/ewald.cpp:1210)” when doing slab geometry structures.

Based on my knowledge the major difference between 3D and 2D Ewald sum in LAMMPS, except the different volume, is the additional shape-dependent term (U=2PISUM(qizi)^2/Volume). As so the energy between two groups should be equal to energy from 3D Ewald sum plus 2PISUM_groupA(qizi)SUM_groupB(qizi)/Volume, similar to that in pe/atom calculation. This only needs a few lines to be added to current code.

My question is whether there are other reasons that Lammps does not allow this calculation.

Thank you.


Stan can answer this …