A thermodynamic approach to analyze shear localization in semi-solid materials