A model of the thermoelastic growth of martensite