A damage model for the hysteresis of shape memory materials