From 65c08319913348a96f6e05e4ed5545c1756392c8 Mon Sep 17 00:00:00 2001 From: tcclevenger Date: Mon, 13 May 2019 17:46:22 -0600 Subject: [PATCH] Intro and small fixes --- examples/step-63/doc/intro.dox | 115 ++++++++++++++++++++++++++----- examples/step-63/doc/results.dox | 17 +++-- examples/step-63/step-63.cc | 26 ++++--- 3 files changed, 120 insertions(+), 38 deletions(-) diff --git a/examples/step-63/doc/intro.dox b/examples/step-63/doc/intro.dox index 8e3cd37a52..13b887749d 100644 --- a/examples/step-63/doc/intro.dox +++ b/examples/step-63/doc/intro.dox @@ -13,35 +13,89 @@ N16A-T003.

Introduction

-Please note: This is work in progress and will be an example for block -smoothers in geometric multigrid. +This program solves an advection-diffusion problem using a geometric +multigrid preconditioner. The basics of this preconditioner are +discussed in step-16; here we discuss the necessary changes needed for +a non-symmetric PDE, we introduce the idea of block smoothing (as +compared to point smoothing), and examine the effects of DoF +renumbering for additive and multiplicative methods. -OUTLINE +

Equation

+The advection-diffusion equation is given by -- based on step-16 (GMG), and step-9 (advection) +@f{align*}{ +-\varepsilon \Delta u + \vec{\beta}\cdot \nabla u & =& f & +\text{ on } \Omega\\ +u &=& g & \text{ on } \partial\Omega +@f} -differences to GMG in step-16: +where $\varepsilon>0$, $\vec{\beta}$ is the \textit{advection +direction}, and $f$ is a source. A few notes: -- non-symmetric problem (interface matrices) -- renumbering of dofs on each level -- different smoothers (include block) +1. If $\vec{\beta}=\vec{0}$, this is the Laplace equation solved in +step-16 (and many other places). +2. If $\varepsilon=0$ then this is the advection equation solved in +step-9. -

Equation

+3. If $\varepsilon \ll \norm{\vec{\beta}},$ we say the problem is +\textit{advection-dominated}, else we say the problem is +\textit{diffusion-dominated}. + +For the discussion in this tutorial we will be concerned with +advection-dominated flow. + +Using the standard Galerkin finite element method, for suitable test +function $v_h$, the discretized weak form of the PDE reads + +@f{align*}{ +a(u_h,\v_h) = F(v_h) +@f} + +where + +@f{align*}{ +a(u_h,\v_h) &= (\nabla u_h,\, \nabla v_h) + (\vec{\beta}\cdot\nabla u_h,\,v_h)\\ +F(v_h) &= (f,\,v) +@f} -* Statement of PDE and weak-form with physical description +

Streamline diffusion

-* SUPG (streamline diffusion): State modifications to weak-form. +The following error estimate can be shown for this PDE: + +@f{align*}{ +\norm{\nabla (u-u_h)} \leq (1+\mathcal{P}) \inf_{v_h} \norm (\nabla (u-v_h)} +@f} + +where $\mathcal{P} \sim \norm{\vec{\beta}}/\varepsilon$ (referred +to as the \textit{Peclet} number). This implies that we may have poor +numerical solutions when $\varepsilon \ll \norm{\vec{\beta}}$. To +combat this, we will consider the new weak form + +@f{align*}{ +a(u_h,\,v_h) + (-\varepsilon \Delta u_h + \vec{\beta}\cdot +\nabla u_h-f,\,\delta \vec{\beta}\cdot \nabla v_h) = F(v_h) +@f} + +where $\delta$ is a stabilization parameter defined in +On Discontinuity—Capturing Methods for Convection—Diffusion Equations +by Volker and Petr. Essentially, adding in the discrete strong +form residual enhances the coercivity of the bilinear form +$a(\cdot,\cdot)$ which increases the stability of the discrete +solution. This method is commonly referred to as \textit{streamline +diffusion} or \textit{SUPG} (streamline upwind/Petrov-Galerkin).

Smoothers

One of the goals of this tutorial is to expand from using a simple -(point-wise) Gauss-Seidel (SOR) smoother that is used in step-16 (class -PreconditionSOR) on each level of the multigrid hierarchy. Here, we consider -point-wise smoothers (Jacobi and SOR) and cell-based smoothers (Block Jacobi -and Block SOR). The cell-based smoothers can best be explained within the framework -of additive and multiplicative Schwarz methods. +(point-wise) Gauss-Seidel (SOR) smoother that is used in step-16 +(class PreconditionSOR) on each level of the multigrid hierarchy. +Here, we consider point-wise smoothers (Jacobi and SOR) and cell-based +smoothers (Block Jacobi and Block SOR). The cell-based smoothers can +best be explained within the framework of additive and multiplicative +Schwarz methods. In contrast to step-16, our test problem contains an advective term. Especially with small viscosity, information is transported along @@ -104,8 +158,33 @@ Schwarz methods are implemented in a unified framework. Finally, let us note that the standard Gauss-Seidel (or SOR) method can be seen as a multiplicative Schwarz method with a subproblem for each DoF. +

Test problem

- Show - image of solution without and with SUPG. +We will be considering the following test problem: $\Omega = +[-1,\,1]\times[-1,\,1]$ with circle of radius 0.3 centered at the +origin removed, $\varepsilon=0.005$, $\vec{\beta} = +[-\sin(\pi/6),\,\cos(\pi/6)]$, $f=0$, and the boundary function + +@f{align*}{ +g = \left\{\begin{array}{ll} 1 & x=-1 \text{ OR } y=-1,\,x\geq 0.5 \\ +0 & \text{else} \end{array}\right. +@f} + +The following figures depict the solutions with (left) and without +(right) streamline diffusion. Without streamline diffusion we see high +oscillations around the boundary layer, demonstrating the instability +of the standard Galerkin finite elements for this problem. + + + + + + + +
+ + + +
diff --git a/examples/step-63/doc/results.dox b/examples/step-63/doc/results.dox index 1ad4a9948e..c89903afdf 100644 --- a/examples/step-63/doc/results.dox +++ b/examples/step-63/doc/results.dox @@ -480,20 +480,19 @@ of an additive method. This is a major disadvantage to these methods. able to compute the inverse of the cell matrices much cheaper than what is currently being done inside deal.II. This research is based on the fast diagonalization method (dating back to the 1960s) and has -been used in the spectral community for around 20 years (see, e.g., -https://doi.org/10.1007/s10915-004-4787-3). There are currently -efforts to generalize these methods to DG and make them more -robust. Also, it seems that one should be able to take advantage of -matrix-free implementations and the fact that, in the interior of -the domain, cell matrices tend to look very similar, allowing fewer -matrix inverse computations. +been used in the spectral community for around 20 years (see, e.g., Hybrid +Multigrid/Schwarz Algorithms for the Spectral Element Method by Lottes +and Fischer). There are currently efforts to generalize these +methods to DG and make them more robust. Also, it seems that one +should be able to take advantage of matrix-free implementations and +the fact that, in the interior of the domain, cell matrices tend to +look very similar, allowing fewer matrix inverse computations. Combining 1. and 2. gives a good reason for expecting that a method like block Jacobi could become very powerful in the future, even though currently for these examples it is quite slow. - -

Possible Extensions

Constant iterations for Q5

diff --git a/examples/step-63/step-63.cc b/examples/step-63/step-63.cc index e765e38c3a..a53c43ed3e 100644 --- a/examples/step-63/step-63.cc +++ b/examples/step-63/step-63.cc @@ -340,10 +340,14 @@ namespace Step63 // @sect3{Right-hand Side and Boundary Values} // The problem solved in this tutorial is an adaptation of Ex. 3.1.3 - // found on pg. 118 of Finite Elements and Fast Iterative Solvers: - // with Applications in Incompressible Fluid Dynamics by Elman, Silvester, - // and Wathen. The main difference being that we add a hole in the center - // of our domain with zero Dirichlet boundary. + // found on pg. 118 of + // + // Finite Elements and Fast Iterative Solvers: with Applications in + // Incompressible Fluid Dynamics by Elman, Silvester, and Wathen with + // Applications in Incompressible Fluid Dynamics by Elman, Silvester, and + // Wathen. The main difference being that we add a hole in the center of our + // domain with zero Dirichlet boundary. // We have a zero right-hand side. template @@ -445,9 +449,9 @@ namespace Step63 // @sect3{Streamline Diffusion} // Streamline diffusion stabilization term. Value is defined in - // "On Discontinuity—Capturing Methods for Convection—Diffusion - // Equations" by Volker and Petr - // (https://link.springer.com/chapter/10.1007/978-3-540-34288-5_27). + // + // On Discontinuity—Capturing Methods for Convection—Diffusion Equations + // by Volker and Petr template double compute_stabilization_delta(const double hk, const double eps, @@ -723,13 +727,13 @@ namespace Step63 copy_data.cell_matrix(i, j) += // Galerkin contribution: (settings.epsilon * - scratch_data.fe_values.shape_grad(j, q_point) * scratch_data.fe_values.shape_grad(i, q_point) * + scratch_data.fe_values.shape_grad(j, q_point) * scratch_data.fe_values.JxW(q_point)) + - ((advection_direction * + (scratch_data.fe_values.shape_value(i, q_point) * + (advection_direction * scratch_data.fe_values.shape_grad(j, q_point)) * - scratch_data.fe_values.shape_value(i, q_point)) * - scratch_data.fe_values.JxW(q_point) + + scratch_data.fe_values.JxW(q_point)) + // Streamline diffusion contribution: delta * (advection_direction * -- 2.39.5