Deformation charge distribution and total energy for perowskites