From: kanschat Date: Fri, 12 Feb 2010 23:11:40 +0000 (+0000) Subject: intro of step 38 rewritten X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cbc89999d627eb5fef23e82dbaa325d3951f3c30;p=dealii-svn.git intro of step 38 rewritten git-svn-id: https://svn.dealii.org/trunk@20578 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-38/doc/intro.dox b/deal.II/examples/step-38/doc/intro.dox index 1f2de88b3e..e845fcfcc8 100644 --- a/deal.II/examples/step-38/doc/intro.dox +++ b/deal.II/examples/step-38/doc/intro.dox @@ -6,7 +6,7 @@ This example is devoted to the MeshWorker framework and the discontinuous Galerkin method, or in short: DG method. It includes the following topics.
    -
  1. Discretization of the linear transport equation with the DG method. +
  2. Discretization of the linear advection equation with the DG method.
  3. Assembling of the system matrix using the MeshWorker::loop().
@@ -25,92 +25,51 @@ goal.

Problem

The model problem solved in this example is the linear advection equation -@f[ - \nabla\cdot \left({\mathbf \beta} u\right)=f \qquad\mbox{in }\Omega, -\qquad\qquad\qquad\mathrm{[transport-equation]}@f] +@f[ + \nabla\cdot \left({\mathbf \beta} u\right)=0 \qquad\mbox{in }\Omega, +@f] subject to the boundary conditions @f[ u=g\quad\mbox{on }\Gamma_-, @f] on the inflow part $\Gamma_-$ of the boundary $\Gamma=\partial\Omega$ of the domain. Here, ${\mathbf \beta}={\mathbf \beta}({\bf x})$ denotes a -vector field, $f$ a source function, $u$ the (scalar) solution +vector field, $u$ the (scalar) solution function, $g$ a boundary value function, @f[ \Gamma_-:=\{{\bf x}\in\Gamma, {\mathbf \beta}({\bf x})\cdot{\bf n}({\bf x})<0\} @f] the inflow part of the boundary of the domain and ${\bf n}$ denotes -the unit outward normal to the boundary $\Gamma$. Equation -[transport-equation] is the conservative version of the -transport equation already considered in step 9 of this tutorial. - -In particular, we consider problem [transport-equation] on +the unit outward normal to the boundary $\Gamma$. This equation is the +conservative version of the advection equation already considered in +@ref step_9 "step-9" of this tutorial. +In particular, we solve the advection equation on $\Omega=[0,1]^2$ with ${\mathbf \beta}=\frac{1}{|x|}(-x_2, x_1)$ -representing a circular counterclockwise flow field, $f=0$ and $g=1$ +representing a circular counterclockwise flow field, and $g=1$ on ${\bf x}\in\Gamma_-^1:=[0,0.5]\times\{0\}$ and $g=0$ on ${\bf x}\in \Gamma_-\setminus \Gamma_-^1$. +We apply the well-known upwind discontinuous Galerkin method. To this +end, we introduce the mesh dependent bilinear form -

Discretization

- -For deriving the DG -discretization we start with a variational, mesh-dependent -formulation of the problem, -@f[ - \sum_\kappa\left\{-\beta u,\nabla v)_\kappa+(u^+ \beta\cdot{\bf n}, v)_{\partial\kappa}\right\}=(f,v)_\Omega, -@f] - -that originates from [transport-equation] by -multiplication with a test function $v$ and integration by parts on -each cell $\kappa$ of the triangulation. Here $(\cdot, \cdot)_\kappa$ -and $(\cdot, \cdot)_{\partial\kappa}$ denote the -L2-inner products on the cell $\kappa$ and the -boundary $\partial\kappa$ of the cell, respectively. $u^+$ is the -value of u taken from the upwind cell with respect to $\beta$ -of the face, that is, the cell $\beta$ points away from. To discretize -the problem, the functions $u$ and $v$ are replaced by discrete -functions $u_h$ and $v_h$ that in the case of discontinuous Galerkin -methods belong to the space $V_h$ of discontinuous piecewise -polynomial functions of some degree $p$. - -Hence, the discontinuous Galerkin -scheme for the [transport-equation] is given -by: find $u_h\in V_h$ such that for all $v_h\in V_h$ following -equation holds: -@f[ - \sum_\kappa\left\{-(u_h,{\mathbf \beta}\cdot\nabla v_h)_\kappa - +({\mathbf \beta}\cdot{\bf n}\, u_h, v_h)_{\partial\kappa_+} - +({\mathbf \beta}\cdot{\bf n}\, u_h^-, v_h)_{\partial\kappa_-\setminus\Gamma}\right\} - =(f,v_h)_\Omega-({\mathbf \beta}\cdot{\bf n}\, g, v_h)_{\Gamma_-}, -\qquad\qquad\qquad\mathrm{[dg-transport1]}@f] -where $\partial\kappa_-:=\{{\bf x}\in\partial\kappa, -{\mathbf \beta}({\bf x})\cdot{\bf n}({\bf x})<0\}$ denotes the inflow boundary -and $\partial\kappa_+=\partial\kappa\setminus \partial \kappa_-$ the -outflow part of cell $\kappa$. Below, this equation will be referred -to as first version of the DG method. We note that after a -second integration by parts, we obtain: find $u_h\in V_h$ such that @f[ - \sum_\kappa\left\{(\nabla\cdot\{{\mathbf \beta} u_h\},v_h)_\kappa - -({\mathbf \beta}\cdot{\bf n} [u_h], v_h)_{\partial\kappa_-}\right\} - =(f,v_h)_\Omega, \quad\forall v_h\in V_h, + -\sum_{T\in \mathbb T_h}\bigl(u_h,{\mathbf \beta}\cdot\nabla v_h\bigr)_T + +\sum_{F\in\mathbb F_h^i} \bigl_{F} + + \bigl_{\Gamma_+} + =-\bigl_{\Gamma_-}. @f] -where $[u_h]=u_h^+-u_h^-$ denotes the jump of the discrete function -between two neighboring cells and is defined to be $[u_h]=u_h^+-g$ on -the boundary of the domain. This is the discontinuous Galerkin scheme -for the transport equation given in its original notation. -Nevertheless, we will base the implementation of the scheme on the -form given by [dg-general1] and [upwind-flux], -or [dg-transport1], respectively. -Finally, we rewrite [dg-general1] in terms of a summation over all -faces where each face $e=\partial \kappa\cap\partial \kappa'$ -between two neighboring cells $\kappa$ and $\kappa'$ occurs twice, obtaining +Here, $\mathbb T_h$ is the set of all active cells of the triangulation +and $\mathbb F_h^i$ is the set of all active interior faces. +$(\cdot, \cdot)_T$ and $\left<\cdot, \cdot\right>_{F}$ denote the +L2-inner products on the cell $T$ and a face $F$, +respectively. The jump is defined as $[v\mathbf n] = v^+\mathbf n^+ + +v^-\mathbf n^-$, where the superscripts refer to the upwind ('+') and +downwind ('-') values at the face. -@f[ - -\sum_\kappa(u_h,{\mathbf \beta}\cdot\nabla v_h)_\kappa - +\sum_{E\in\mathbb E_h^i} (u_h^-, \beta\cdot[v_h\mathbf n])_{E} - =(f,v_h)_\Omega-(g, \beta\cdot\mathbf n v_h)_{\Gamma_-}. -@f] +In order to implement this bilinear form, we need to compute the cell +terms $\bigl(u_h,{\mathbf \beta}\cdot\nabla v_h\bigr)_T$, the internal fluxes +$\bigl_{F}$, and the boundary terms $\bigl_{\Gamma_+}$ and $\bigl_{\Gamma_-}$. The summation of all those is done by MeshWorker::integration_loop(). -In this form, we need to implement a