Gravar-mail: Electrostatic interactions between ions near Thomas-Fermi substrates and the surface energy of ionic crystal at imperfect metals