Including the effects of pressure and stress in thermodynamic functions