  The local approach to computing electrostatic interactions proposed by Maggs
and adapted by Pasichnyk for molecular dynamics simulations is extended to
situations where the dielectric background medium is inhomogeneous. We
furthermore correct a problem of the original algorithm related to the correct
treatment of the global dipole moment, provide an error estimate for the
accuracy of the algorithm, and suggest a different form of the treatment of the
self-energy problem. Our implementation is highly scalable on many cores, and
we have validated and compared its performance against theoretical predictions
and simulation data obtained by other algorithmic approaches.
