Thermomechanical behaviour of a damageable beam in contact with two stops