Curvature energy of nuclei, electronic excitations of carbon clusters, and thermal properties of sodium clusters