Analysis of the stress distribution in thermal barrier coatings