Modeling of elastic thermal stresses in two materials joined by a graded layer