Numerical Methods for Nonsmooth Dynamical Systems