Determination of the effective dielectric constant from the accurate solution of the Poisson equation