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 Ω is partitioned into parts Pi, i=1,…,n as follows:
Ω=i=1⋃nPiP={P1,…,Pn}
We call the set of parts P a partition of Ω.
Broken Hilbert Spaces
We allow the vector field u to be discontinuous at
boundaries∂Pi and continuous inPi, i=1,…,n.
To this end, we define the broken Hilbert
space over partition P
Hm(P):={v∈L2(Ω)nd∣∀P∈P,v∣P∈Hm(P)}(1)
It can be seen that Hm(P)⊆Hm(Ω).
Part Boundaries
Topologically, a part may share boundary with Ω, like P4.
In that case, the boundary of the part is divided into an
interior boundary and exterior boundary:
∂Pexti=∂Pi∩∂Ωand∂Pinti=∂Pi∖∂Pexti(2)
If a part has an exterior boundary, it is said to be an external part
(P3, P4, P5, P6). If it
does not have any exterior boundary, it is said to be an internal
part.(P1, P2).
Divergence theorem over parts
For a vector field v∈H1(P),
i=1,…,n, we can write the following integral as a sum and apply the
divergence theorem afterward
It’s obvious that the union of part external boundaries equals the domain boundary:
i=1⋃n∂Pexti=∂Ω(13)
which allows us to write
i=1∑n∫∂Pextiv⋅ndA=∫∂Ωv⋅ndA(14)
With the results obtained, we put forward a generalized version of the divergence
theorem: Let v∈H1(P) be a vector field. Then we have
∫ΩdivvdV=∫∂Ωv⋅ndA+Γ∈I∑∫Γ[[v]]⋅ndA(15)
Verbally,
the integral of the divergence of a vector field over a domainΩ
equals
its integral over the domain boundary∂Ω,
plus
the integral of its jump over part interfacesI.
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
Av
instead of v, we would have the jump
[[Av]] on the right-hand side.
We introduce the vector and tensor average operator {⋅}
{v}Γij=21(vij+vji)and{A}Γij=21(Aij+Aji)(16)
and tensor jump operator
[[⋅]]
[[A]]Γij=Aij−Aji(17)
We also note the boundary jump/average property which is used on the integral
over ∂Ω
{v}=[[v]]=von∂Ω(18)
(This property is used implicitly in many places, and often causes confusion).
These definitions allow us to write the identity
[[Av]]=[[A]]{v}+{A}[[v]](19)
which is easily proven when expanded.
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. ↩