From: wolf Date: Mon, 27 Mar 2006 22:54:26 +0000 (+0000) Subject: Use doxygen to generate intro. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69bd016087b9649148912eef2688feba7c4b87a2;p=dealii-svn.git Use doxygen to generate intro. git-svn-id: https://svn.dealii.org/trunk@12686 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro.tex b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro.dox similarity index 88% rename from deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro.tex rename to deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro.dox index ec8d95ea03..a928a5806f 100644 --- a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro.tex +++ b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro.dox @@ -1,17 +1,18 @@ -\documentclass{article} - -\begin{document} + +

Introduction

In this program, we will mainly consider two aspects: -\begin{itemize} -\item Verification of correctness of the program and generation of convergence -tables; -\item Non-homogeneous Neumann boundary conditions for the Helmholtz equation. -\end{itemize} +
    +
  1. Verification of correctness of the program and generation of convergence + tables; +
  2. Non-homogeneous Neumann boundary conditions for the Helmholtz equation. +
Besides these topics, again a variety of improvements and tricks will be shown. -\paragraph{Verification of correctness.} There has probably never been a +

Verification of correctness

+ +There has probably never been a non-trivial finite element program that worked right from the start. It is therefore necessary to find ways to verify whether a computed solution is correct or not. Usually, this is done by choosing the set-up of a simulation @@ -25,13 +26,13 @@ higher order. In this example, we will not go into the theories of systematic software verification which is a very complicated problem. Rather we will demonstrate the tools which deal.II can offer in this respect. This is basically centered -around the functionality of a single function, \texttt{integrate\_difference}. +around the functionality of a single function, integrate_difference. This function computes the difference between a given continuous function and a finite element field in various norms on each cell. At present, the supported norms are the following, where $u$ denotes the continuous function and $u_h$ the finite element field, and $K$ is an element of the triangulation: -\begin{eqnarray*} +@f{eqnarray*} {\| u-u_h \|}_{L_1(K)} &=& \int_K |u-u_h| \; dx, \\ {\| u-u_h \|}_{L_2(K)} &=& \left( \int_K |u-u_h|^2 \; dx \right)^{1/2}, @@ -42,7 +43,7 @@ triangulation: \\ {\| u-u_h \|}_{H^1(K)} &=& \left( {\| u-u_h \|}^2_{L_2(K)} +{| u-u_h |}^2_{H^1(K)} \right)^{1/2}. -\end{eqnarray*} +@f} All these norms and semi-norms can also be evaluated with weighting functions, for example in order to exclude singularities from the determination of the global error. The function also works for vector-valued functions. It should @@ -53,13 +54,13 @@ norm, where we evaluate the maximal deviation of numerical and exact solution only at the quadrature points; one should then not try to use a quadrature rule with points only at points where super-convergence might occur. -The function \texttt{integrate\_difference} evaluates the desired norm on each +The function integrate_difference evaluates the desired norm on each cell $K$ of the triangulation and returns a vector which holds these values for each cell. From the local values, we can then obtain the global error. For example, if the vector $(e_i)$ contains the local $L_2$ norms, then -$$ +@f[ E = \| {\mathbf e} \| = \left( \sum_i e_i^2 \right)^{1/2} -$$ +@f] is the global $L_2$ error. In the program, we will show how to evaluate and use these quantities, and we @@ -77,7 +78,9 @@ automatically computes convergence rates etc. In addition, we will compare different strategies for mesh refinement. -\paragraph{Non-homogeneous Neumann boundary conditions.} The second, totally +

Non-homogeneous Neumann boundary conditions

+ +The second, totally unrelated, subject of this example program is the use of non-homogeneous boundary conditions. These are included into the variational form using boundary integrals which we have to evaluate numerically when assembling the @@ -86,23 +89,23 @@ right hand side vector. Before we go into programming, let's have a brief look at the mathematical formulation. The equation which we want to solve is Helmholtz's equation ``with the nice sign'': -$$ +@f[ -\Delta u + u = f, -$$ +@f] on the square $[-1,1]^2$, augmented by boundary conditions -$$ +@f[ u = g_1 -$$ +@f] on some part $\Gamma_1$ of the boundary $\Gamma$, and -$$ +@f[ {\mathbf n}\cdot \nabla u = g_2 -$$ +@f] on the rest $\Gamma_2 = \Gamma \backslash \Gamma_1$. We choose the right hand side function $f$ such that the exact solution is -$$ +@f[ u(x) = \sum_{i=1}^3 \exp\left(-\frac{|x-x_i|^2}{\sigma^2}\right) -$$ +@f] where the centers $x_i$ of the exponentials are $x_1=(-\frac 12,\frac 12)$, $x_2=(-\frac 12,-\frac 12)$, and @@ -117,30 +120,30 @@ derivatives of the continuous solution. Using the above definitions, we can state the weak formulation of the equation, which reads: find $u\in H^1_g=\{v\in H^1: v|_{\Gamma_1}=g_1\}$ such that -$$ +@f[ {(\nabla u, \nabla v)}_\Omega + {(u,v)}_\Omega = {(f,v)}_\Omega + {(g_2,v)}_{\Gamma_2} -$$ +@f] for all test functions $v\in H^1_0=\{v\in H^1: v|_{\Gamma_1}=0\}$. The boundary term ${(g_2,v)}_{\Gamma_2}$ has appeared by integration by parts and using $\partial_n u=g$ on $\Gamma_2$ and $v=0$ on $\Gamma_1$. The cell matrices and vectors which we use to build the global matrices and right hand side vectors in the discrete formulation therefore look like this: -\begin{eqnarray*} +@f{eqnarray*} A_{ij}^K &=& \left(\nabla \varphi_i, \nabla \varphi_j\right)_K +\left(\varphi_i, \varphi_j\right)_K, \\ f_i^K &=& \left(f,\varphi_i\right)_K +\left(g_2, \varphi_i\right)_{\partial K\cap \Gamma_2}. -\end{eqnarray*} +@f} Since the generation of the domain integrals has been shown in previous examples several times, only the generation of the contour integral is of interest here. It basically works along the following lines: for domain -integrals we have the \texttt{FEValues} class that provides values and +integrals we have the FEValues class that provides values and gradients of the shape values, as well as Jacobian determinants and other information and specified quadrature points in the cell; likewise, there is a -class \texttt{FEFaceValues} that performs these tasks for integrations on +class FEFaceValues that performs these tasks for integrations on faces of cells. One provides it with a quadrature formula for a manifold with dimension one less than the dimension of the domain is, and the cell and the number of its face on which we want to perform the integration. The class will @@ -149,10 +152,3 @@ quadrature points on this face, which we can then use in the same way as for the domain integrals. The details of how this is done are shown in the following program. - -\end{document} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro.html b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro.html deleted file mode 100644 index d29257d4fc..0000000000 --- a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro.html +++ /dev/null @@ -1,310 +0,0 @@ - -

Introduction

- -

-In this program, we will mainly consider two aspects: -

Besides these topics, again a variety of improvements and tricks will be -shown. - -

- -

-Verification of correctness. -

There has probably never been a -non-trivial finite element program that worked right from the start. It is -therefore necessary to find ways to verify whether a computed solution is -correct or not. Usually, this is done by choosing the set-up of a simulation -such that we know the exact continuous solution and evaluate the difference -between continuous and computed discrete solution. If this difference -converges to zero with the right order of convergence, this is already a good -indication of correctness, although there may be other sources of error -persisting which have only a small contribution to the total error or are of -higher order. - -

-In this example, we will not go into the theories of systematic software -verification which is a very complicated problem. Rather we will demonstrate -the tools which deal.II can offer in this respect. This is basically centered -around the functionality of a single function, integrate_difference. -This function computes the difference between a given continuous function and -a finite element field in various norms on each cell. At present, the -supported norms are the following, where u denotes the continuous function -and uh the finite element field, and K is an element of the -triangulation: -

-
-\begin{eqnarray*}{\Vert u-u_h \Vert}_{L_1(K)} &=& \int_K \vert u-u_h\vert \; dx,...
-...ert}^2_{L_2(K)}
-+{\vert u-u_h \vert}^2_{H^1(K)} \right)^{1/2}.
-\end{eqnarray*} -

-
All these norms and semi-norms can also be evaluated with weighting functions, -for example in order to exclude singularities from the determination of the -global error. The function also works for vector-valued functions. It should -be noted that all these quantities are evaluated using quadrature formulas; -the choice of the right quadrature formula is therefore crucial to the -accurate evaluation of the error. This holds in particular for the $L_\infty$norm, where we evaluate the maximal deviation of numerical and exact solution -only at the quadrature points; one should then not try to use a quadrature -rule with points only at points where super-convergence might occur. - -

-The function integrate_difference evaluates the desired norm on each -cell K of the triangulation and returns a vector which holds these -values for each cell. From the local values, we can then obtain the global error. For -example, if the vector (ei) contains the local L2 norms, then -

-
- - - -\begin{displaymath}E = \Vert {\mathbf e} \Vert = \left( \sum_i e_i^2 \right)^{1/2}
-\end{displaymath} -
-
-

-is the global L2 error. - -

-In the program, we will show how to evaluate and use these quantities, and we -will monitor their values under mesh refinement. Of course, we have to choose -the problem at hand such that we can explicitly state the solution and its -derivatives, but since we want to evaluate the correctness of the program, -this is only reasonable. If we know that the program produces the correct -solution for one (or, if one wants to be really sure: many) specifically -chosen right hand sides, we can be rather confident that it will also compute -the correct solution for problems where we don't know the exact values. - -

-In addition to simply computing these quantities, we will show how to generate -nicely formatted tables from the data generated by this program that -automatically computes convergence rates etc. In addition, we will compare -different strategies for mesh refinement. - -

- -

-Non-homogeneous Neumann boundary conditions. -

The second, totally -unrelated, subject of this example program is the use of non-homogeneous -boundary conditions. These are included into the variational form using -boundary integrals which we have to evaluate numerically when assembling the -right hand side vector. - -

-Before we go into programming, let's have a brief look at the mathematical -formulation. The equation which we want to solve is Helmholtz's equation -``with the nice sign'': -

-
- - - -\begin{displaymath}-\Delta u + u = f,
-\end{displaymath} -
-
-

-on the square [-1,1]2, augmented by boundary conditions -

-
- - - -u = g1 -
-
-

-on some part $\Gamma_1$ -of the boundary $\Gamma$, -and -

-
- - - -\begin{displaymath}{\mathbf n}\cdot \nabla u = g_2
-\end{displaymath} -
-
-

-on the rest - -$\Gamma_2 = \Gamma \backslash \Gamma_1$. - -

-We choose the right hand side function f such that the exact solution is -

-
- - - -\begin{displaymath}u(x) = \sum_{i=1}^3 \exp\left(-\frac{\vert x-x_i\vert^2}{\sigma^2}\right)
-\end{displaymath} -
-
-

-where the centers xi of the exponentials are - - -$x_1=(-\frac 12,\frac 12)$, - - -$x_2=(-\frac 12,-\frac 12)$, -and - - -$x_3=(\frac 12,-\frac 12)$. -The half width is set to - -$\sigma=\frac 13$. - -

-We further choose - -$\Gamma_1=\Gamma \cap\{\{x=1\} \cup \{y=1\}\}$, -and there -set g1 such that it resembles the exact values of u. Likewise, we choose -g2 on the remaining portion of the boundary to be the exact normal -derivatives of the continuous solution. - -

-Using the above definitions, we can state the weak formulation of the -equation, which reads: find - -$u\in H^1_g=\{v\in H^1: v\vert _{\Gamma_1}=g_1\}$ -such -that -

-
- - - -\begin{displaymath}{(\nabla u, \nabla v)}_\Omega + {(u,v)}_\Omega
-=
-{(f,v)}_\Omega + {(g_2,v)}_{\Gamma_2}
-\end{displaymath} -
-
-

-for all test functions - -$v\in H^1_0=\{v\in H^1: v\vert _{\Gamma_1}=0\}$. -The -boundary term - -${(g_2,v)}_{\Gamma_2}$ -has appeared by integration by parts and -using - -$\partial_n u=g$ -on $\Gamma_2$ -and v=0 on $\Gamma_1$. -The cell -matrices and vectors which we use to build the global matrices and right hand -side vectors in the discrete formulation therefore look like this: -

-
-\begin{eqnarray*}A_{ij}^K &=& \left(\nabla \varphi_i, \nabla \varphi_j\right)_K
-...
-...ight)_K
-+\left(g_2, \varphi_i\right)_{\partial K\cap \Gamma_2}.
-\end{eqnarray*} -

-
Since the generation of the domain integrals has been shown in previous -examples several times, only the generation of the contour integral is of -interest here. It basically works along the following lines: for domain -integrals we have the FEValues class that provides values and -gradients of the shape values, as well as Jacobian determinants and other -information and specified quadrature points in the cell; likewise, there is a -class FEFaceValues that performs these tasks for integrations on -faces of cells. One provides it with a quadrature formula for a manifold with -dimension one less than the dimension of the domain is, and the cell and the -number of its face on which we want to perform the integration. The class will -then compute the values, gradients, normal vectors, weights, etc. at the -quadrature points on this face, which we can then use in the same way as for -the domain integrals. The details of how this is done are shown in the -following program. diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img1.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img1.gif deleted file mode 100644 index 4525a58002..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img1.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img10.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img10.gif deleted file mode 100644 index 955869a70c..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img10.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img11.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img11.gif deleted file mode 100644 index 2f2f027320..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img11.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img12.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img12.gif deleted file mode 100644 index 2f924a8229..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img12.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img13.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img13.gif deleted file mode 100644 index c757b8437b..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img13.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img14.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img14.gif deleted file mode 100644 index 90aaa668a8..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img14.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img15.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img15.gif deleted file mode 100644 index bbf9e45fac..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img15.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img16.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img16.gif deleted file mode 100644 index 006b092af9..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img16.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img17.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img17.gif deleted file mode 100644 index ac37f1349b..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img17.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img18.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img18.gif deleted file mode 100644 index c404d7f75d..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img18.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img19.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img19.gif deleted file mode 100644 index 953a1ca32a..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img19.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img2.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img2.gif deleted file mode 100644 index 57c9a91314..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img2.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img20.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img20.gif deleted file mode 100644 index c307dc2445..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img20.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img21.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img21.gif deleted file mode 100644 index 6bc6fef16b..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img21.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img22.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img22.gif deleted file mode 100644 index c731a52a55..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img22.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img3.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img3.gif deleted file mode 100644 index 202439a2d1..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img3.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img4.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img4.gif deleted file mode 100644 index a79273c209..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img4.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img5.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img5.gif deleted file mode 100644 index d5ace2e043..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img5.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img6.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img6.gif deleted file mode 100644 index 06035bd4e1..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img6.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img7.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img7.gif deleted file mode 100644 index d4fc5532fc..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img7.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img8.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img8.gif deleted file mode 100644 index 2c52f46750..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img8.gif and /dev/null differ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img9.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img9.gif deleted file mode 100644 index a2c1b2165d..0000000000 Binary files a/deal.II/doc/tutorial/chapter-2.step-by-step/step-7.data/intro/img9.gif and /dev/null differ