  Numerically simulating magnetohydrodynamics (MHD) poses notable challenges,
including the suppression of spurious oscillations near discontinuities (e.g.,
shocks) and preservation of essential physical structures (e.g., the
divergence-free constraint of magnetic field and the positivity of density and
pressure). This paper develops structure-preserving oscillation-eliminating
discontinuous Galerkin (OEDG) schemes for ideal MHD. The schemes leverage a
locally divergence-free (LDF) oscillation-eliminating (OE) procedure to
suppress spurious oscillations while retaining the LDF property of magnetic
field and many desirable attributes of original DG schemes, such as
conservation, local compactness, and optimal convergence rates. The OE
procedure is based on the solution operator of a novel damping equation, a
linear system of ordinary differential equations that are exactly solvable
without any discretization. The OE procedure is performed after each
Runge-Kutta stage and does not impact DG spatial discretization, facilitating
its easy integration into existing DG codes as an independent module. Moreover,
this paper presents a rigorous positivity-preserving (PP) analysis of the LDF
OEDG schemes on Cartesian meshes, utilizing the optimal convex decomposition
technique and the geometric quasi-linearization (GQL) approach. Efficient PP
LDF OEDG schemes are derived by incorporating appropriate discretization of
Godunov-Powell source terms into only the discrete equations of cell averages,
under a condition achievable through a simple PP limiter. Several one- and
two-dimensional MHD tests verify the accuracy, effectiveness, and robustness of
the proposed structure-preserving OEDG schemes.
