Numerical simulation of inhomogeneous and nonlinear diffusion