Thermomechanics of friction stir welding