A computational approach to thermomechanical fatigue