Today we will learn about the inclusion of boundaries in your DEC setup. This will be an essential lesson in solving Poisson problems

This tutorial comes with implementation files in the download section.
Boundaries
Boundaries force us to adapt which then opens up the door for new ideas. This also applies to discrete exterior calculus (DEC). In this course, we have often avoided boundaries due to the added complications that we get through them but today we will shed some light on this topic which will allow us to create waves and heat simulations that realistically deal with boundaries.
DEC life with Boundaries
So how should our DEC build deal with boundaries? The answer is surprisingly simple. The exterior derivatives
Always keep this image in your mind:
What happens to ?
Let
counts points measures length measures area measures volume
The discrete Hodge-star
Where
For our 2D surface case you can now look at the above image and see the following:
- The primal graph measures are not influenced by the boundary.
- The number of points is fixed.
- The edges lengths stay the same.
- The face areas stay the same.
- The dual graph, however, does affect the measures at the boundary!
- Dual point areas at the boundary are now smaller than before.
- Dual edges are also cut shorter.
- Dual faces are not affected as they are measured by counting.
Implementations of
What happens to ?
Nothing! That is actually crazy.
is just a derivative along edges in the primal graph. This operator does not even notice the presence of a boundary. is a derivative between faces in the primal graph. A boundary edge is not between faces. There is nothing to adjust for at the boundary. is the dual derivative between dual points (primal face centers). Just like in , there is no face beyond the boundary and thus no derivative there. is the dual derivative between dual faces (primal points). Just like with , nothing changes as the derivative along the primal edges are well defined even at the boundary.
For the 2D surface case we still have the computationally super convenient formula
And the boundary respecting Laplacian still obeys the old formula as usual
In fact, the DEC build assets you received earlier already do this.
Living with Conditions
Ok cool. We have now a DEC setup with a Laplacian but how do we actually solve the heat equation or the wave equation with this?
Solving a differential equation on a domain
- Dirichlet boundary condition:
- Solving for
with prescribed values of at the boundary - How to remember: “Dirichlet” is “dictating” the exact values.
- Example: solve
, given .- Meaning: Solve for the steady-state heat distribution with prescribed heat in certain areas. Solving for a harmonic function.
- Solving for
- Neuman boundary condition:
- Solving for
with prescribed flux at the boundary - How to remember: “Neuman” is dealing with the “normals”.
- Example: Solve
, given .- Meaning: Solve for heat flow with prescribed incoming and outgoing heat sources.
- Example: Solve
, given .- Meaning: Wave equation with walls that prevent the wave from leaving.
- Solving for
Solving with Conditions
How do I implement these conditions into my favorite DEC setup? We will stick to the geometric interpretation of the heat flow to describe what happens.
Dirichlet Condition
Ok, simple example. Let’s say you want to solve

In this case the Dirichlet boundary condition is set on points and we are trying to solve the heat
The way to approach this is through matrix slicing. We already know that some points are going to be fixed. In our case we will call these points boundary points. Let B be the set of boundary points and I the set of interior points. All the DEC operators can be permuted since their order only dependent on the enumeration of the points, edges and faces. These enumerations are arbitrary. Imagine now that we would re-enumerate all our points in such a way that we first count all the interiour points I and then count all the boundary points B. Then our equation would look like this:
Where the I and B mark what parts of the matrix act on the interior and boundary points respectively. Since
Then stich

This is what this solver would give us if we had only specified half of the top and bottom boundary to have a fixed temperature value:
Here is an example of a spiral where only the tips are heated or cooled respectively:
And here a strange slice of cheese where certain corners got marked with the Dirichlet condition:
Note!: Solving this type of problem with prescribed values will happen again and again, and as you might have noticed, we have not used the fact that our boundary points are actually on the boundary. You could use this to fix values on the inside of the set too. However, the good thing about having these conditions on boundaries is that you are guaranteed a solution as long as your set
In the examples above we marked some boundaries with conditions, but not all of them! What happened there? Next, we will show that not specifying anything at the boundary is equivalent to setting a zero Neumann boundary condition.
Neuman Condition
Let’s solve for the steady-state of the heat equation again but this time without any prescribed temperatures. Instead, we will fix the amount of heat traveling in to and out of the surface. For example, we take a grid and watch how the heat enters from the sides.

The heat flow corresponding to this steady-state that we are looking for looks like this:
where
Since we work with temperatures on points only we can go ahead and replace
This time we don’t have to slice any matrices. The Neuman steady-state equation is the following:
This is just a Poisson problem. We move the

But wait! When can we assume this equation to have a solution? The answer is geometrically simple: When the mean boundary flux is 0. Why? because if you continuously pump heat in and out of a system, stability can only occur if the amount of heat coming in and the amount of heat going out is the same. If this is not the case, the system will have infinite heat or negative infinite heat as the heat flow continues. This condition also guarantees that the divergence theorem holds:
Here is another example of flux entering and leaving a system.

Notes!: This result is really cool because it means that if
Solving for Dirichlet and Neuman condition at the same time!
This is simple. Just set up the Neuman problem and start slicing. Let us solve
(
First, we slice our matrix as above for the Dirichlet boundary. We define
Then we just solve this.
How to Implement this in SciPy
This is where matrix slicing gets its name from. We are solving for
Let
and use them for sclicing
The same slicing has to be done for star0. The right hand side (rhs) also has to be sliced correctly with the Dirichlet and Neuman boundary data.
We can then solve
and then combine this solution with the Dirichlet boundary data
Heat Flow Example
Let’s solve
Now this derivation can also be performed using slicing like this:
For example:

Wave Equation Example
For waves, a Dirichlet condition does not really make sense. The most reasonable boundary condition is to prevent the wave from leaving the domain. This corresponds to a zero Neuman condition. As we have learned above having
and get valid reflections at the boundary.

More Notes
-
- If in doubt, check the residual of what you just solved. So if your solver just returned your
that allegedly solves then compute the residual.
If this isn’t tiny small then something went wrong. This is a nice check when you have to deal with harmonic generators. - Check out the talk from Solomon/Crane/Vouga Laplace-Beltrami: The Swiss Army Knife of Geometry Processing (2014).
- A more natural boundary condition for the heat equation would be a Robin-boundary condition. With it, the flux at the boundary is dependant on the value at the boundary. This is accurate for the cool down process where the outside has a constant temperature (e.g. the outside wheater) and the inside cools or heats up depending on the temperature difference.
- If in doubt, check the residual of what you just solved. So if your solver just returned your