  We present a new code that performs a relaxation of a magnetic field towards
a force-free state (Beltrami field) using a Lagrangian numerical scheme.
Beltrami fields are of interest for the dynamics of many technical and
astrophysical plasmas as they are the lowest energy states that the magnetic
field can reach. The numerical method strictly preserves the magnetic flux and
the topology of magnetic field lines. In contrast to other implementations we
use mimetic operators for the spatial derivatives in order to improve accuracy
for high distortions of the grid. Compared with schemes using direct
derivatives we find that the final state of the simulation approximates a
force-free state with a significantly higher accuracy. We implement the scheme
in a code which runs on graphical processing units (GPU), which leads to an
enhanced computing speed compared to previous relaxation codes.
