Nonlinear calculation of a temperature profile produced in a two‐layer structure by a scanning cw elliptical laser or electron beam