A generalized poloidal–toroidal decomposition and an absolute measure of helicity

In fluid mechanics and magneto-hydrodynamics it is often useful to decompose a vector field into poloidal and toroidal components. In a spherical geometry, the poloidal component contains all of the radial part of the field, while the curl of the toroidal component contains all of the radial current. This paper explores how they work in more general geometries, where space is foliated by nested simply connected surfaces. Vector fields can still be divided into poloidal and toroidal components, but in geometries lacking spherical symmetry it makes sense to further divide the poloidal field into a standard part and a ‘shape’ term, which in itself behaves like a toroidal field and arises from variations in curvature. The generalised P–T decomposition leads to a simple definition of helicity which does not rely on subtracting the helicity of a potential reference field. Instead, the helicity measures the net linking of the standard poloidal field with the toroidal field as well as the new shape field. This helicity is consistent with the relative helicity in spherical and planar geometries. Its time derivative due to motion of field lines in a surface has a simple and intuitively pleasing form.


Introduction
In ideal magneto-hydrodynamics, the magnetic field lines are frozen into the fluid-that is, they move like material curves transported by the fluid motion. Similarly, in inviscid fluid mechanics, the vorticity is frozen into the fluid. Several conservation laws result from this frozen-in condition. Magnetic flux conservation and the Helmholtz circulation theorem are the most familiar of these. Other conservation laws involve the topological structure of the conserved flux or vorticity. The most well-known of these is called magnetic helicity, which describes the net linking of pairs of field lines. Other invariants involve either weighted averages of these linkings, field-line helicities (essentially linking of one field line with the rest of the field) (Yeates and Hornig 2013), or higher order linking structures (Monastyrski andSasarov 1987, Berger 1990). In the presence of small resistivity, magnetic helicity is robust; its dissipation is governed by strict inequalities (Berger 1984). The higher order invariants, however, are generally much more fragile (Freedman and Berger 1993).
Decomposition of vector fields into orthogonal components (where the total energy equals the sum of the component energies) have proven useful in analysing field structure, evolution and equilibria, as well as in the study of solar, stellar, and planetary dynamos (Chandrasekhar and Kendall 1957). In the poloidal-toroidal decomposition (as in figure 1 below), at any spherical surface the poloidal field contains all of the normal magnetic field, whereas the curl of the toroidal field contains all of the normal electric current, e.g. Moffatt (1978). (This terminology should not be confused with toroidal-poloidal coordinates used in a torus geometry like a tokamak, where the toroidal direction winds the long way around, and the poloidal direction winds the short way.) Magnetic helicity was originally defined (Woltjer 1958) in terms of vector potentials, i.e. H = A · B d 3 x . Here ∇ × A = B has an infinite set of solutions, which differ from each other by gradient fields. In other words, the vector potential is defined only up to a gauge transformation A → A + ∇ψ for some function ψ. When integrated over a volume V bounded by a simply connected closed surface the gauge ambiguity vanishes: the answer is unique, and equivalent to equation (1). However, if the boundary surface is open then A · B d 3 x is not well-defined. A resolution of this difficulty was given in Berger and Field (1984), who suggested measuring helicity relative to a reference potential (zero electric current) field.
In the relative helicity formulation, one calculates the helicity of all space, including both V and its complement V ext . Next, one constructs a reference field consisting of a potential field (also called a vacuum field) in V, but the same outside field in V ext . Finally, the helicity of this reference field is subtracted from that of the original field. The result can then be shown to be independent of any details of the outside field, and is gauge-invariant. Several methods have been developed to simplify this calculation (e.g. choosing a convenient gauge, or in fact using the poloidal-toroidal decomposition). This formulation has a useful physical meaning: the relative helicity measures the extra amount of helicity generated by electrical currents within V. In particular, the relative helicity of a potential field is always 0. Sometimes other reference fields can be useful in elucidating the geometrical and topological properties of a magnetic region (Longcope and Malanushenko 2008).
Recently, however, some authors have found it useful to define an absolute helicity in open volumes, with out any comparison to a reference field. Low (2006Low ( , 2011Low ( , 2015 uses a form of the P-T decomposition with nested cylindrical surfaces, and finds that the poloidal field can have self linking. A complementary topological description of helicity is in terms of winding numbers between field lines (Berger and Prior 2006). Prior and Yeates (2014) consider a volume consisting of a tube extending between parallel planes, where the sides of the tube may form a distorted cylinder. The tube sides are magnetic surfaces, but not necessarily the top and bottom. They show that the net winding number summed over pairs of lines, even of a potential field within the volume, may not be zero. They find a gauge for A which reproduces the net winding. Their results are consistent with the relative helicity where the volume V is chosen to be the entire space between the two planes.
Consider a volume V which is bounded by a magnetic surface, where B ·n = 0 (so that all field lines within V are completely contained within V). We wish to define the closed magnetic helicity H closed of V as the net linking of the field lines. Linking number is a non-local quantity: given only knowledge about a small neighbourhood of a point in space, there is no way of knowing whether the field line passing through that point links any other field lines. Thus the magnetic helicity content of a volume V can not be expressed as a three dimensional volume integral of a local helicity density. Instead, it can be defined as a double (six-dimensional) integral: (Moffatt 1969, Arnol'd andKhesin 1998). The inner integral gives the vector potential A, in its Biot-Savart form (Cantarella et al 2001).
Interestingly, however, we can reduce the dimensionality by one. Our method will be to divide space up into parallel planes or concentric spheres (or later, a foliation using arbitrary simply connected surfaces). Let us first consider the planar case where V consists of all points lying between the planes z = z 0 and z = z 1 .
Imagine that we have two sets of field lines: the first set form rings in horizontal planes z = constant (these will be called toroidal lines); the second set pass through the planes without any vertical electrical current (these will be called poloidal lines). The condition on the poloidal lines means that the restriction of the poloidal field to any plane z = constant must be a gradient field. This special case of closed toroidal lines contained within parallel planes with poloidal lines crossing those planes is actually not so special: any vector field has a unique decomposition as a sum of toroidal and poloidal components (Chandrasekhar and Kendall 1957): given an arbitrary magnetic field, we write (2) A review of the properties of the poloidal-toroidal (or Chandrasekhar-Kendall) decomposition is given in section 2.
In any plane z = z 0 we can ask how much vertical poloidal flux is encircled by horizontal toroidal flux. This net linking of toroidal and poloidal flux can be written as a double (four dimensional) integral on the surface: To obtain the closed helicity over our volume, we add a fifth integral over z: suppose all field lines close between heights z = a and z = b. Then the planes at a and b are magnetic surfaces and Note that each surface integral F(z) is well defined. Thus we no longer need to specify integrating helicity over a closed volume. We can now define an open or absolute helicity H by integrating F(z) over any interval a z b, whether bounded by closed surfaces or not: In this way, we have removed the condition that the boundary of our volume V be a closed magnetic surface. Similar constructions can be made for nested spherical surfaces between two radii. Thus in any volume bounded by parallel planes or concentric spheres, we can express helicity as the net linking of toroidal and poloidal fields (Berger 1985, Low 2006, 2011, Low 2015. We could in fact extend these ideas (and will, in section 3) to arbitrary nested simply connected surfaces. In summary, we will show that a topologically meaningful helicity integral can be defined within any simply connected surface, whether magnetically closed or not, using a generalization of the poloidal-toroidal decomposition.
In section 2 we review the properties of the poloidal-toroidal decomposition in planar and spherical geometries. We pay special attention to the geometric interpretation of the poloidal and toroidal vector potentials, and how these lead naturally to measures of linking and twisting of fields which can be summed to give the magnetic helicity.
In section 3 we extend the poloidal-toroidal decomposition to asymmetric geometries. Special attention is paid to how the helicity changes. In particular, the poloidal field can now have self-helicity.
In section 4 the flux of helicity through boundaries is investigated in some detail. Every flux element piercing a closed boundary must return somewhere; otherwise the volume would contain magnetic monopoles. If we decompose a field into a set of flux elements, then it is useful to express the helicity flux in terms of the rotation of flux elements about each other. This requires defining a return flux for each element. The Gauss-Bonnet theorem will be employed here to give an appropriate distribution for this return flux. Conclusions will be given in section 5.

Review of the toroidal and poloidal field decomposition
In Cartesian or spherical geometries it is often useful to decompose a magnetic field B into toroidal and poloidal components B = B T + B P . We divide space into a set of parallel planes (perpendicular to ẑ) or a set of concentric spheres (perpendicular to r ). The principal criterion employed in the decomposition concerns the fluxes of magnetic field lines and electric current lines through the surfaces.
We will write the curl of the magnetic field B as electric current J = ∇ × B (setting µ 0 = 1 for simplicity). Let B n and J n be components of the fields normal to one of our surfaces. Then the poloidal magnetic field B P contains all of B n and the curl of the toroidal field contains all of J n , i.e.
In particular, the toroidal field lies entirely within one of the nested planar or spherical surfaces: letting ∇ be the gradient within a surface, Meanwhile, the poloidal field has a property which will be important in the theorems which follow. The surface components of B P form a gradient field: if they did not, then there would be a non-zero J n after taking the curl.

Some useful operators
The fields B P and B T are determined by the boundary data B n or J n . We can express this idea by defining the normal component of the curl as the operator Next consider its inverse operator D −1 : given a scalar function f (x, y) or f (θ, φ) on a planar or spherical surface, we specify that the inverse normal curl gives a divergence-free vector field parallel to the surface: This field is unique: if two fields V 1 and V 2 both satisfy these equations then V 2 − V 1 would be a gradient field, (V 2 − V 1 ) = ∇ ψ with zero divergence. Thus the two-dimensional Laplacian ∆ ψ = 0. For simply connected compact surfaces the only solutions are ψ = constant. For infinite surfaces we must also specify ∇ψ → 0 as r → ∞. Numerical details for solving V = D −1 f are given in section 3.3.
Hence we can write Apart from magnetic fields, other examples involving this operator correspond to finding a stream function for a scalar vorticity on the surface (e.g. Kimura and Okamoto (1987) and Boatto and Dritschel (1957)).
Secondly, let L be a derivative operator parallel to the surface: This operator will be useful in defining scalar potentials for the toroidal and poloidal fields. Note that we are not expressing L in terms of the unit normal n, as in Lf = ∇ × fn. We avoid using n because there is an ambiguity in calculating the vector ∇ ×n (see appendix B). The curl of the unit normal depends on how n is extended into a vector field outside S. There is always a natural extension for which ∇ ×n = 0, but simple examples exist of other extensions where the curl is non-zero. This difficulty should not cause problems in Cartesian or spherical geometries, but must be considered in the more arbitrary geometries we discuss later.

Toroidal and poloidal fields in planar and spherical geometries
Let us consider in detail how the toroidal and poloidal fields work in Cartesian and spherical coordinates. One can show that functions T and P (the toroidal and poloidal flux functions) exist where The two operators introduced here combine to give the two dimensional surface Laplacian ∆ : for example (with ∇r =r) We can employ the functions P and T to find suitable vector potentials of the poloidal field B P = ∇ × LP and the toroidal field B T = LT : On each surface the functions P and T are solutions of a Poisson equation. As DL = −∆ we have From equations (20) and (21), we can then find Green function solutions for P and T. For planes, The vector potential LP + Tr corresponding to these potentials is equivalent to the winding gauge given in Prior and Yeates (2014). For spheres (with the conditions that net radial field B r and net radial current J r both vanish), is the spherical distance between (θ, φ) and (θ , φ ) (Kimura and Okamoto 1987). Finally, note that all of the derivatives in the above equations only depend on surface coordinates. The normal derivatives (∂/∂z or ∂/∂r) come into play when we calculate the components of B P parallel to a surface. For example, in spherical geometries one finds We next list some important properties of the decomposition, derived for the spherical case. Planar geometries will give identical results.

Orthogonality
The poloidal and toroidal fields are orthogonal in the sense that over surfaces z = const. or r = const.
To see this, note that on each surface r = constant, But the integral of a 2-divergence over a closed compact surface is zero, by the two dimensional analogue of the Gauss theorem. For the planar case, we can require that B T and B P fall off faster than r −1/2 as r → ∞, to insure that the boundary integral converges to zero. As a consequence, the magnetic energy divides neatly into poloidal and toroidal contrib-

Helicity inside a magnetic surface
First consider the total helicity inside some magnetic surface (where B ·n = 0) at r = R. (For all space, we can let R → ∞ with |B| dropping sufficiently fast at infinity, |B| ∼ r −2− ). By specifying an outer magnetic surface, we ensure that all magnetic field lines close upon themselves (or if ergodic, come arbitrarily close to closing upon themselves). Then the helicity H measures the net linking of all pairs of field lines. The cross helicity of two fields B 1 and B 2 , both having magnetic surfaces at r = R, can be written as Two toroidal fields do not link each other.
as the toroidal field has no component perpendicular to the boundary. Note that adding a gradient field to A T1 makes no difference: In particular, the linking of a toroidal field with itself (its self helicity) always vanishes. For Cartesian and spherical geometries two poloidal fields do not link each other either; for example In summary, helicity can be interpreted as the net linking of poloidal and toroidal fields (see figure 1):

Helicity of open fields
Suppose we wish to compute the helicity in a volume not bounded by a magnetic surface. Then field lines cross the boundary and we need to think carefully about how to define linking of field lines which are not closed. We could simply give the linking of poloidal and toroidal flux, as in equation (35). The relative helicity integral provides another method of defining the helicity of open fields, by measuring how much currents within the volume twist and intertwine the field lines. For boundaries which are planar or spherical, it gives the same result as calculating the linking of poloidal and toroidal fields, as we will show. Let the volume in question be V, with space external to V labelled as V ext . Let the magnetic field be labelled B within V, and B ext outside V. We define a reference field to be the potential (or vacuum) field B pot inside V with the same external field B ext in V ext . We can now compare the helicity of all space calculated both for the real field and the reference field, and take the difference. One can readily show that this difference is independent of all details of the external field. Symbolically, we write The potential field is chosen as a reference as it has minimal structure, and minimizes the energy given the boundary data B ·n. The potential field is purely poloidal, as it has no currents. As poloidal fields do not link themselves inside a sphere, the reference helicity H({B pot , B ext }) vanishes for the part of the integral inside V. Thus If we subtract this from H({B, B ext }), we obtain an integral purely within V: So we can still interpret relative helicity as being simply the linking of toroidal and poloidal fields.
Note that, from the definition of relative helicity, if we divide space into two volumes V and V ext , then the helicity of all space equals the sum of the two relative helicities in each volume, plus a term giving the linking of the two potential fields B pot and B pot,ext : However, in the case where the boundary surfaces are planar or spherical, the last term vanishes, because the potential fields on either side of the boundary do not have toroidal components. Thus the relative helicity is additive, For less symmetric boundaries, however, the linking of the potential fields may not vanish. Thus the relative helicity will not be additive. Is there a generalized definition of helicity which will sum properly in the asymmetric case?

The poloidal and toroidal fields of a single flux element
Helicity is often described in terms of the mutual linking of pairs of flux elements. In order to better understand how the P-T decomposition works in relation to helicity, it will be useful to describe the toroidal and toroidal fields of flux elements.
Consider a magnetic field comprising a single thin tube of flux Φ which passes through the z = 0 plane near the origin. For simplicity the cross-section of the tube will be taken to be a small square of side a 1. The field only has components in the y and z directions, and follows the curve C(z) = (0, bz, z): From the Green function solution, equation (22), we can solve for the poloidal flux function: for positions x = (x, y, z) with |x − C(z)| 1, The sources for the toroidal flux function are the electric currents on the boundary of the tube. Thus at z = 0 J z = B y (δ(x + a/2) − δ(x − a/2)). Then equation (23) gives a dipole function (with r 2 = x 2 + y 2 ) (see figure 2) Outside of the tube, the total magnetic field vanishes, but the individual poloidal and toroidal components do not vanish: they are equal and opposite. The toroidal field outside of the tube at z = 0 is (see figure 3) The poloidal field is B P = ∇ ∂P ∂z = −B T outside of the tube. Inside of the tube, the toroidal lines close upon themselves. The poloidal lines rotate into the vertical direction and leave the plane.
The poloidal vector potential for a flux tube crossing the z = 0 plane at the origin is (44) The poloidal vector potential tells us the angular direction about the flux tube; in particular, given a second flux tube moving with velocity v, A P · v gives the rate at which the second tube encircles the first.
The toroidal vector potential generated by the tube crossing at the origin, A T = T(x, y)ẑ, reverses this picture. Here, if the central flux tube crosses the z = 0 plane at a slant, then the scalar function T(x, y) tells us whether this central flux tube is rotating in a clockwise or anticlockwise direction about (x, y), and at what rate this rotation happens (see figure 2). Note that (38) can be integrated by parts to read In this expression for the helicity, for each flux element B n (x, y, z)dx dy the function T(x, y, z) tells us the net amount that other flux at the same z plane rotates about the flux element. A description of poloidal and toroidal fields in terms of differential forms is given in appendix A.

Poloidal and toroidal fields in asymmetric geometries
We now consider geometries with less symmetry than the planar or spherical cases. Specifically, we will consider volumes bounded by any simply connected compact surface. The toroidal field part will emerge almost as before, but the poloidal part will require some changes in its description. We start with the requirement that the poloidal field carries all of the perpendicular flux through boundary surfaces, while the toroidal field carries all of the perpendicular current, as in equations (6) and (7).
Fill space with a set of nested simply connected surfaces labelled by the parameter w (i.e. w = constant on each surface). We employ a coordinate system (u, v, w) (which need not be orthogonal), so that each surface is parametrised by coordinates u and v. Given a w surface S, we again define the operator D to be the normal component of the curl: for example, DB T = J n .
Suppose we have some boundary function f defined on S, and wish to find the inverse of the D operator, i.e. find a vector field V where DV = f . A constraint comes from Stoke's theorem: for any closed curve C on the surface S bounding a region A, Figure 3. The toroidal field B T (x, y) generated by a flux tube passing through the origin slanted in the y direction.
The value of the circulation equals the area integral on one side, but also the negative of the area integral on the other side. Thus in order to have a solution, the sum of the area integrals on the two sides, i.e. the integral over all of S, vanishes. Hence the boundary data must satisfy the condition as expected for the normal components of electric currents, magnetic fields or vorticity.

The toroidal field
On each w surface we define the toroidal field to be the inverse curl of the normal current: As the toroidal field lies within the w-surface, all field lines close upon themselves. We again write B T = LT = ∇ × T∇w, with vector potential A T = T∇w.

The poloidal field
We can define the poloidal field as whatever else remains after subtracting the toroidal field: This ensures that equations (6) and (7) still hold; in particular B Pn = B n and DB P = 0. Note that the components of B P parallel to a w surface form a 2-gradient. To see this, the circulation of B P around any closed curve in the surface must vanish (by Stoke's theorem it equals the perpendicular current J Pn contained inside, but the poloidal field has no perpendicular current).
Unfortunately, the vector potential will be more complicated than in the symmetric case. As in the preceding section we first try a vector potential of the form But this is not enough! The curl of this vector field may not be a gradient in the two directions parallel to the surface. In this case taking the curl again would give a non-zero normal current, J Pn = 0. In other words an unwanted toroidal field has appeared. We note that For spherical coordinates, one may verify that the normal Laplacian n · ∆ of A vanishes, as A has no radial component and is divergence free. However, for other compact simply connected geometries with varying surface curvature this vanishing will not be guaranteed. Thus we need to include an additional term: letting B = ∇ × A, let where B S is a toroidal field with an equal but opposite undesired perpendicular current: This additional field will be sufficient to determine B. To see this, note that B + B S has the correct boundary data B n and J n . If anything additional were added to B, it would have to be a divergence-free gradient field ∇ ψ parallel to the nested surfaces. Hence ∆ ψ = 0 which has only constant solutions for simply connected compact surfaces. We can call this additional toroidal field the shape term, as it arises because of asymmetries in the shapes of the nested surfaces, and their interaction with the distribution of normal flux.
We can choose the vector potential for the shape term to be perpendicular to the nested surfaces:

Calculating the surface vector potential
Calculating A = D −1 B n will in general require numerical methods. Suppose we approximate the surface S as F polygonal faces, with a total of E edges and V vertices. We will show that the equations ∇ · A = 0 and D A = B n determine the components of A along each edge. From this information, interpolation can be employed to find both components of A everywhere on the surface. Suppose face i has n edges of length ij , j = 1, . . . n, orientation ê ij , and area A i . Then the circulation theorem gives for face i This gives F equations. However, by Stoke's theorem (or by the absence of magnetic monopoles), the total circulation must be zero for a simply connected surface; i.e. B n d 2 x = 0. The net B n for face i = F equals the negative of the sum of B n for all the other faces. Thus one of the face equations is redundant; we need only solve F − 1 equations to fix the circulation for all F faces.
Next, the divergence-free condition can be implemented at each vertex. Consider a particular vertex V i and the set of edges joining this vertex. Suppose we create a new polygonal region R i containing the vertex by joining the midpoints of these edges. Then we can require that the net flux of A into this region R i vanish, i.e. Ri A ·n d = 0 (here n is in the surface perpendicular to the boundary of R i ).
Again one of the divergence equations will be redundant as the total two-divergence must be zero; we only need V − 1 equations. In total we have F + V − 2 equations. By Euler's theorem for a simply connected surface the number of edges is (56) Thus we have just enough equations to determine the components of A along each of the E edges.

Orthogonality
The poloidal and toroidal fields will still be orthogonal: as B P is still a two-gradient ∇ ψ in each surface, we have

Helicity inside a magnetic surface
As the helicity inside a magnetic surface (say the outermost nested surface) is gauge invariant, we are free to employ the gauges defined in sections 3.1 and 3.2. To recapitulate, First note that some combinations of fields and vector potentials integrate to zero. Given that A T and A S are normal to the surface, and A is parallel to the surface, Also, since B P parallel to the surface is a gradient (as in equation (33)).
We are left with where B S = ∇ × A S is the shape term. Thus, in addition to the usual linking of toroidal and poloidal fields, there is an extra term involving the linkage of the poloidal field with its shape term.
In general vector potentials are only defined up to a gauge transformation. In the poloidaltoroidal decomposition, however, we have specified that parallel to each surface w = const., we have A = A. Thus Recall that A is unique (see section 3.3). Thus this condition uniquely defines A, apart from the addition of a gauge term ∇ψ(w) depending on w alone. Note that the integral of A · B within any level w surface w = w 0 is unaffected by ∇ψ(w): as the net flux through a surface is zero. Similarly, the integral will be gauge-invariant between two surfaces w = w 1 and w = w 2 .

Helicity of open fields
The relative helicity measures linking generated by currents within a volume, and as such will include the linking of poloidal and toroidal flux. However, it misses out on any contribution from interaction between the shape of the volume and the poloidal flux distribution. Thus it is useful to define a helicity (the absolute helicity) which includes the shape term. Our decomposition naturally leads to a decomposition of the vector potential consistent with the condition (66). With this condition, the linking of poloidal and toroidal flux plus linking of the poloidal flux with itself via the shape vector becomes a simple integral of A · B. We assume that the volume V lies inside a w surface. Thus we define As in (65) we have as long as A satisfies condition (66).

The flux of helicity through the boundary
The magnetic helicity in a volume changes due to resistivity and flux of helicity through the boundary. The generalized helicity based on the poloidal-toroidal decomposition obeys a simple helicity evolution equation very similar in form to that for the relative helicity in planar or spherical geometries. The time derivative is, using an integration by parts The last term in (72) vanishes as a consequence of the gauge condition (66) (see appendix C).
By the Maxwell equations dB/dt = −∇ × E for electric field E. Also, only A is parallel to the surface. Thus equation (72) now gives using an integration by parts. The first term is the dissipation term (e.g. with E · B = ηJ · B) and the second gives flux across the boundary. For planar or spherical boundaries this result is identical to the relative helicity flux. In general terms, equation (74) extends the flux equation to all simply-connected boundaries.
Suppose the magnetic field evolves due to an ideal fluid flow with velocity V. Then the electric field vector can be written E = B × V. As an example, consider magnetic fields in the atmosphere of the sun (corona), where the field lines are loops with endpoints in the surface (photosphere). We will let V be the interior of the sun below the photosphere, with n pointing outward. If there is a fluid flow parallel to the surface, then the endpoints will move around each other, tangling up the field lines above. This will transfer helicity between the interior and the coronal field. Here the second term in (74) gives On the other hand, if the flow is perpendicular to the surface, helical field may rise into the corona from below. In this case we have

Self and mutual winding terms
As a minimum, any definition of helicity should have a simple topological meaning. A reasonable requirement is that the helicity reduces to a collection of self winding and mutual winding terms when the field is divided into discrete flux elements (Berger 1999, Longcope et al 2007. Suppose we divide a magnetic field into N flux tubes, where tube i has net flux along its axis Φ i . Taken individually, a flux tube will have helicity due to its internal twist T i and the writhe W i of its axis: (Berger and Prior 2006). Also, tubes i and j may link or wind about each other through W ij turns (Prior and Yeates 2014). This will add a mutual contrib- In total, we have Next suppose that the flux tubes have endpoints on a boundary or boundaries. The winding numbers (T i + W i ) and W ij are topological invariants when the endpoints do not move. The time derivative of these quantities can then be written where ω i = d(T i + W i )/dt arises from the rotations of the two foot points of flux tube i, and ω ij = dW ij /dt gives the sum of the rotations of the i foot points about the j foot points. We will call these spin and orbit terms.

Planar boundaries
Consider just two foot points. For a planar boundary, ω 12 = 1 2πθ 12 , the rotation of the relative position vector between the two points. For more complicated surfaces, however, there is no such obvious definition for this rotation. What we need to do is find a method of defining ω 12 for arbitrary surfaces.
Suppose foot point 1 stays at rest at position x 1 . The orbit term involves some sort of linear functional on the velocity V 2 of foot point 2 at position x 2 (a distance r 12 away from point 1). We can write this as For a plane, the vector potential A just points in the angular direction θ 1 (x 2 ) (as in equation (44), where we had x 1 = (0, 0)): For other surfaces we need to find A (see equation (50)) to define the orbit term. Meanwhile, ω 1 gives the spin term for foot point 1. We imagine the foot point to be a small but finite disk. A planar geometry allows a simple definition, i.e. rotation rate of the disk relative to some fixed direction. Part of this spin may be intrinsic-i.e. the foot point rotates even without its centre moving. Another part arises from the motion of the foot point around the plane, e.g. in a circular track. Can we come up with an equivalent definition that generalizes to arbitrary curved surfaces?
One way to do this is to compare two types of motion. We will call these 'forward facing transport' and 'parallel transport'. Consider a person walking in a circular path on a flat surface. If she executes forward facing transport she will always face in the direction she is walking. Thus when walking around a circle she will rotate once. A person executing parallel transport always faces in the same direction. Thus following a circular path would require some sideways movement and backwards movement, but no rotation. The spin term then comes from comparing the orientation reached after forward facing transport with the orientation reached after parallel transport. The angle between the two orientations reached after following a curve is called the 'geodesic deviation' in differential geometry literature. (Perhaps this should have been more appropriately termed the 'non-geodesic deviation', as it measures the deviations of an arbitrary curve away from being geodesic.)

Spherical surfaces
The next step in complexity is the sphere. Here we can imagine that foot point 1 is at the North pole of a sphere of radius R with very small area A 1 . To obtain a vector potential, however, there needs to be a return flux; otherwise we would have monopoles inside the sphere. A successful method of placing the return flux is to spread it evenly in area (Campbell and Berger 2014), i.e. the radial magnetic field due to foot point 1 is (as a function of spherical coordinates (θ, φ)) Employing Stoke's theorem, the vector potential is consistent with (24) and (25). Suppose foot point 2 is located at co-latitude θ 2 . Also suppose that the two foot points join as endpoints of one flux tube, so Φ 2 = −Φ 1 . If the sphere solidly rotates through 2π, there should be no net helicity flux. Foot point 1 makes one complete rotation, providing a helicity flux of δH = −Φ 2 1 . If foot point 2 executes facing forward motion, then its net spin is given by the geodesic curvature of a latitude line at θ 2 : 2π 0 ω 1 dφ = cos(θ 0 ).
And in fact if you do it this way, using equation (82), all the terms cancel nicely:

Asymmetric surfaces
Next consider an arbitrary simply connected surface. Our method will be to require that a flux loop beginning and ending at the surface will not acquire any helicity if one end (i.e. one foot point) stays at rest, apart from perhaps a spin through 2π, while the second foot point moves around a closed path. We have three terms: 1. The orbit term depends on A · dl around the path, which in turn depends on the distribution of return flux. 2. Foot point 2 spins according to the geodesic curvature of its path. 3. Foot point 1 rotates by 2π.
The result should be no net helicity flux.
We need a method of obtaining the return flux as in equation (81). Instead of thinking of the return flux being distributed evenly in area, we could think of it being distributed proportional to the local Gauss curvature. As the curvature of a sphere is uniform, these two methods give the same result. However, for other manifolds, the two methods differ. Here we employ the Gauss-Bonnet theorem (Burago 2014) to show that distributing the return flux with curvature gives the correct result. This theorem states that the geodesic curvature of a closed curve on a manifold (essentially, how much the tangent vector to the curve rotates with respect to nearby geodesics) is simply related to the integral of the Gauss curvature of the region in the surface encircled.
Gauss-Bonnet theorem: let γ(s) be a closed curve on a surface S which encircles in a righthanded sense the simply-connected region A (s is arclength along the curve). Let K(x) be the Gauss curvature at point x in M. Also let k g (s) be the geodesic curvature at a point on γ(s). Then A K(x)d 2 x + γ k g (s)ds = 2π.
Furthermore, for an entire compact simply-connected surface S, we have Since the curvature of any simply connected closed surface is fixed at K = 4π, we can recast equation (81) as For example, consider the case where S is a cube, and place footpoint 1 at one of the corners. Each corner has total curvature K c = 4π/8 = π/2. The return flux corresponding to this is Φ ret = −Φ 1 /8. Suppose footpoint 2 travels around a curve which goes around the corner adjacent to footpoint 1. It can do this by making three right angled turns (crossing an edge from one cube face to another does not count as a turn). Thus its spin is 3/4. Place flux tube 1 at the corner and let everything go around one complete circuit. Spin 1 = 1, Spin 2 = 3/4, and the orbit term is 2(1-1/8). Thus the helicity flux vanishes as it should:

Conclusions
We have shown how the poloidal-toroidal decomposition of magnetic fields can be extended to non-symmetric domains. The domains are foliated by nested surfaces. A key element is finding the unique toroidal field B T = D −1 J n parallel to the surfaces corresponding to the normal current, and similarly the unique solenoidal vector potential A = D −1 B n corresponding to the normal field. Such decompositions may help in understanding equilibria and evolution of magnetic fields confined to domains with boundaries lacking spherical or planar symmetry. An absolute form of the magnetic helicity was found which measures the linking between the toroidal and poloidal fields. This absolute helicity equals the relative helicity in planar or spherical volumes, but differs in asymmetric volumes. Its time derivative has an intuitive form in terms of the spin of individual flux elements as well as the orbiting of pairs of elements. by Stokes' theorem for a closed volume. As both A and its time derivative are divergence-free, the above theorem ensures that the surface integral in equation (72) vanishes. Note that if a different extension is employed, e.g. X = ∇ × h∇w then the potential functions f and h will be related through a differential equation involving the details of ∇w. As a consequence the theorem will be much more difficult to prove. Since we are only interested in the neighbourhood of S, however, we may use the more convenient coordinates involving λ from (B.2). □