Energy analysis of the buildings stocks. Scaling from national to regional and urban contexts