  Recently, an extended version of magnetohydrodynamics that incorporates
electron inertia, dubbed inertial magnetohydrodynamics, has been proposed. This
model features a noncanonical Hamiltonian formulation with a number of
conserved quantities, including the total energy and modified versions of
magnetic and cross helicity. In this work, a variational integrator is
presented which preserves these conservation laws to machine accuracy. As long
as effects due to finite electron mass are neglected, the scheme preserves the
magnetic field line topology so that unphysical reconnection is absent. Only
when effects of finite electron mass are added, magnetic reconnection takes
place. The excellent conservation properties of the method are illustrated by
numerical examples in 2D.
