Approximating the total variation with finite differences or finite elements (Handbook of numerical analysis)