Magnetization-vector analogy as a reformulation of the equations of fluid dynamics