In lecturenotes
related to the
Discontinuous Galerkin method,
there is
mention of a magic formula which AFAIK first appeared on a paper1 by
Douglas Arnold (at least in this context).
It has been proven and all, but it’s still called magic because its reasoning is
not apparent at first glance. The magic formula is actually a superset of
the divergence theorem, generalized to discontinuous fields. But to make that
generalization, we need to abandon the standard formulation which starts by
creating a triangular mesh, and consider arbitrary partitionings of a domain.
A domain $\Omega$ is partitioned into parts $P^i$, $i=1,\dots,n$ as follows:
We call the set of parts $\mathcal{P}$ a partition of $\Omega$.
Broken Hilbert Spaces
We allow the vector field $\boldsymbol{u}$ to be discontinuous at
boundaries $\partial P^i$ and continuous in $P^i$, $i=1,\dots,n$.
To this end, we define the broken Hilbert
space over partition $\mathcal{P}$
It can be seen that $H^m(\mathcal{P})\subseteq H^m(\Omega)$.
Part Boundaries
Topologically, a part may share boundary with $\Omega$, like $P^4$.
In that case, the boundary of the part is divided into an
interior boundary and exterior boundary:
If a part has an exterior boundary, it is said to be an external part
($P^3$, $P^4$, $P^5$, $P^6$). If it
does not have any exterior boundary, it is said to be an internal
part.($P^1$, $P^2$).
Divergence theorem over parts
For a vector field $\boldsymbol{v}\in H^1(\mathcal{P})$,
$i=1,\dots,n$, we can write the following integral as a sum and apply the
divergence theorem afterward
If $P^i$ and $P^j$ are not neighbors, we simply have $\Gamma^{ij}=\emptyset$.
Integrals over interior boundaries
For opposing parts $P^i$ and $P^j$,
we have different values of the function $\boldsymbol{v}^{ij} = \boldsymbol{v}|_{\Gamma^{ij}}$
and conjugate normal vectors at the
interface $\Gamma^{ij}$:
With the results obtained, we put forward a generalized version of the divergence
theorem: Let $\boldsymbol{v}\in H^1(\mathcal{P})$ be a vector field. Then we have
Verbally,
the integral of the divergence of a vector field over a domain $\Omega$
equals
its integral over the domain boundary $\partial\Omega$,
plus
the integral of its jump over part interfaces $\mathcal{I}$.
In the case of a continuous field, the jumps vanish and this
reduces to the regular divergence theorem.
The Magic Formula
There are different versions of the magic formula for scalar, vector and tensor
fields, and for different IBVPs. I won’t try to derive them all, but give an
example: If we were substitute a linear mapping
$\boldsymbol{A}\boldsymbol{v}$
instead of $\boldsymbol{v}$, we would have the jump
$\llbracket \boldsymbol{A}\boldsymbol{v} \rrbracket$ on the right-hand side.
We introduce the vector and tensor average operator \(\{\cdot\}\)
The different versions of the magic formula are obtained by
substituting the identities above—or their analogs—in the discontinuous
divergence theorem.
Douglas N. Arnold. An interior penalty finite element method with discontinuous elements. SIAM J. Numer. Anal., 19(4):742–760, 1982. ↩