From 8849683d787caf8582d11b41531a345b422c3d49 Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 17 Sep 2001 09:43:36 +0000 Subject: [PATCH] New example. git-svn-id: https://svn.dealii.org/trunk@5018 0785d39b-7218-0410-832d-ea1e28bc413d --- .../chapter-2.step-by-step/navbar.html | 6 + .../step-11.data/img1.gif | Bin 0 -> 917 bytes .../step-11.data/img10.gif | Bin 0 -> 292 bytes .../step-11.data/img2.gif | Bin 0 -> 885 bytes .../step-11.data/img3.gif | Bin 0 -> 161 bytes .../step-11.data/img4.gif | Bin 0 -> 592 bytes .../step-11.data/img5.gif | Bin 0 -> 791 bytes .../step-11.data/img6.gif | Bin 0 -> 90 bytes .../step-11.data/img7.gif | Bin 0 -> 670 bytes .../step-11.data/img8.gif | Bin 0 -> 575 bytes .../step-11.data/img9.gif | Bin 0 -> 674 bytes .../step-11.data/intro.html | 176 ++++++++++++++++++ .../step-11.data/intro.tex | 113 +++++++++++ .../tutorial/chapter-2.step-by-step/toc.html | 6 + 14 files changed, 301 insertions(+) create mode 100644 deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/img1.gif create mode 100644 deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/img10.gif create mode 100644 deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/img2.gif create mode 100644 deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/img3.gif create mode 100644 deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/img4.gif create mode 100644 deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/img5.gif create mode 100644 deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/img6.gif create mode 100644 deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/img7.gif create mode 100644 deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/img8.gif create mode 100644 deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/img9.gif create mode 100644 deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/intro.tex diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/navbar.html b/deal.II/doc/tutorial/chapter-2.step-by-step/navbar.html index 22fbbbee79..23f5670888 100644 --- a/deal.II/doc/tutorial/chapter-2.step-by-step/navbar.html +++ b/deal.II/doc/tutorial/chapter-2.step-by-step/navbar.html @@ -83,6 +83,12 @@ Step 10

+ +
  • +

    + Step 11 +

    +
  • diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/img1.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/img1.gif new file mode 100644 index 0000000000000000000000000000000000000000..d802d37b6f655496de1c706be48aa99c4d8f672a GIT binary patch literal 917 zcmV;G18V$7Nk%w1VFv*y0OJ4v0001}sHmKroRE-^goK26czA4VY+ztuR8&+*NJu<9 zJTNdYBqSsl7#Iu;470PdA^8LW000jFEC2ui00#jm06+x(@X1N*Ji+SC`xAsGj$~<` zXsVV25w2B%%=COvia-fYGX;Rc2k?SPg2tqB$y_1;lIMiDQ6MG)fUe2ydcWYXc-)Z* z$>_9ty);`|#Z&<)F=#nJVK$y(EF=d|Y=eX;Qd3ul4^%O94|ZEtSa(Yc0s%c}1OOR@ zo}Wzv0DlylSD+681Uds-Mv|zpvSbB(v$wdpx*`Gw2Lg(_!ow=9D!so?qNEe1DsB@A zHw6p@13#+|#!3bb#NS^oatLQ?3YlpO2o9&NKk_Y0E_+vECvLYq+7$2h6E{ML}5Sz0{R{- zC?G=v0tKBKX5omkr>uTHg9;r=w5ZWE1{!SPd9*3Gq)V^N`*BZ2w`&hJG1$=W--Cb_ z0vH^-03n3{46Xn%>+~e1GY7UlfS8IUg{u;@QnWY$BZ^I(3OERWz)pw-^sg<)ex|N0{o3epJ*@ykbnXVB;cl*VGLl!cshhP19=<3S<9SSj8Xx5CpbXh zCN|bFUvv#rYQh174FMsbV<0HO9@0^$fuzmU_`rV@1n3Ya6O1_DpbWTjAb1Kg*kA>! zeuWRHX(*CMsYlrIL{1~F+KM+(MP!J=M#4FO)d8eX@fm%+ literal 0 HcmV?d00001 diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/img10.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/img10.gif new file mode 100644 index 0000000000000000000000000000000000000000..7f1f35cedfc4f432f917029a71488e487f348742 GIT binary patch literal 292 zcmZ?wbhEHbG-u#tc+3C-D^{$SGiT0(2@_gcS}H0ka&mGK5)wi}LOeV?Y;0@{3=C9M zR3s!MczAd=Z{DoBDcZn4hzQn^%S_d5JWiIy;{bH$#(AZIwsI*7>z!)_Ob}r8)NN#WnpQa zXej_%>b~aM!gNh9fN(DJ=Clcg#2^6_0)z^Zz&s?FOx*`3bsZdm$7)ddNrDuBf?(jn z5P%5*kn9uy2h*T!t5e=_n1E@v`zvMuL=y~y4+af?iWWtN4-Ewp3yFmjh>Msg0dSd} z8=HBaqA36jC`Kg;3oZmbC8eVhs+bOKS0D<4CkU$^3{D6?1_uoY2n`1dRUEA+xsE9V z4XQaCzX`zzg9--*3(zhF4h01bW(p3=n==6h*a-$%u{G;=*a}(g@A32f{-aF(3EW`7 z!Gi*!2G%HeFrmVE3DP{Y6LI1|G;~BXSdidDIRO5BJYgL5F{GaY3Z9fWz`_IqblTi- z%*91Of&{;gnWWI{1WQ+%f-r!$p}2Wv8JSktS-rkxVdNEiUp5CT(& zKJ+X>l?JB=3WQM5YN4xy16-miSwOe0T}N`ER`UQLQHTHzST4(i)`H``wYw18m{* z09|Wzcbk9@V)nv)8f*fMI6AN;0c{Y@W!H+1n3z`wn-m8EDjdAgMtWOWMnM3^7z1IC zt(gXZj3;FGz-ANJC;^T~4%vWzD7ffh2S1%K-v*m$1y35t*(4T+98?KIB?AOjL6&KB z#8n5>lb)}0)+z;LF&-B&@iJ9uQS$H(RG4NW z;PQv(K#(9qjOM;}h7Fq}HCx>tE$y+Cn96*>LGqQxo&`^WXB(`We8}O!426VS>c L*EsicFjxZs&~r9S literal 0 HcmV?d00001 diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/img4.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/img4.gif new file mode 100644 index 0000000000000000000000000000000000000000..fab1e8d0d1fb7c1da4109ce6245080a7cf9e6451 GIT binary patch literal 592 zcmV-W0H;0OJ4v0001}sHmKroRE-^goK26czA4VY+ztuR8&+*NJu<9 zJTNdYBqSsl7#Iu;470PdA^8LW000jFEC2ui0B`^y06+x(@X1N5y*TU5yYCG{B@RU_ zmSRkfNFBiX49#{ZOTH*tc%2m$%QbfFh*r_Y~2g9;s*VIoluMtz1G!D|2kRu2Lw_!VsFq^3_xP2E6=LP1tm zwQ0f=HQ9umin>}@D)x>^vy*6+syKm^I)DH~4Pa=3?gKq!8XVxIA%I^Kn6BvMo6Rra z3kaI%kdo8_tOpHhyaF&0q=f@yJw&Ez8B=CdoLyRY2k9otbr9XMQKC45CnWIzI#q81deChi{v0St6w2rf&ms^Z5(d0GC@c_ASl25jtgNk@)t*2#=t eG_C^_q3t=mKT5y8{rmXy>)+46zkfjy0027_6Ycx} literal 0 HcmV?d00001 diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/img5.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/img5.gif new file mode 100644 index 0000000000000000000000000000000000000000..36b451d1d66a40888aaab54571423ca63cd222ee GIT binary patch literal 791 zcmV+y1L*umNk%w1VUGYL0OJ4v0001}sHmKroRE-^goK26czA4VY+ztuR8&+*NJu<9 zJTNdYBqSsl7#Iu;470PdA^8LW000jFEC2ui0FMA906+x(@X1N5y*TU5yZ<1kI6$L3 zNCP;F@DPi26i+Zn3{oldq!q&mWp`>_BE@PJhz&Zfv znid2Y1qe(Sr@}zsm>_g#$z5guiLC)j7;1KHZ*g;VdUzCjXpfMQl9QB`mY0~BkXD+V zo{t6q1QP;gb_)&&E)N1HTL7>C2UA)T1`Gu-3IL^R5(K6`d87?e9-*TZYN@LPwGy|v z3%k7)z{3i|pHr@q34Pla1l^I};pgb->g(*D2nxPF0<8oG4$1A3@A2pj&k2ft#Vat2 zhyoiFeo!!QP)~yg4xT+Y007*B0S_}AfVZF{ISc;&#Klu+t09Vq5i3x%h!H~rUkLzg zkT}Sf13@ojJrINM0fTsicC7mFl0pDC7lKN-IYlQ=3O|+kGJpy|lmQD=Ft7-z6w(I@ z5(IHzELO4wunI0UMggONp%|!==veiu1+PBDA|N}#tOT?=C-7YtparBrb_pAPggBq$ z$B-jSo=my2<;$2eYu3bxhzX}uZQgB%rI3PfEneFHyvYmjDzK8SL2*yMKd=&^VUwr`FXH9;CDPt8~DwIaS3>+x+ zfB}O6GeiR!6~c)l6RPEbYKhgfP=)|(*r6U{G!kGb!;FUkXdNi^hb_EZ@m`LN@S{L{ z8^EX=kb10fBQ!i_Lkf?lxR%|8#!XT{Ex;gEfCFv}Al8q66@WxSFET(R2E<8F*mb;7 zX~<4kUbN*Z3wVi5fZLF?1p*RoFhD>S1fT|89aUoIPIxx4XFEJdf|X;5MzZK=kVY!$ Vq?A@_>7|%vs_CYjcIrU{06UWzJ|X}B literal 0 HcmV?d00001 diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/img6.gif b/deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/img6.gif new file mode 100644 index 0000000000000000000000000000000000000000..b34a2f17600deebe76263e1409d99e082079c161 GIT binary patch literal 90 zcmZ?wbhEHbM)j+_8! zWU8(#y8r@f2udO~hlDJYApwN|fwJQ`Pzl8Zpdc6qEgfJ&01PPwKrRXjEMlENBET(s zpbvm=(kMt4jR#}>FvQLH{3@W;`~Oh@41fxB9|LzF3Os)fR|gIp3TjaT4hIPf7%?Vf z4+jkh2smF94rmn&mddNTAW^N_EVJ??khvj%Ft;8U07#anoCuvEr~%p-Ab`^j0|2x&V}kC7 zQz3Bt$pWTI+6UWCjzd{?M;s2N_biFX!Zt(ULP6tep$1gsDgWP-$7rk1g#qdJ8b$#D~i zF+gS^DpyYqh{Qn%CsfYTw-5kJzlp_qC{6Gb2Lk}87C4&W6_x|$DJWJI3ki@*Jv`Jf zL2C{&qY?!)h@#hTNL`j;6p0~VM=}O9BpE&vFp%JgT<~|2VF(J%8Nk%w1VOIbp0OJ4v0001}sHmKroRE-^goK26czA4VY+ztuR8&+*NJu<9 zJTNdYBqSsl7#Iu;470PdA^8LW000jFEC2ui09ODd06+x(@X7fGxGU>@J2+G*j$~<` zC~_fasw7guwyio506|L#6YM}rBT)$M5(1-g$uuntGi2znkPsZdf^6^*AhZtx0|9E9 zfrg8MRy>;vFWpk$XftuY1K?o@Bo;{_0ULx*6gYA?fhGY%1douB1W*hY4Q`k;eh831 z0R{sD0egxQ0y&wfsuY1-tEvH&4z4FxcCWY-0S*AOxtR`f2M$Vfy+2C^0xuE`We;CX zHdd%X3@~SO2Y(C-Nd{GKbp;Ks3e_Y7zAXmWze>m>0h09f1o7`?19Bw=2?z?1efpQ6 zPd;e|90X!8qCuMlmmV-MFu_1X0tglz)TD9123PHmXebyUfPu!1K@wbeMq<(e01Q#4 zvH&0=iUICqVtV;O=aL=)V%=&%Gp5fS1poxXL2Cz3eo6`)NGd@=xC&4u3@W67;)H2o z&;d!hZpo-3r?N`hLrpD;SYDeDh-lRdf`liH)Zq~mAifd_)?k{KgrtNgGnxoEU~obK zw-hYqC6O~ofXQy8nxHe3M1XTmk1DC;p|t50qEoA0%{oN1iU?vS5m4?yfpE+u{Apdn z4%|_0WfKt z9t6gOL6|r!g06&XM9Q`J>=>X>QS&nd08a;G1_22R0w@6@jtd4@0uFzG7J`I^4~UAE zSOG%>qNAh)1_%ru4W6t^2$iQtivkS;KV2>pi5Urt6|b$qo@58P6u=b$1ir$}jHwQ` zCZ)y0MXYv1_H)r6Uf~aliN>N1Er)7-{EI0l@gN&i3|#hbPsWe^UVx=SgUt0 z-yAs#95CAeihzQDo(6DBVL)KHi;UQ5WS0)3M=k!!J~rdz>p&!P3XY_D(1Do%0Mahp zA<6FmM3F(J(CaiI00RUE7Dx-=;Y6W9Mqa3)Kp=+@A_tK4!PzW9(G8{+09Z=3tAq{! zR;3tV(JNK0Cd{f;0ha4p7&gf~P#|X=qemi6RzcgQS%J6`=u)to3_y{Wea#lw7Sl=$ zFp$p>Jq#dm1_EN~3OHgwAw8QHed=w7Ij|xb2s-;}kxtp70lpxiw$m-a)NZa>GLyX` zKuM|A3^Z7%p)4!kL2@^nbTgR(m~TI(DnY$Ej_BC4Yv10DaE1a2SW5^{5kZ1O7#dyh z&V2_W1f!miA25I@8UQXUV*t{gNovmzxKULG6$^;PfL_8$&=hedjiXvWMD(`-Zx8fR zK~M@h@I(PI*s>XiX#5n91Qtpl+YxBoA)y7xaUg;;qNtz%Yzz=52XYNPv|=#6G)9k8 I&O`tJJ8by_umAu6 literal 0 HcmV?d00001 diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/intro.html b/deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/intro.html index e69de29bb2..53dd2763f5 100644 --- a/deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/intro.html +++ b/deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/intro.html @@ -0,0 +1,176 @@ + +

    Introduction

    + +

    +In this example, we demonstrate solving a simple Laplace problem using +higher order mappings, as well as using some stranger sort of +constraints and a variant of the SparsityPattern +class. As was noted in the introduction to the step-10 example program, it is difficult to find +problems where it actually makes a difference in the convergence order +whether we use simple linear mappings of the unit cells to the cells +in real space, or higher order mappings. Such problems are not exotic +(in fact, only the work with such problems generated the interest in +implementing higher order mappings in deal.II), and include for +example the numerical solution of the Euler equations of inviscid gas +flow, but they are too complicated to be made the subject of an +example program. We therefore restrict our attention to a problem +which exhibits the same order of convergence, but profits +significantly from higher order mappings nevertheless, by a reduced +size of the error. +

    + +

    +The problem we will be considering is the solution of Laplace's problem with +Neumann boundary conditions only: +
    +\begin{align*}-\Delta u &= f &&\text{in $\Omega$ },
+\\
+\partial_n u &= g && \text{on $\partial\Omega$ }.
+\end{align*} +
    +It is well known that if this problem is to have a solution, then the forces +need to satisfy the compatibility condition +
    +\begin{gather*}\int_\Omega f\; dx + \int_{\partial\Omega} g\; ds = 0.
+\end{gather*} +
    +We will consider the special case that $\Omega$ +is the circle of radius 1 +around the origin, and f=-2, g=1. This choice satisfies the compatibility +condition. + +

    +The compatibility condition allows a solution of the above equation, but it +nevertheless retains an ambiguity: since only derivatives of the solution +appear in the equations, the solution is only determined up to a constant. For +this reason, we have to pose another condition for the numerical solution, +which fixes this constant. + +

    +For this, there are various possibilities: +

      +
    • Fix one node of the discretization to zero or any other fixed value. + This amounts to an additional condition + +uh(x0)=0. Although this is + common practice, it is not necessarily a good idea, since we know that the + solutions of Laplace's equation are only in H1, which does not allow for + the definition of point values because it is not a subset of the continuous + functions. Therefore, even though fixing one node is allowed for + discretitized functions, it is not for continuous functions, and one can + often see this in a resulting error spike at this point in the numerical + solution. +
    • Fixing the mean value over the domain to zero or any other value. This + is allowed on the continuous level, since + +$H^1(\Omega)\subset L^1(\Omega)$ +by Sobolev's inequality, and thus also on the continuous level since we + there only consider subsets of H1. +
    • Fixing the mean value over the boundary of the domain to zero or any + other value. This is also allowed on the continuous level, since + + +$H^{1/2}(\partial\Omega)\subset L^1(\partial\Omega)$, +again by Sobolev's + inequality. +
    We will choose the last possibility, since we want to demonstrate another +technique with it. + +

    +While this describes the problem to be solved, we still have to figure out how +to implement it. Basically, except for the additional mean value constraint, +we have solved this problem several times, using Dirichlet boundary values, +and we only need to drop the treatment of Dirichlet boundary nodes. The use of +higher order mappings is also rather trivial and will be explained at the +various places where we use it; in almost all conceivable cases, you will only +consider the objects describing mappings as a black box which you need to +worry about, because their only uses seem to be to be passed to places deep +inside the library where functions know how to handle them (i.e. in the +FEValues classes and their descendents). + +

    +The tricky point in this program is the use of the mean value +constraint. Fortunately, there is a class in the library which knows how to +handle such constraints, and we have used it quite often already, without +mentioning its generality. Note that if we assume that the boundary nodes are +spaced equally along the boundary, then the mean value constraint +
    +\begin{gather*}\int_{\partial \Omega} u(x) \; ds = 0
+\end{gather*} +
    +can be written as +
    +\begin{gather*}\sum_{i\in\partial\Omega_h} u_i = 0,
+\end{gather*} +
    +where the sum shall run over all degree of freedom indices which are located +on the boundary of the computational domain. Let us denote by i0 that index +on the boundary with the lowest number (or any other conveniently chosen +index), then the constraint can also be represented by +
    +\begin{gather*}u_{i_0} = \sum_{i\in\partial\Omega_h\backslash i_0} -u_i.
+\end{gather*} +
    +This, luckily, is exactly the form of constraints for which the +ConstraintMatrix class was designed. Note that we have used this +class in several previous examples for the representation of hanging nodes +constraints, which also have this form: there, the middle vertex shall have +the mean of the values of the adjacent vertices. In general, the +ConstraintMatrix class is designed to handle homogeneous constraints +of the form +
    +\begin{gather*}CU = 0
+\end{gather*} +
    +where C denotes a matrix, and U the vector of nodal values. + +

    +In this example, the mean value along the boundary allows just such a +representation, with C being a matrix with just one row (i.e. there is only +one constraint). In the implementation, we will create a +ConstraintMatrix object, add one constraint (i.e. add another row to +the matrix) referring to the first boundary node i0, and insert the weights +with which all the other nodes contribute, which in this example happens to be +just -1. + +

    +Later, we will use this object to eliminate the first boundary node from the +linear system of equations, reducing it to one which has a solution without +the ambiguity of the constant shift value. One of the problems of the +implementation will be that the explicit elimination of this node results in a +number of additional elements in the matrix, of which we do not know in +advance where they are located and how many additional entries will be in each +of the rows of the matrix. We will show how we can use an intermediate object +to work around this problem. + +

    +But now on for the implementation of the program solving this problem... +

    diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/intro.tex b/deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/intro.tex new file mode 100644 index 0000000000..79adfde4f5 --- /dev/null +++ b/deal.II/doc/tutorial/chapter-2.step-by-step/step-11.data/intro.tex @@ -0,0 +1,113 @@ +\documentclass{article} +\usepackage{amsmath} + +\begin{document} +The problem we will be considering is the solution of Laplace's problem with +Neumann boundary conditions only: +\begin{align*} + -\Delta u &= f &&\text{in $\Omega$}, + \\ + \partial_n u &= g && \text{on $\partial\Omega$}. +\end{align*} +It is well known that if this problem is to have a solution, then the forces +need to satisfy the compatibility condition +\begin{gather*} + \int_\Omega f\; dx + \int_{\partial\Omega} g\; ds = 0. +\end{gather*} +We will consider the special case that $\Omega$ is the circle of radius 1 +around the origin, and $f=-2$, $g=1$. This choice satisfies the compatibility +condition. + +The compatibility condition allows a solution of the above equation, but it +nevertheless retains an ambiguity: since only derivatives of the solution +appear in the equations, the solution is only determined up to a constant. For +this reason, we have to pose another condition for the numerical solution, +which fixes this constant. + +For this, there are various possibilities: +\begin{itemize} +\item Fix one node of the discretization to zero or any other fixed value. + This amounts to an additional condition $u_h(x_0)=0$. Although this is + common practice, it is not necessarily a good idea, since we know that the + solutions of Laplace's equation are only in $H^1$, which does not allow for + the definition of point values because it is not a subset of the continuous + functions. Therefore, even though fixing one node is allowed for + discretitized functions, it is not for continuous functions, and one can + often see this in a resulting error spike at this point in the numerical + solution. + +\item Fixing the mean value over the domain to zero or any other value. This + is allowed on the continuous level, since $H^1(\Omega)\subset L^1(\Omega)$ + by Sobolev's inequality, and thus also on the continuous level since we + there only consider subsets of $H^1$. + +\item Fixing the mean value over the boundary of the domain to zero or any + other value. This is also allowed on the continuous level, since + $H^{1/2}(\partial\Omega)\subset L^1(\partial\Omega)$, again by Sobolev's + inequality. +\end{itemize} +We will choose the last possibility, since we want to demonstrate another +technique with it. + +While this describes the problem to be solved, we still have to figure out how +to implement it. Basically, except for the additional mean value constraint, +we have solved this problem several times, using Dirichlet boundary values, +and we only need to drop the treatment of Dirichlet boundary nodes. The use of +higher order mappings is also rather trivial and will be explained at the +various places where we use it; in almost all conceivable cases, you will only +consider the objects describing mappings as a black box which you need to +worry about, because their only uses seem to be to be passed to places deep +inside the library where functions know how to handle them (i.e. in the +\texttt{FEValues} classes and their descendents). + +The tricky point in this program is the use of the mean value +constraint. Fortunately, there is a class in the library which knows how to +handle such constraints, and we have used it quite often already, without +mentioning its generality. Note that if we assume that the boundary nodes are +spaced equally along the boundary, then the mean value constraint +\begin{gather*} + \int_{\partial \Omega} u(x) \; ds = 0 +\end{gather*} +can be written as +\begin{gather*} + \sum_{i\in\partial\Omega_h} u_i = 0, +\end{gather*} +where the sum shall run over all degree of freedom indices which are located +on the boundary of the computational domain. Let us denote by $i_0$ that index +on the boundary with the lowest number (or any other conveniently chosen +index), then the constraint can also be represented by +\begin{gather*} + u_{i_0} = \sum_{i\in\partial\Omega_h\backslash i_0} -u_i. +\end{gather*} +This, luckily, is exactly the form of constraints for which the +\texttt{ConstraintMatrix} class was designed. Note that we have used this +class in several previous examples for the representation of hanging nodes +constraints, which also have this form: there, the middle vertex shall have +the mean of the values of the adjacent vertices. In general, the +\texttt{ConstraintMatrix} class is designed to handle homogeneous constraints +of the form +\begin{gather*} + CU = 0 +\end{gather*} +where $C$ denotes a matrix, and $U$ the vector of nodal values. + +In this example, the mean value along the boundary allows just such a +representation, with $C$ being a matrix with just one row (i.e. there is only +one constraint). In the implementation, we will create a +\texttt{ConstraintMatrix} object, add one constraint (i.e. add another row to +the matrix) referring to the first boundary node $i_0$, and insert the weights +with which all the other nodes contribute, which in this example happens to be +just $-1$. + +Later, we will use this object to eliminate the first boundary node from the +linear system of equations, reducing it to one which has a solution without +the ambiguity of the constant shift value. One of the problems of the +implementation will be that the explicit elimination of this node results in a +number of additional elements in the matrix, of which we do not know in +advance where they are located and how many additional entries will be in each +of the rows of the matrix. We will show how we can use an intermediate object +to work around this problem. + +But now on for the implementation of the program solving this problem... + +\end{document} diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/toc.html b/deal.II/doc/tutorial/chapter-2.step-by-step/toc.html index 8a2f794707..ab7f8c4758 100644 --- a/deal.II/doc/tutorial/chapter-2.step-by-step/toc.html +++ b/deal.II/doc/tutorial/chapter-2.step-by-step/toc.html @@ -117,6 +117,12 @@ At present, the following programs exist: solve equations, but rather compute the value of pi to high accuracy. + +
    Step 11
    +
    What's new: Solving a Laplace problem with + higher order mappings. Using strange constraints and + intermediate representations of sparsity patterns. +
    -- 2.39.5