Hodge decomposition

The Laplace–Beltrami problem arises when computing the Hodge decomposition of tangential vector fields. For a vector field \(\boldsymbol{f}\) tangent to the surface \(\Gamma\), the Hodge decomposition writes \(\boldsymbol{f}\) as the sum of curl-free, divergence-free, and harmonic components,

\[\boldsymbol{f} = \underbrace{\nabla_\Gamma u}_{\text{curl-free}} + \underbrace{\boldsymbol{n} \times \nabla_\Gamma v}_{\text{divergence-free}} + \underbrace{\boldsymbol{w}}_{\text{harmonic}}\hspace{-0.15cm},\]

where \(u\) and \(v\) are scalar functions on \(\Gamma\) and \(boldsymbol{w}\) is a harmonic vector field, i.e.,

\[\nabla_\Gamma \cdot \boldsymbol{w} = 0, \qquad \nabla_\Gamma \cdot (\boldsymbol{n} \times \boldsymbol{w}) = 0.\]

Such vector fields play an important role in integral-equation-based methods for computational electromagnetics. To numerically compute such a decomposition, one may solve two Laplace–Beltrami problems for \(u\) and \(v\),

\[\Delta_\Gamma u = \nabla_\Gamma \cdot \boldsymbol{f} \quad \text{ and } \quad \Delta_\Gamma v = -\nabla_\Gamma \cdot \left( \boldsymbol{n} \times \boldsymbol{f} \right),\]

and then set \(\boldsymbol{w} = \boldsymbol{f} - \nabla_\Gamma u - \boldsymbol{n} \times \nabla_\Gamma v\).

% Construct a toroidal mesh
p = 16; nu = 16; nv = 48;
dom = surfacemesh.torus(p+1, nu, nv);

% Make a random smooth tangential vector field
rng(0)
gx = randnfun3(10, boundingbox(dom));
gy = randnfun3(10, boundingbox(dom));
gz = randnfun3(10, boundingbox(dom));
g = cross([0 1 1], surfacefunv(@(x,y,z) gx(x,y,z), ...
                               @(x,y,z) gy(x,y,z), ...
                               @(x,y,z) gz(x,y,z), dom));
vn = normal(dom);
f = -cross(vn, vn, g);

% Compute the Hodge decomposition
tic
[u, v, w] = hodge(f);
toc
Elapsed time is 3.928942 seconds.

The resulting fields are plotted below.

../_images/hodge.png

Let’s check how numerically harmonic the resulting \(\boldsymbol{w}\) field is:

norm(div(w))
ans =

     1.487419678183640e-07
norm(div(cross(vn, w)))
ans =

     7.080441291347141e-07