A notion of total variation depending on a metric with discontinuous coefficients