Density functional theory applied to metallic nanoparticles