Generalized Hamiltonian representation of thermo-mechanical systems based on an entropic formulation. (March 2017)