Nonlinear thermal evolution in an inhomogeneous medium