inhomogeneous mesh calculation