A crack in functionally gradient materials under thermal shock