From 535f84b592743c187d6709d9b61e4600f842e7bb Mon Sep 17 00:00:00 2001 From: bangerth Date: Sun, 30 Oct 2011 08:19:05 +0000 Subject: [PATCH] Discuss what a DoF is in some more detail. git-svn-id: https://svn.dealii.org/trunk@24696 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-2/doc/intro.dox | 37 ++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/deal.II/examples/step-2/doc/intro.dox b/deal.II/examples/step-2/doc/intro.dox index 6c4b30f394..bef310a19a 100644 --- a/deal.II/examples/step-2/doc/intro.dox +++ b/deal.II/examples/step-2/doc/intro.dox @@ -9,13 +9,40 @@ examples will demonstrate higher order elements where degrees of freedom are not necessarily associated with vertices any more, but can be associated with edges, faces, or cells. +The term "degree of freedom" is commonly used in the finite element community +to indicate two slightly different, but related things. The first is that we'd +like to represent the finite element solution as a linear combination of shape +function, in the form $u_h(\mathbf x) = \sum_{j=0}^{N-1} U_j \varphi_j(\mathbf +x)$. Here, $U_j$ is a vector of expension coefficients. Because we don't know +their values yet (we will compute them as the solution of a linear or +nonlinear system), they are called "unknowns" or "degrees of freedom". The +second meaning of the term con be explained as follows: A mathematical +description of finite element problem is often to say that we are looking for +a finite dimensional function $u_h \in V_h$ that satisfies some set of equations +(e.g. $a(u_h,\varphi_h)=(f,\varphi_h)$ for all test functions $\varphi_h\in +V_h$). In other words, all we say here that the solution needs to lie in some +space $V_h$. However, to actually solve this problem on a computer we need to +choose a basis of this space; this is the set of shape functions +$\varphi_j(\mathbf x)$ we have used above in the expansion of $u_h(\mathbf x)$ +with coefficients $U_j$. There are of course many bases of the space $V_h$, +but we will specifically choose the one that is described by the finite +element functions that are traditionally defined locally on the cells of the +mesh. Describing "degrees of freedom" in this context requires us to simply +enumerate the basis functions of the space $V_h$. For $Q_1$ elements +this means simply enumerating the vertices of the mesh in some way, but for +higher elements one also has to enumerate the shape functions that are +associated with edges, faces, or cell interiors of the mesh. The class that +provides this enumeration of the basis functions of $V_h$ is called DoFHandler. + Defining degrees of freedom ("DoF"s in short) on a mesh is a rather simple task, since the library does all the work for you. Essentially, all you have to do is create a finite element object (from one of the many finite element classes deal.II already has, see for example the @ref fe documentation) and give it to a DoFHandler object through the -DoFHandler::distribute_dofs function. The DoFHandler is a class that -manages which degrees of freedom live where, i.e. it can answer +DoFHandler::distribute_dofs function ("distributing DoFs" is the term we use +to describe the process of enumerating the basis functions as discussed +above). The DoFHandler is a class that +manages which degrees of freedom live where, i.e., it can answer questions like "how many degrees of freedom are there globally" and "on this cell, give me the global indices of the shape functions that live here". This is the sort of information you need when determining @@ -36,7 +63,7 @@ number of nonzero entries per row is five, and therefore independent of the total size of the matrix.) Sparsity is one of the distinguishing feature of the finite element method compared to, say, approximating the solution of a partial differential equation using a Taylor expension and matching -coefficients, or using a Fourier basis. +coefficients, or using a Fourier basis. In practical terms, it is the sparsity of matrices that enables us to solve problems with millions or billions of unknowns. To understand this, note that @@ -63,6 +90,8 @@ optimized for any particular purpose. However, for some algorithms, especially for some linear solvers and preconditioners, it is advantageous to have the degrees of freedom numbered in a certain order, and we will use the algorithm of Cuthill and McKee to do -so. The results are written to a file and visualized using a simple +so. This can be thought of as choosing a different, permuted basis of the +finite element space. +The results are written to a file and visualized using a simple visualization program; you get to see the outcome in the results section below. -- 2.39.5