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,
where \(u\) and \(v\) are scalar functions on \(\Gamma\) and \(boldsymbol{w}\) is a harmonic vector field, i.e.,
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\),
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.
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