# Literature reference for divergence theorem (Greens' first theorem) with surface discontinuity

**URL:** <https://fenicsproject.discourse.group/t/literature-reference-for-divergence-theorem-greens-first-theorem-with-surface-discontinuity/15999>\
**Category:** General\
**Created:** [October 8, 2024, 2:40pm UTC](https://fenicsproject.discourse.group/t/literature-reference-for-divergence-theorem-greens-first-theorem-with-surface-discontinuity/15999 "2024-10-08T14:40:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dparsons](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dparsons](https://fenicsproject.discourse.group/u/dparsons)\
**Post date:** [October 8, 2024, 2:40pm UTC](https://fenicsproject.discourse.group/t/literature-reference-for-divergence-theorem-greens-first-theorem-with-surface-discontinuity/15999/1 "2024-10-08T14:40:37Z")

</div>

In some applications (e.g. Poisson equations) multidimensional integration by parts, or Green’s first theorem (applying the divergence theorem), is helpful for deriving a weak formulation or handling functionals for variational calculus. Wikipedia helpfully provides a summary at [Vector calculus identities - Wikipedia](https://en.wikipedia.org/wiki/Vector_calculus_identities#Surface%E2%80%93volume_integrals) (I should send them some [money](https://donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_en.wikipedia.org&uselang=en))

\int\_V \mathbf{A} \cdot \nabla \psi = \int\_S \psi (\mathbf{A},n) ds - \int\_V \psi \nabla \cdot \mathbf{A}

But we know from electrostatics that more attention to detail at the boundary is needed. The surface term is actually

\int\_S \psi (\mathbf{A}\_{out}-\mathbf{A}\_{in},n) ds = \int\_S \psi \sigma ds

involving a jump discontinuity in vector \mathbf{A} at the boundary, defining a scalar function on the boundary, \sigma=(\mathbf{A}\_{out}-\mathbf{A}\_{in},n) from the transverse components of vector \mathbf{A} on the inside and outside of the boundary. In electrostatics this is the surface charge, corresponding to a discontinuity in the electric displacement vector \mathbf{D}. (I may have the minus sign the wrong way around, which is the point of this request for reference)

The references I have at hand ([Gradstein & Ryzhik](https://doi.org/10.1016/C2010-0-64839-5) §10.713, [Riley, Hobson & Bence](https://doi.org/10.1017/CBO9780511810763) eq.11.19), that apply the divergence theorem to derive this vector calculus identity, all ignore the possibility of the jump condition, meaning they only allow for the case \sigma=0.

Does anyone know a good reference for the more general case involving the surface discontinuity?

Preferably something official with a doi that could be used for literature citation, but hey even a blog entry could be helpful for checking the minus signs are correct.

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [October 8, 2024, 3:07pm UTC](https://fenicsproject.discourse.group/t/literature-reference-for-divergence-theorem-greens-first-theorem-with-surface-discontinuity/15999/2 "2024-10-08T15:07:59Z")

</div>

I guess what I would do is to divide the volume into two chunks, split at the discontinuity. Then you can apply Green’s theorem on either of them, where you get a common integral at the discontinuous boundary. Then you can choose whatever side the normal is defined at n\_1 = -n\_0 and get a jump condition.

This is typically how I arrive at DG formulations (before apply magics where jumps can become mixes of jumps and averages.

---

<div class="post-metadata">

**Author:** ![dparsons](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dparsons](https://fenicsproject.discourse.group/u/dparsons)\
**Post date:** [October 9, 2024, 8:12am UTC](https://fenicsproject.discourse.group/t/literature-reference-for-divergence-theorem-greens-first-theorem-with-surface-discontinuity/15999/3 "2024-10-09T08:12:54Z")

</div>

I guess I can try doing it manually if I have to. I’m missing some conceptual detail though. The two subdomains might be V\_{in} and V\_{out}, and V\_{in} is the one I’m interested in. I can’t yet see how I should subtract out \int\_{V\_{out}}.

I think you meaning writing

\int\_S \psi (\mathbf{A},n\_{in}) ds = \int\_{V\_{in}} \mathbf{A} \cdot \nabla \psi + \int\_{V\_{in}} \psi \nabla \cdot \mathbf{A}  
{} = \int\_{V\_{out}} \mathbf{A} \cdot \nabla \psi + \int\_{V\_{out}} \psi \nabla \cdot \mathbf{A} = \int\_S \psi (\mathbf{A},n\_{out}) ds

i.e. identifying \int\_S \psi (\mathbf{A},n\_{in}) ds =-\int\_S \psi (\mathbf{A},n\_{out}) ds (that is n\_{out}=-n\_{in}). But that’s not quite the same as a jump condition.

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [October 9, 2024, 9:41am UTC](https://fenicsproject.discourse.group/t/literature-reference-for-divergence-theorem-greens-first-theorem-with-surface-discontinuity/15999/4 "2024-10-09T09:41:31Z")

</div>

What I was thinking was split V=V\_0\cup V\_1, such that \Gamma = V\_0\cap V\_1

\int\_V \mathbf{A}\cdot \nabla \psi ~\mathrm{d} x = \int\_{V\_0} \mathbf{A}\cdot \nabla \psi ~\mathrm{d} x + \int\_{V\_1} \mathbf{A}\cdot \nabla \psi ~\mathrm{d} x

Then apply the identity to each subdomain

\int\_{V\_0} \mathbf{A}\cdot \nabla \psi ~\mathrm{d} x = -\int\_{V\_0} \psi \nabla \cdot \mathbf{A}~\mathrm{d}x + \int\_{S\_0} \psi\_0 \mathbf{A}\_0\cdot n\_0 ~\mathrm{d}s.

\int\_{V\_1} \mathbf{A}\cdot \nabla \psi ~\mathrm{d} x = -\int\_{V\_1} \psi \nabla \cdot \mathbf{A}~\mathrm{d}x + \int\_{S\_1} \psi\_1 \mathbf{A}\_1\cdot n\_1 ~\mathrm{d}s.

Split S\_0 into \Gamma \cup \Lambda\_0 and S\_1 into \Gamma \cup \Lambda\_1.  
This means \Lambda\_0\cup\Lambda\_1=\partial V

Pick n\_0=-n\_1  
to get

\int\_V \mathbf{A}\cdot \nabla \psi ~\mathrm{d} x = -\int\_{V} \psi \nabla \cdot \mathbf{A}~\mathrm{d}x + \int\_{\Lambda\_0\cup\Lambda\_1} \psi \mathbf{A}\cdot n ~\mathrm{d}s + \int\_\Gamma (\psi\_1 \mathbf{A\_1} - \psi\_0 \mathbf{A}\_0)\cdot n\_1\mathrm{d}s

If \psi is continuous you get your identity.  
This means that the discontinuity cannot be at an outer boundary, as there it wouldn’t make sense (as you would always approach it from the inside).

---

<div class="post-metadata">

**Author:** ![dparsons](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dparsons](https://fenicsproject.discourse.group/u/dparsons)\
**Post date:** [October 9, 2024, 10:22am UTC](https://fenicsproject.discourse.group/t/literature-reference-for-divergence-theorem-greens-first-theorem-with-surface-discontinuity/15999/5 "2024-10-09T10:22:13Z")

</div>

I think I see. This way identifies an internal boundary \Gamma, distinct from the overall external boundary \Lambda=\partial V. So here \Lambda\_0=\partial V\_0/\Gamma is V\_0's share of the external boundary, without the internal boundary. Likewise \Lambda\_1=\partial V\_1/\Gamma. And you’re defining the jump condition at the internal boundary \Gamma, not the external boundary.

It may be that the conceptual flaw in what I’m trying to do is to define my jump condition at an external boundary. Fair to say, it doesn’t really make sense to define an n\_1 normal if V\_1 does not exist. I will reflect on this a little longer.

In practice what I’m trying to do is perform my FEniCS calculation in one domain, which represents one piece of the universe. I’m trying to avoid having to do an explicit calculation of the rest of the universe outside the domain I’m interested in. So it’s not so much that V\_1 does not exist, but that I’m trying to ignore it. I may need to invoke electroneutrality of my [sub]domain and its boundary, in which case the vector field outside might be zero (so the jump condition on the “external” boundary is not needed).
