  A topological constraint on the dynamics of a magnetic field in a flux tube
arises from the fixed point indices of its field line mapping. This can explain
unexpected behaviour in recent resistive-magnetohydrodynamic simulations of
magnetic relaxation. Here we present the theory for a general periodic flux
tube, representing, for example, a toroidal confinement device or a solar
coronal loop. We show how an ideal dynamics on the side boundary of the tube
implies that the sum of indices over all interior fixed points is invariant.
This constraint applies to any continuous evolution inside the tube, which may
be turbulent and/or dissipative. We also consider the analogous invariants
obtained from periodic points (fixed points of the iterated mapping). Although
there is a countably infinite family of invariants, we show that they lead to
at most two independent dynamical constraints. The second constraint applies
only in certain magnetic configurations. Several examples illustrate the
theory.
