If $a(\mathbf x)$ was a constant coefficient, this would simply be the Poisson
equation that we have already solved in step-3 and step-4. However, if it is
indeed spatially variable, it is a more complex equation (sometimes referred
-to as the "Poisson equation with a coefficient"). Depending on
-what the variable $u$ refers to, it models a variety of situations with wide
-applicability:
+to as the "Poisson equation with a coefficient"). Specifically, we will here
+choose it as follows:
+@f{align*}{
+ a(\mathbf x) =
+ \begin{cases}
+ 20 & \text{if}\ |\mathbf x|<0.5, \\
+ 1 & \text{otherwise.}
+ \end{cases}
+@f}
+Depending on what the variable $u$ refers to, it models a variety of
+situations with wide applicability:
- If $u$ is the electric potential, then $-a\nabla u$ is the electric current
in a medium and the coefficient $a$ is the conductivity of the medium at any
based on step-4 and step-5, and, as you will see, it does not actually
take very much code to enable adaptivity. Indeed, while we do a great
deal of explaining, adaptive meshes can be added to an existing program
-with barely a dozen lines of additional code. The program shows what
+with less than ten lines of additional code. The program shows what
these lines are, as well as another important ingredient of adaptive
mesh refinement (AMR): a criterion that can be used to determine whether
it is necessary to refine a cell because the error is large on it,
small on it, or whether we should just leave the cell as it is. We
will discuss all of these issues in the following.
+The program solves the same problem as step-5, that is, we solve the equation
+@f{align*}{
+ -\nabla \cdot a(\mathbf x) \nabla u(\mathbf x) &= 1 \qquad\qquad & \text{in}\ \Omega,
+ \\
+ u &= 0 \qquad\qquad & \text{on}\ \partial\Omega,
+@f}
+where $a(\mathbf x)$ is a spatially variable coefficient defined as
+@f{align*}{
+ a(\mathbf x) =
+ \begin{cases}
+ 20 & \text{if}\ |\mathbf x|<0.5, \\
+ 1 & \text{otherwise.}
+ \end{cases}
+@f}
+
<h3> What adaptively refined meshes look like </h3>