From: Timo Heister Date: Thu, 24 Oct 2019 09:01:43 +0000 (+0200) Subject: Apply suggestions from code review X-Git-Tag: v9.2.0-rc1~836^2~8 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79d9be76c150027fa574fc192117e114bffa19ed;p=dealii.git Apply suggestions from code review Co-Authored-By: Wolfgang Bangerth --- diff --git a/examples/step-12/doc/intro.dox b/examples/step-12/doc/intro.dox index 7fc7851c9c..fedcf89873 100644 --- a/examples/step-12/doc/intro.dox +++ b/examples/step-12/doc/intro.dox @@ -1,8 +1,8 @@
- Note: A variant called step-12b of this tutorial exists, that uses + 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. @@ -64,7 +64,7 @@ all internal and external faces and as such there are three cases:
  • outer boundary on the outflow: $\int_{\Gamma_+} v_h u_h \beta \cdot n$
  • 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$ Here, the jump is defined as $[v] = v^+ - v^-$, where the superscripts refer @@ -83,7 +83,7 @@ and $\mathbb F_h^i$ is the set of all active interior faces. This formulation 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(). diff --git a/examples/step-12/step-12.cc b/examples/step-12/step-12.cc index e3d17c2600..4d6f136bcf 100644 --- a/examples/step-12/step-12.cc +++ b/examples/step-12/step-12.cc @@ -46,7 +46,7 @@ // FEValues objects, and that is about it. #include // This header is needed for FEInterfaceValues to compute integrals on -// interfaces +// interfaces: #include // We are going to use the simplest possible solver, called Richardson // iteration, that represents a simple defect correction. This, in combination @@ -135,7 +135,7 @@ namespace Step12 // @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. @@ -213,7 +213,7 @@ namespace Step12 // 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. @@ -299,8 +299,8 @@ namespace Step12 template void AdvectionProblem::assemble_system() { - typedef decltype(dof_handler.begin_active()) Iterator; - BoundaryValues boundary_function; + using ActiveCellIterator = typename DoFHandler::active_cell_iyerator; + const BoundaryValues boundary_function; // This is the function that will be executed for each cell. auto cell_worker = [&](const Iterator & cell, @@ -333,7 +333,7 @@ namespace Step12 }; // 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, @@ -408,7 +408,7 @@ namespace Step12 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 } @@ -534,7 +534,7 @@ namespace Step12 // 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 void AdvectionProblem::output_results(const unsigned int cycle) const {