  Coronal heating has been a long-standing conundrum in solar physics. Parker's
conjecture that spontaneous current singularities lead to nanoflares that heat
the corona has been controversial. In ideal magnetohydrodynamics (MHD), can
genuine current singularities emerge from a smooth 3D line-tied magnetic field?
To numerically resolve this issue, the schemes employed must preserve magnetic
topology exactly to avoid artificial reconnection in the presence of singular
current densities. Structure-preserving numerical methods are favorable for
mitigating numerical dissipation, and variational integration is a powerful
machinery for deriving them. In this thesis, we develop variational integrators
for ideal MHD in Lagrangian labeling by discretizing Newcomb's Lagrangian on a
moving mesh using discretized exterior calculus. With the built-in frozen-in
equation, the schemes are free of artificial reconnection, hence optimal for
studying current singularity formation.
  Using this method, we first study a fundamental prototype problem in 2D, the
Hahm-Kulsrud-Taylor (HKT) problem. It considers the effect of boundary
perturbations on a 2D plasma magnetized by a sheared field, and its linear
solution is singular. We find that with increasing resolution, the nonlinear
solution converges to one with a current singularity. We then extend the HKT
problem to 3D line-tied geometry, which models the solar corona by anchoring
the field lines in the boundaries. The linear solution, which is singular in
2D, is found to be smooth. The nonlinear solution turns out smooth for short
systems. Nonetheless, the scaling of peak current density vs. system length
suggests that the nonlinear solution may become singular at a finite length.
With the results in hand, we cannot confirm or rule out this possibility
conclusively, since we cannot obtain solutions with system lengths near the
extrapolated critical value.
