  In a previous paper a method was developed to subtract the interactions due
to periodically replicated charges (or other long-range entities) in one
spatial dimension. The method constitutes a generalized "electrostatic layer
correction" (ELC) which adapts any standard 3D summation method to slab-like
conditions. Here the implementation of the layer correction is considered in
detail for the standard Ewald (EW3DLC) and the PPPM mesh Ewald (PPPMLC)
methods. In particular this method offers a strong control on the accuracy and
an improved computational complexity of O(N log N) for mesh-based
implementations. We derive anisotropic Ewald error formulas and give some
fundamental guidelines for optimization. A demonstration of the accuracy, error
formulas and computation times for typical systems is also presented.
