The stress in ion-plated HfN and TiN coatings