Graph neural networks informed locally by thermodynamics