Numerical calculations of discontinuities by shape preserving splines