Self-consistent calculation of work function, charge densities, and local densities of states for Cu(100)