The Adaptive Finite Element Method for Poisson Equation with Algebraic Multigrid Solver Wenqiang Feng [email protected]Department of Mathematics, University of Tennessee, Knoxville, TN, 37909 September 1, 2014 Abstract This report is for my MATH 673 final project. In this report, I give some details for implementing the Adaptive Finite Element Method (AFEM) via Matlab. Moreover, I also describe how to implement the Algebraic Multigrid Solver with Matlab. Some functions are from my previous Finite Element Method(FEM) package [8][9, 10] and some functions are from Long Chen’ package [4][5]. Contents 1 List of Figures 2 2 List of Tables 2 3 1 The Model Problem 3 4 1.1 The weak formulation for the model problem ................ 4 5 1.2 The Galerkin approximation formula .................... 5 6 2 AFEM implementation 5 7 2.1 Poisson Solver .................................. 6 8 2.1.1 Data structure ............................. 6 9 1
19
Embed
The Adaptive Finite Element Method for Poisson Equation ...web.utk.edu/~wfeng1/doc/ReportMath673.pdf · The Adaptive Finite Element Method for Poisson Equation with Algebraic Multigrid
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
The Adaptive Finite Element Method for PoissonEquation with Algebraic Multigrid Solver
Department of Mathematics,University of Tennessee, Knoxville, TN, 37909
September 1, 2014
Abstract
This report is for my MATH 673 final project. In this report, I give some detailsfor implementing the Adaptive Finite Element Method (AFEM) via Matlab. Moreover,I also describe how to implement the Algebraic Multigrid Solver with Matlab. Somefunctions are from my previous Finite Element Method(FEM) package [8] [9, 10] andsome functions are from Long Chen’ package [4][5].
Contents1
List of Figures 22
List of Tables 23
1 The Model Problem 34
1.1 The weak formulation for the model problem . . . . . . . . . . . . . . . . 45
Before I give the derivation of the residual error estimator, I would to give the defini-1
tion of the domains (See Figure. 6) of inter point wp, interior edge we and element wk2
in [19].
Ω
wp
P
∂Ω
e
Ω ∂Ω
we
K
Ω ∂Ω
wk
Figure 6: The domains of inter point wp, interior edge we and element wk[19].
3
Now, I will recall the residual-type error estimator for (4) and (6). For a given par-4
tition TH , let uH be the finite element approximation of the solution u for the poisson5
equation (1). Then subtracting (6) from (4) and integrating by parts yields the following6
well-known relation between the error u −uH and the residuals:7
a(u −uH ,φ) =∑T ∈TH
(f ,φ−IHφ)T +∑e∈EIH
⟨Je,φ−IHφ
⟩e , ∀φ ∈H
10 . (7)
Where IH is the Clément interpolation operator and Je = ~∇uHe · ~n. The derivation of8
(7) needs the following two facts: First one is the Galerkin orthogonality,9
a(u −uH ,IHφ) = 0. (8)
The other one is10
~∇u · ~n = 0. (9)
Lemma 2.1. Trace Theorem[2]11
Let φ ∈H1(Ω). Then there exists a constant C > 0 such that12 ∥∥∥φ∥∥∥L2(∂Ω)
≤ 4√
8∥∥∥φ∥∥∥1/2
L2(Ω)
∥∥∥φ∥∥∥1/2H1(Ω)
. (10)
Lemma 2.2. Trace Theorem with Scaling argument[2]13
Let φ ∈H1(K) and e ⊂ ∂K . Then there exists a constant C > 0 such that14 ∥∥∥φ∥∥∥0,e≤ C
∥∥∥φ∥∥∥0,K
(H−1
∥∥∥φ∥∥∥0,K
+∥∥∥∇φ∥∥∥
0,K
)1/2≤ C
(H−1
∥∥∥φ∥∥∥20,K
+H∥∥∥∇φ∥∥∥2
0,K
)1/2(11)
10
Lemma 2.3. Clément Interpolation Theorem[21]1
Let IH be the quasi-interpolation operator. Then the operator IH satises the following local2
error estimates for all φ ∈ VH and all elements K ∈ TH3 ∥∥∥φ−IHφ∥∥∥0,K≤ CHk
∥∥∥φ∥∥∥1,wk
(12)
|φ−IHφ|0,e ≤ CH1/2e
∥∥∥φ∥∥∥1,we
(13)
Where the constant C only depending on the shape regularity of TH .4
By using the facts (8) and (9) together with the trace theorem with scaling argu-5
ment (Lemma 2.2) and the interpolation theory (Lemma 2.3) , we can get the following6
theorem.7
Theorem 2.1. For a given partition TH , let uH be the finite element approximation of the8
solution u for the poisson equation (1). Then there exists a constant C1 only depending9
depending on the shape regularity of TH such that10
|u −uH |21,Ω ≤ C1
∑K∈TH
‖Hf ‖20,K +∑e∈EIH
∥∥∥H1/2 ∇uH · ~n∥∥∥20,e
. (14)
Proof. For any φ ∈H10 and any IHφ ∈ VH , we have11
a(u −uH ,φ)
= a(u −uH ,φ−IHφ) (Galerkin orthogonality (8))
=∑K∈TH
∫K∇(u −uH )∇(φ−IHφ)dx
=∑K∈TH
∫∂K∇(u −uH ) · ~n(φ−IHφ)dS −
∑K∈TH
∫K∆(u −uH )(φ−IHφ)dx
=∑e∈EIH
∫e
∇uH · ~ne
(φ−IHφ)dS +
∑K∈TH
∫Kf (φ−IHφ)dx (Using fact (9))
=∑T ∈TH
(f ,φ−IHφ)T +∑e∈EIH
⟨Je,φ−IHφ
⟩e (Result (7))
≤∑T ∈TH
‖HKf ‖20,K∥∥∥H−1
K (φ−IHφ)∥∥∥2
0,K+
∑e∈EIH
∥∥∥H1/2e∇uH · ~ne
∥∥∥20,e
∥∥∥H−1/2e (φ−IHφ)
∥∥∥20,e
≤
∑T ∈TH
‖HKf ‖20,K +∑e∈EIH
∥∥∥H1/2e∇uH · ~ne
∥∥∥20,e
1/2 ∑
T ∈TH
∥∥∥H−1K (φ−IHφ)
∥∥∥20,K
+∥∥∥∇(φ−IHφ)
∥∥∥20,K
1/2
.
For the last step, we used the trace theorem with scaling argument (Lemma 2.2). And12
now, by using the quasi-interpolation operator theorem (Lemma 2.3), we can choose13
IHφ such that14 ∑T ∈TH
∥∥∥H−1K (φ−IHφ)
∥∥∥20,K
+∥∥∥∇(φ−IHφ)
∥∥∥20,K
1/2
≤ |φ|1,Ω. (15)
11
Then we get1
|u −uH |1,Ω = supφ∈H1
0
a(u −uH ,φ)|φ|1,Ω
≤
∑T ∈TH
‖HKf ‖20,K +∑e∈EIH
∥∥∥H1/2e∇uH · ~ne
∥∥∥20,e
1/2
(16)
2
From theorem (2.1), we can get the local residual-type error indictor3
η2e =
∑T ∈TH
‖HKf ‖20,K +∑e∈EIH
∥∥∥H1/2e∇uH · ~ne
∥∥∥20,e
(17)
:= ‖HKf ‖2we +∥∥∥H1/2
e Je∥∥∥2e
(18)
2.3 Marking4
I will use the following Dörfler marking strategy [7] in this project.
Algorithm 1 Dörfler marking strategyProcess:
1: Choose the parameter 0 < θ < 02: For a given subset Eh of EH3: while η(uH ,Eh) ≥ θη(uH ,EH ) do4: Mark the subset Th of TH of the element with the longest side in Eh.5: end while
5
2.4 Refinement6
I will use the newest vertex bisection (See Figure (7)) to do the refinement. For more7
details, you can find in[11].8
einterior edge
bisection
ep
eboundary edge
bisection
ep
Figure 7: The newest vertex bisection for interior edge and boundary edge.
12
3 Algebraic Multigrid Method1
In the following we will introduce the AMG method [15, 16, 18] that is appropriatefor solving the linear system which arises from the AFE method. Let A1
h = Ah, ~u1h = ~uh,
~b1h =~bh. Then in one V-cycle a sequence of linear systems
Amh ~umh =~bmh , m = 1, · · · ,M,
can be generated from different grid levels. Here Amh =(amij
)nm×nm
, ~bh =(bmi
)nm×1
, ~uh =2 (umi
)nm×1
, and n = n1 > n2 > · · · > nm. Now we discuss two main phases of the AMG3
algorithm: setup phase and solution phase [15].4
5
3.1 Setup phase of AMG6
In the setup phase, let Ωm denote the set of unknowns umi (1 ≤ i ≤ nm) of the mth grid7
level. And the coarser grid Ωm+1 is chosen as a subset of Ωm, which is denoted as Cm8
in the mth grid level. The remaining subset Ωm−Cm will be denoted by Fm. A point umi9
is said to be strongly connected to umj , if10
|amij | ≥ η ·maxi,j|amij |, 0 < η ≤ 1. (19)
Let Smi denote the set of all strongly connected points of umi and let the coarse in-11
terpolatory set be Cmi = Cm ∩ Smi . In general, Cm and Fm are chosen by the following12
criteria:13
14
(C1) For each umi ∈ Fm, each point umj ∈ S
mi should be either in Cmi itself or should be15
strongly connected to at least one point in Cmi ;16
(C2) Cm should be maximal subset of all points with the property that no two Coarse17
points are strongly connected to each other.18
19
Define the set of points which are strongly connected to umi to be20
Sm,Ti ≡ umj : umi ∈ Smj . (20)
For a set P , let |P | denote the number of the elements in P . Then Algorithm 2 is pro-21
posed by Ruge and Stüben in [16, 17] can be used to chose the coarse grid Ωm+1 = Cm22
and Fm.23
24
Once the coarse grid Ωm+1 is chosen, the interpolation operators Imm+1, restriction25
operators Im+1m and the coarse grid equation can be constructed as follows. Let Nm
i =26
umj ∈Ωm : j , i,amij , 0 denote the neighborhood of a point umi ∈Ω
m, and Dmi = Nmi −27
Cmi . Then the set of the fine grid neighborhood points which are strongly connected to28
umi will beDm,si =Dmi ∩Smi , and the rest set of the neighborhood points which are weakly29
13
Algorithm 2 The construction of coarse gridInput: Ωm.Output: Cm and Fm.Method:
1: Cm ∅,Fm ∅, ~umh Ωm and λmk = |Sm,Tk | (1 ≤ k ≤ nm)2: for (1 ≤ i ≤ nm) do3: if (~umh , ∅) then4: Pick the umi ∈ ~u
mh such that λmi = max
1≤k≤nmλmk , and setCm = Cm∪umi , ~u
mh = ~umh −u
mi
5: for (all umj ∈ Sm,Ti ∩ ~umh ) do
6: Set Fm = Fm ∪ j and ~umh = ~umh − j7: for (all uml ∈ S
mj ∩ ~u
mh ) do
8: set λml = λml + 19: end for
10: end for11: for (all umj ∈ S
mi ∩ ~u
mh ) do
12: set λmj = λmj − 113: end for14: else15: Stop.16: end if17: end for
connected (not strongly connected) to umi will be Dm,wi = Dmi −Dm,si . Each umi ∈ C
m can1
be directly interpolated from the corresponding variable in Ωm+1 with unity weight.2
Each umi ∈ Fm can be interpolated as a weighted summation of the points in the coarse3
interpolatory set Cmi . Assume umi ∈ Cm is corresponding to um+1
ki∈ Ωm+1. Ruge and4
Stüben proposed the corresponding interpolation formula [16]:5
Imm+1um+1k nm+1
k=1 =
um+1ki
∀umi ∈ Cm∑
j:umj ∈Cmi wmiju
m+1kj
∀umi ∈ Fm (21)
where6
wmij = − 1
amii +∑
r:umr ∈Dm,wi
amir
amij +∑
r:umr ∈Dm,si
amiramrj
/ ∑l:uml ∈C
mi amil
(22)
The Galerkin type method in [16] is a simple approach to define the restriction7
operator Im+1m8
Im+1m = (Imm+1)T (23)
and9
Am+1h = Im+1
m Amh Imm+1,
~bm+1h = Im+1
m~bmh I
mm+1.
14
3.2 Solution phase of AMG1
In the solution phase, the smoothing operator needs to be chosen with proper parame-2
ters ν1 and ν2, which are the number of the pre-smoothing and post-smoothing steps.3
In the next section, we will investigate the influence of the type of the operator (Gauss-4
Seidel and incomplete LU) and these two parameters. Furthermore, we will consider5
V-cycle only with the maximum number of levels M in this article. Another critical6
component of AMG is the stopping tolerance, which may have significant effect on the7
accuracy. Our study in the next section shows that the tolerance needs to be small8
enough for the chosen mesh size. Once all the above components are specified, the9
recursively defined AMG algorithm (Algorithm 3) with V-cycle can be proposed in the10
usual framework as follows [16].11
12
Algorithm 3 The AMG algorithm of the elliptic interface problemInput: Model parameters and AMG parametersOutput: AMG approximation solution ~uh.Method:
1: Assemble the matrix from the AFE formulation: Ah2: Assemble the vector from the AFE formulation: ~bh3: relative residual= 1, ~uh = 04: while relative residual>tolerance do5: m = 1, A1
h = Ah, ~b1h =~bh, ~u
1h = ~uh
6: Call algorithm MG(Amh , ~umh ,~bmh ,Ω
m,ν1,ν2,m) as follows:7: Call Algorithm 2 with Ωm to obtain the Cm and Fm