A fundamental problem in plasma physics is understanding the evolution of magnetic fields with given initial data. Questions include whether a stationary state exists and, if so, what properties it possesses. The Parker hypothesis states that for ‘almost any initial data’, the evolution of magnetic fields develops tangential continuity. This hypothesis remains open and is related to problems such as coronal heating. The topology of magnetic field lines, particularly knots, imposes crucial constraints on the relaxation process. In this talk, we discuss the role of topology preservation, specifically helicity preservation, in computing the long-term evolution of incompressible magnetohydrodynamic (MHD) systems. We derive a scheme using finite element de Rham complexes and compare several methods numerically. In the presence of nontrivial cohomology, we provide a generalized definition of helicity.