Discrete and continuous deformation during nanoindentation of thin films