The Onsager principle and physics preserving numerical schemes | Synapse