The Adaptive Finite Element Method for Poisson Equation...

19
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

Transcript of The Adaptive Finite Element Method for Poisson Equation...

Page 1: 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

The Adaptive Finite Element Method for PoissonEquation with Algebraic Multigrid Solver

Wenqiang [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 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

1.2 The Galerkin approximation formula . . . . . . . . . . . . . . . . . . . . 56

2 AFEM implementation 57

2.1 Poisson Solver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

2.1.1 Data structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

1

Page 2: 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

2.1.2 Poisson solver Process . . . . . . . . . . . . . . . . . . . . . . . . . 71

2.2 Posterior Error Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

2.3 Marking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123

2.4 Refinement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124

3 Algebraic Multigrid Method 135

3.1 Setup phase of AMG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136

3.2 Solution phase of AMG . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

4 Numerical Experiments 168

References 169

List of Figures10

1 The rectangular partition and triangulation . . . . . . . . . . . . . . . . . 411

2 The interior edge and normal vectors for rectangular partition and tri-12

angulation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513

3 The boundary edge and normal vectors for rectangular partition and14

triangulation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515

4 The initial mesh partition . . . . . . . . . . . . . . . . . . . . . . . . . . . 616

5 The local indices of vetrices and edges . . . . . . . . . . . . . . . . . . . . 717

6 The domains of inter point wp, interior edge we and element wk[19]. . . . 1018

7 The newest vertex bisection for interior edge and boundary edge. . . . . 1219

8 The rate of convergence for H1 and L2 . . . . . . . . . . . . . . . . . . . . 1720

9 The mesh partition and numerical solution at 5th refinement . . . . . . . 1721

10 The mesh partition and numerical solution at 10th refinement . . . . . . 1722

11 The mesh partition and numerical solution at 15th refinement . . . . . . 1823

12 The mesh partition and numerical solution at 20th refinement . . . . . . 1824

List of Tables25

1 MESH Data structure in two dimension . . . . . . . . . . . . . . . . . . . 826

2 Indices data structure in two dimension . . . . . . . . . . . . . . . . . . . 927

3 Errors of the AFEM solution for poisson with CG smoother. . . . . . . . 1628

2

Page 3: 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

List of Notations1

EBh Boundary edges2

EDh Dirichlet edges3

EIh Interior edges4

ENh Neumann edges5

ΓD The Dirichlet boundary6

ΓN The Dirichlet boundary7

P(K) Finite dimension smooth function (typically polynomial) on the region K8

Vh The finite dimension space is used to approximate the variable u9

Th The partition (triangulation or rectangular partition) of Ω10

he The diameter of the edge11

1 The Model Problem12

For simplicity, I consider the following pure dirichlet boundary condition poisson equa-13

tion:14

−∆u = f in Ω, u = g on ∂Ω, (1)

where Ω is assumed to be a polygonal domain, f a given function in L2(Ω) and g a15

given function in H12 (Ω).16

Before I give the details, I would like to introduce some useful notations in this17

report. Let Th to be the partition (Figure.1)(typically triangulation or rectangular par-18

tition) of Ω, with piecewise constant mesh size h, i.e., hK = diam(K) , similarly, to be19

he = diam(e), ΓD to be the Dirichlet boundary, ΓN to be the Neumann boundary , and20

P(K) to be a finite dimension smooth function (typically polynomial) on the region K .21

This space Vh (⊂H10 (Ω)) will be used to approximate the variable u.22

Vh := v ∈ L2(Ω) | v |K∈ P(K) ∀K ∈ Th, v = 0 on ΓD. (2)

After we have the above notations, we can define the Jump and Average as following:23

1. If e ∈ E (See Figure.2)24

~v = v+n+ + v−n−;

∇v =12

(∇v+ +∇v−).

where v+ = v− = v|K .25

3

Page 4: 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

2. If e ∈ E (See Figure.3)1

~v = v+nτ ;

∇v = ∇vτ .

Given the discontinuous nature of the piecewise polynomial functions, we define inte-2

rior edges EIh , boundary edges EBh , Dirichlet boundary EDh and Neumann boundary ENh3

for Th (Similarly, we can give the definitions for TH ) as following4

EIh =e = ∂Kj ∩∂Kl , µ(Kj ∩Kl) > 0

EBh =

e = ∂K ∩Ω, µ(K ∩Ω) > 0

EDh =

e = ∂K ∩ ΓD , µ(K ∩ ΓD ) > 0

ENh =

e = ∂K ∩ ΓN , µ(K ∩ ΓN ) > 0

We also set Eh = EIh∪E

Bh and EBh = EDh ∪E

Nh . If e ∈ EIh, then e = ∂K−∩∂K+ for ∂K−, ∂K+ ∈ Th.5

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

Figure 1: The rectangular partition and triangulation

1.1 The weak formulation for the model problem6

For the standard FEM, the weak formulations can be written as as follows:7

find u ∈H1(Ω) with u|∂Ω = g and (3)

a(u,φ) :=∫Ω

∇u∇φ =∫Ω

f φ for ∀φ ∈H10 , (4)

4

Page 5: 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

en−n+

Ω

K− K+

∂Ω

e

n−

n+

Ω

K−

K+

∂Ω

Figure 2: The interior edge and normal vectors for rectangular partition and triangulation.

Ω

K

K+

∂Ω

Ω

K

∂Ω

Figure 3: The boundary edge and normal vectors for rectangular partition and triangula-tion.

1.2 The Galerkin approximation formula1

find uh ∈ Vh with uh|∂Ω = g and (5)

a(uh,φh) :=∫Ω

∇uh∇φ =∫Ω

fhφh for ∀φh ∈ Vh, (6)

2 AFEM implementation2

In this section, I will give the implement details for AFEM via Matlab. I will follow the3

general form in [6][7][12][13][19][20][21]. I will also follow the standard local mesh4

refinement loops of AFEM:5

SOLVE→ ESTIMATE→MARK→ REFINE.

5

Page 6: 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

2.1 Poisson Solver1

2.1.1 Data structure2

Before I give the Poisson solver, I would like to introduce the data structure in Mat-3

lab. I will use the initial mesh (Figure.4) as an example to illustrate the concept of the4

components.

1

2

3

4

5

6

7

8

1

2

3

4

5

6

7

8

9

Figure 4: The initial mesh partition5

1. The basic data structure ( See Table (1)) is mesh which contains6

mesh.node: The node vector is just the xy-value of node.7

mseh.elem: In the elem matrix, the first and the second column represent the8

start nodal indices vector and the end nodal indices vector, respectively.9

mesh.Dirichlet: The Dirichlet is the Dirichlet boundary condition edges.10

mesh.Neumann: The boundary is the Neumann boundary condition edges.11

2. Another main data structure is indices (See Table (2))which will provide useful12

indices.13

indices.neighbor: indices.neighbor(1:NT,1:3): the indices map of neighbor infor-14

mation of elements, where neighbor(t, i) is the global index of the element oppo-15

site to the i-th vertex of the t-th element.16

indices.elem2edge: indices.elem2edge(1:NT,1:3): the indices map from elements17

to edges, elem2edge(t,i) is the edge opposite to the i-th vertex of the t-th element.18

indices.edge: indices.edge(1:NE,1:2): all edges, where edge(e,i) is the global in-19

dex of the i-th vertex of the e-th edge, and edge(e,1) < edge(e,2).20

indices.bdEdge: indices.bdEdge(1:Nbd,1:2): boundary edges with positive oriten-21

tation, where bdEdge(e,i) is the global index of the i-th vertex of the e-th edge for22

i=1,2. The positive oritentation means that the interior of the domain is on the23

6

Page 7: 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

left moving from bdEdge(e,1) to bdEdge(e,2). Note that this requires elem is pos-1

itive ordered, i.e., the signed area of each triangle is positive. If not, use elem =2

fixorder(node,elem) to fix the order.3

indices.edge2elem: indices.edge2elem(1:NE,1:4): the indices map from edge to4

element, where edge2elem(e,1:2) are the global indices of two elements sharing5

the e-th edge, and edge2elem(e,3:4) are the local indices of e (See Figure. 5 and6

Table. 2).7

8

A1

e3A2

e1

A3

e2

Figure 5: The local indices of vetrices and edges .

2.1.2 Poisson solver Process9

The Poisson solver contains three main steps:10

Step 1 Pre-process step: In this phase, we should get the information of the nodal,11

element and indices. In this project, I use my own function InitialMesh to generate for12

the square domain. For the complex domain, you can use Matlab’s PDE tool or the13

package in [14] to generate the mesh.14

Step 2 Process step: This phase contains four sub-steps as follow:15

step 2.1 Compute the stiffness matrix and load vector of the elements16

step 2.2 Assemble the global stiffness matrix and global load vector17

step 2.3 Deal with the boundary condition18

step 2.4 Solve the linear system AU = F19

Step 3 post-process step: this phase is just to output the solution and give it visual20

form.21

22

2.2 Posterior Error Estimation23

The posteriori error estimators and indicator are essential components for the Estima-24

tion part. In this project, I will use the residual-type error estimator [1][7][12][13][20][21].25

7

Page 8: 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

Table 1: MESH Data structure in two dimension

Nodal NO. node(:,1) node(:,2)

1 -1 -12 -1 03 -1 14 0 -15 0 06 0 17 1 -18 1 09 1 1

i Dirichlet(:,1) Dirichlet(:,2)

1 21 42 33 64 76 97 88 9

Element neighbor elem2edgeNO. 1 2 3 1 2 3 1 2 3

1 1 4 2 2 1 1 4 1 22 5 2 4 1 5 3 4 8 53 2 5 3 4 3 2 6 3 54 6 3 5 3 7 4 6 10 75 4 7 5 6 2 5 11 8 96 8 5 7 5 6 7 11 15 127 5 8 6 8 4 6 13 10 128 9 6 8 7 8 8 13 16 14

8

Page 9: 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

Table 2: Indices data structure in two dimension

edgeEdge NO. edge(:,1) edge(:,2)

1 1 22 1 43 2 34 2 45 2 56 3 57 3 68 4 59 4 7

10 5 611 5 712 5 813 6 814 6 915 7 816 8 9

edge2elemEdgeNO. elem 1 elem 2 local local

1 1 1 2 22 1 1 3 33 3 3 2 24 1 2 1 15 2 3 3 36 3 4 2 27 4 4 3 38 2 5 2 29 5 5 3 3

10 4 7 2 211 5 6 1 112 6 7 3 313 7 8 1 114 8 8 3 315 6 6 2 216 8 8 2 2

Boundary Element

11345868

BdEdge NO. bdedge(:,1) bdedge(:,2)

1 2 12 3 23 7 84 8 95 1 46 6 37 4 78 9 6

9

Page 10: 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

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

Page 11: 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

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

Page 12: 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

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

Page 13: 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

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

Page 14: 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

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

Page 15: 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

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

8: Set Ωm+1 = Cm

9: Define Imm+1, Im+1m = (Imm+1)T

10: Pre-smooth: ~umh :=smooth(Amh , ~umh ,~bmh ,ν1)

11: Residual: ~rmh =~bmh −Amh ~u

mh

12: Coarsening: ~rm+1h = Im+1

m ~rmImm+1, Am+1h = Im+1

m Amh Imm+1, ~bm+1

h = Im+1m

~bmh Imm+1

13: If m ≡M14: Solve: Am+1

h δm+1 = ~rm+1h

15: Else16: Recursion: δm+1 =MG(Am+1

h ,0,~rm+1h ,Ωm+1,ν1,ν2,m+ 1)

17: EndIf18: Correction: ~umh = ~umh + Imm+1δ

m+1Im+1m

19: Post-smooth: ~umh :=smooth(Amh , ~umh ,~bmh ,ν2)

20: END of MG21: ~uh = ~u1

h

22: relative residual =∥∥∥∥~bh −Ah~uh∥∥∥∥ / ∥∥∥∥~bh∥∥∥∥

23: end while

15

Page 16: 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

4 Numerical Experiments1

For the first experiment, I consider the following poisson problem with pure Dirichlet2

boundary in [−1,−1]× [1,1]:3

−∆u = −π3sin(πx)(−y + cos(π(1− y)))− (2−πsin(πx))(−π2cos(π(1− y))) in Ω,

u = exactsolution on ∂Ω, .

For the residual-type error estimator, I set θ = 0.25, the maximum refinement to be 20 .4

And for the AMG, I set the initial vector u0 to be 0 and he strong connection threshold5

η = 0.25. We denote number of W-cycles by W’s, the size of the coarsest mesh by Nc,6

and the stopping tolerance on residual by tol. The Conjugate Gradient Method (CG)7

preconditioner will be used as pre-smoothing and post-smoothing operations.

Table 3: Errors of the AFEM solution for poisson with CG smoother.

iter #dof Nc ‖u −uh‖L2 ‖u −uh‖H1 w’s5 57 21 2.72× 10−1 4.16 6

10 184 61 1.24× 10−1 2.84 715 454 148 5.09× 10−2 1.88 820 1173 408 2.34× 10−2 1.21 10

8

Figure (9)-(12) show the changes of the mesh partition and the numerical solution.9

From Table (3) and Figure (8), I get the quasi-optimal convergence rates for the Adap-10

tive Finite Element which verify the results in [3].11

References12

[1] I. Babuska andW. C. Rheinboldt, Error estimates for adaptive finite element compu-13

tations, SIAM Journal on Numerical Analysis, 15 (1978), pp. pp. 736–754. 714

[2] S. C. Brenner and L. R. Scott, The mathematical theory of finite element methods,15

vol. 15, Springer, 2008. 1016

[3] J. M. Cascon, C. Kreuzer, R. H. Nochetto, and K. G. Siebert, Quasi-optimal17

convergence rate for an adaptive finite element method, SIAM Journal on Numeri-18

cal Analysis, 46 (2008), pp. 2524–2550. 1619

[4] L. Chen, AFEM@MATLAB: a matlab package of adaptive finite element methods,20

Technique Report, (2006). 121

[5] , iFEM: an innovative finite element methods package in MATLAB, Technique22

Report, (2009). 123

[6] W. Dörfler, A robust adaptive strategy for the nonlinear poisson equation, Comput-24

ing, 55 (1995), pp. 289–304. 525

16

Page 17: 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

102

103

10−1

100

Number of unknowns

Err

or

Rate of convergence is CN−1.0298

||Du−Duh||

C1N

−0.54255

||u−uh||

C2N

−1.0298

Figure 8: The rate of convergence for H1 and L2

−1 0 1−1

−0.5

0

0.5

1

−1

0

1−1 −0.5 0 0.5 1

−10

0

10

20

−5

0

5

10

Figure 9: The mesh partition and numerical solution at 5th refinement

−1 0 1−1

−0.5

0

0.5

1

−1

0

1−1 −0.5 0 0.5 1

−10

0

10

20

−5

0

5

10

Figure 10: The mesh partition and numerical solution at 10th refinement

17

Page 18: 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

−1 0 1−1

−0.5

0

0.5

1

−1

0

1−1 −0.5 0 0.5 1

−10

0

10

20

−5

0

5

10

Figure 11: The mesh partition and numerical solution at 15th refinement

−1 0 1−1

−0.5

0

0.5

1

−1

0

1−1 −0.5 0 0.5 1

−10

0

10

20

−5

0

5

10

Figure 12: The mesh partition and numerical solution at 20th refinement

[7] , A convergent adaptive algorithm for poisson’s equation, SIAM Journal on Nu-1

merical Analysis, 33 (1996), pp. pp. 1106–1124. 5, 7, 122

[8] W. Feng, Immersed finite element method for interface problems with algebraic multi-3

grid solver, 2013. 14

[9] W. Feng, X. He, Y. Lin, and X. Zhang, Immersed finite element method for inter-5

face problems with algebraic multigrid solver, Commun. Comput. Phys., 15 (2014),6

pp. 1045–1067. 17

[10] W. Feng, X. He, and Y. L. X. Zhang, Immersed finite element method for interface8

problems with algebraic multigrid solver, Commun.Comput.Phys., (To appear). 19

[11] W. F. Mitchell, A comparison of adaptive refinement techniques for elliptic problems,10

ACM Trans. Math. Softw., 15 (1989), pp. 326–347. 1211

[12] P. Morin, R. H. Nochetto, and K. G. Siebert, Convergence of adaptive finite element12

methods, SIAM Review, 44 (2002), pp. pp. 631–658. 5, 713

[13] R. Nochetto, K. Siebert, and A. Veeser, Theory of adaptive finite element methods:14

An introduction, Springer Berlin Heidelberg, 2009. 5, 715

[14] P. olof Persson and G. Strang, A simple mesh generator in matlab, SIAM Review,16

46 (2004), p. 2004. 717

[15] H. F. Q. Chang, Y. Wong, On the algebraic multigrid method, Journal of Computa-18

tional Physics, 125 (1996), pp. 279–292. 1319

[16] J. W. Ruge and K. Stüben, “Algebraic multigrid". In S. F. McCormick, editor, multi-20

grid methods, SIAM, Philadelphia, 4 (1987), pp. 73–130. 13, 14, 1521

18

Page 19: 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

[17] K. Stüben, Algebraic multigrid (AMG): experiences and comparisons, Applied Math-1

ematics and Computation, 13 (1983), pp. 419–451. 132

[18] C. O. U. Trottenberg and A.schuller, Multigrid, vol. 631, Academic Press, Lon-3

don, 2001. 134

[19] R. Verfürth, A posteriori error estimation and adaptive mesh-refinement techniques,5

Journal of Computational and Applied Mathematics, 50 (1994), pp. 67–83. 2, 5,6

107

[20] , A review of a posteriori error estimation and adaptive mesh-refinement tech-8

niques, Wiley-Teubner, 1996. 5, 79

[21] , Adaptive finite element methods. University Lecture, 2013-14. 5, 7, 1110

19