<br>
-<i> Note: A variant called step-12b of this tutorial exists, that uses
+<i> Note: A variant called step-12b of this tutorial exists, using
MeshWorker and LocalIntegrators instead of assembling matrices using
-FEInterfaceValues as it is done in this tutorial.
+FEInterfaceValues as is done in this tutorial.
</i>
<a name="Intro"></a>
<li> outer boundary on the outflow:
$\int_{\Gamma_+} v_h u_h \beta \cdot n$
<li> inner faces (integral from two sides turns into jump, we use the upwind velocity):
- $\int_F [v_h] u_h^{\text{UP}} \beta \cdot n$
+ $\int_F [v_h] u_h^{\text{upwind}} \beta \cdot n$
</ol>
Here, the jump is defined as $[v] = v^+ - v^-$, where the superscripts refer
is known as the upwind discontinuous Galerkin method.
In order to implement this bilinear form, we need to compute the cell terms
-(first sum) using a normal cell integration, the interface terms (second sum) using
+(first sum) using the usual way to achieve integration on a cell, the interface terms (second sum) using
FEInterfaceValues, and the boundary terms (the other two terms).
The summation of all those is done by MeshWorker::mesh_loop().
// <code>FEValues</code> objects, and that is about it.
#include <deal.II/fe/fe_dgq.h>
// This header is needed for FEInterfaceValues to compute integrals on
-// interfaces
+// interfaces:
#include <deal.II/fe/fe_interface_values.h>
// We are going to use the simplest possible solver, called Richardson
// iteration, that represents a simple defect correction. This, in combination
// @sect3{The ScratchData and CopyData classes}
//
// The following objects are the scratch and copy objects we use in the call
- // to MeshWorker::mesh_loop. The new object is the FEInterfaceValues object,
+ // to MeshWorker::mesh_loop(). The new object is the FEInterfaceValues object,
// that works similar to FEValues or FEFacesValues, except that it acts on
// an interface between two cells and allows us to assemble the interface
// terms in our weak form.
// called AdvectionProblem. While we would not need an AffineConstraints
// object, because there are no hanging node constraints in DG
// discretizations, we use an empty object here as this allows us to use its
- // copy_local_to_global functionality.
+ // `copy_local_to_global` functionality.
//
// Major differences will only come up in the implementation of the assemble
// function.
template <int dim>
void AdvectionProblem<dim>::assemble_system()
{
- typedef decltype(dof_handler.begin_active()) Iterator;
- BoundaryValues<dim> boundary_function;
+ using ActiveCellIterator = typename DoFHandler<dim>::active_cell_iyerator;
+ const BoundaryValues<dim> boundary_function;
// This is the function that will be executed for each cell.
auto cell_worker = [&](const Iterator & cell,
};
// This is the function called for boundary faces and consists of a normal
- // integration using FeFaceValues. New is the logic to decide if the term
+ // integration using FEFaceValues. New is the logic to decide if the term
// goes into the system matrix (outflow) or the right-hand side (inflow).
auto boundary_worker = [&](const Iterator & cell,
const unsigned int &face_no,
for (unsigned int j = 0; j < n_dofs; ++j)
copy_data_face.cell_matrix(i, j) +=
fe_iv.jump(i, qpoint) // [\phi_i]
- * fe_iv.shape_value((beta_n > 0), j, qpoint) // phi_j^{UP}
+ * fe_iv.shape_value((beta_n > 0), j, qpoint) // phi_j^{upwind}
* beta_n // (\beta . n)
* JxW[qpoint]; // dx
}
// The output of this program consists of a vtk file of the adaptively
// refined grids and the numerical solutions. Finally, we also compute the
- // L-infinity norm of the solution using VectorTools::integrate_difference.
+ // L-infinity norm of the solution using VectorTools::integrate_difference().
template <int dim>
void AdvectionProblem<dim>::output_results(const unsigned int cycle) const
{