Conceptual analogies among statistical mechanics and classical or quantum mechanics have often appeared in the literature. For classical two-body mean-field models, such an analogy is based on the identification between the free energy of Curie-Weisstype magnetic models and the Hamilton-Jacobi action for a one-dimensional mechanical system. Similarly, the partition function plays the role of the wave function in quantum mechanics and satisfies the heat equation that plays, in this context, the role of the Schrödinger equation. We show that this identification can be remarkably extended to include a wider family of magnetic models that are classified by normal forms of suitable real algebraic dispersion curves. In all these cases, the model turns out to be completely solvable as the free energy as well as the order parameter are obtained as solutions of an integrable nonlinear PDE of Hamilton-Jacobi type. We observe that the mechanical analogue of these models can be viewed as the relativistic analogue of the Curie-Weiss model and this helps to clarify the connection between generalized self-averaging in statistical thermodynamics and the semiclassical dynamics of viscous conservation laws.