0% found this document useful (0 votes)
55 views37 pages

A Finite Element Method Tutorial

FEA

Uploaded by

Kang Qin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views37 pages

A Finite Element Method Tutorial

FEA

Uploaded by

Kang Qin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

A Finite Element Method Tutorial

Kathryn Gillow
Computational Biology Group
11th January 2005

A Finite Element Method Tutorial p. 1/37

Overview
Finite element methods the basics
Adaptive finite element methods
Applications
Conclusions

A Finite Element Method Tutorial p. 2/37

Finite element methods the basics



 




 


 



Exact solution







 

 







Model problem:




















into subintervals
FEM idea: split the interval
(elements) and approximate the solution by a polynomial on
each subinterval.

A Finite Element Method Tutorial p. 3/37

Solutions
Continuous FEM solution

Discontinuous FEM solution

0.9

0.9

0.8

0.8

0.7

0.7

0.6

0.6

0.5

0.5

0.4

0.4

0.3

0.3

0.2

0.2

0.1

0.1

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9









 







 






where





 









 









A Finite Element Method Tutorial p. 4/37

How can we improve?


Reduce the mesh size
Discontinuous FEM solution
1

0.9

0.9

0.8

0.8

0.7

0.7

0.6

0.6

0.5

0.5

0.4

0.4

0.3

0.3

0.2

0.2

0.1

0.1

0.3

0.4

0.5

0.6

0.7

0.8

0.9

0.1

0.2

0.3

0.4

0.5

0.7

0.8

0.9

 










 






0.6

0.2

0.1







Continuous FEM solution

10

10

|| uuh ||H1

10

|| uuh ||H1

10

10

10

10

10

10

number of mesh points

10

10

10

number of mesh points

A Finite Element Method Tutorial p. 5/37

How else can we improve?


Increase the polynomial degree
Continuous FEM solution
1

10

0.9

0.9

0.8

0.8

0.7

0.7

0.6

0.6

0.5

0.5

0.4

0.4

0.3

0.3

0.2

0.2

0.1

0.1

|| uuDG ||H1

10

10

10

10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1.2

1.4

1.6

1.8

2.2

2.4

2.6

2.8

polynomial degree

Discontinuous FEM solution


1

0.9

0.9

0.8

0.8

0.7

0.7

0.6

0.6

10

10

0.5

0.4

0.4

0.3

0.3

0.2

0.2

0.1

0.1

|| uuh ||H1

0.5

10

10

10

10

10

10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1.5

2.5

3.5

4.5

polynomial degree

A Finite Element Method Tutorial p. 6/37

Convergence




 





For this problem we have




where



 



 






In general it can be shown that, for

A Finite Element Method Tutorial p. 7/37

Finite element methods the details






in
on
on

(Fairly) general reactionconvectiondiffusion equation:





Then




so by Greens theorem

A Finite Element Method Tutorial p. 8/37

Continuous Galerkin FEM




such











Continuous finite element formulation: find


that









, then

Choose

A Finite Element Method Tutorial p. 9/37

Discontinuous Galerkin FEM


Apply Dirichlet boundary conditions and inter-element
continuity in a weak sense.













for all

Discontinuous finite element formulation: find


such that

A Finite Element Method Tutorial p. 10/37

 





 







 















 






 







 
















Discontinuous Galerkin FEM

A Finite Element Method Tutorial p. 11/37

Key idea

for a linear PDE.


(Nonlinear PDE

Expand
as a linear combination of the finite element
basis functions leads to a (sparse) linear system to solve
for the coefficients:

nonlinear algebraic system.)

A Finite Element Method Tutorial p. 12/37

Continuous or discontinuous?
Continuous is simpler.
For a given mesh a continuous method is cheaper.
0.4

0.4

0.35

0.35

0.3

0.3

0.25

0.25

0.2

0.2

0.15

0.15

0.1

0.1

0.05

0.05

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

A discontinuous method allows hanging nodes and the


implementation of a adaptive strategy is easy.
1

0.9

1
0.8

0.8
0.7

0.6
0.6

0.4

0.5

0.4

0.2

0.3

0
1

0.2

0.8

1
0.6

0.1

0.8
0.6

0.4
0.4

0.2
0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

0.2
0

A Finite Element Method Tutorial p. 13/37

Continuous or discontinuous?
For convectiondominated diffusion problems
numerical stabilisation is needed with the continuous
method but not with the discontinuous method.
1.6
1
1.4

1.2

0.8

1
0.6
0.8

0.6

0.4

0.4
0.2
0.2

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

0.8

0.6

0.4

0.2

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

A Finite Element Method Tutorial p. 14/37

Adaptive finite element methods




Consider an elliptic PDE of the form

to

given by



and an approximation




We may wish to approximate a linear functional of the


solution
by
.

Aim: Design & implementation of a reliable and efficient


adaptive algorithm to deliver quantitative error control:
TOL or
TOL.

A Finite Element Method Tutorial p. 15/37

Ingredients of an adaptive algorithm





1. An a posteriori error bound a computable upper


depending on , , and
bound on
the input data but not on .
TOL we automatically have
Then if
TOL (provides a stopping criterion for
adaptive algorithm).
2. Mesh refinement strategy uniform mesh refinement
is inefficient.

A Finite Element Method Tutorial p. 16/37

0.06

0.06

0.05


 

0.07

mesh


 

0.8

mesh

Solution

Example

0.7

0.05

0.04

0.6

0.04

0.5

0.03

0.4

0.03

0.3

0.02

0.02

0.2

0.01

0.01

0.1

0
2

0
2
1.5

0
2
1.5

1.5

0.5

0.5

1
0.5

0.5
0

0.5
0


 

Refined mesh


2
1.5

1
0.5

1.5

1.5

1.8

0.06
1.6

0.05
1.4

0.04
1.2

0.03
1

0.02
0.8

0.01
0.6

0
2
0.4

1.5

2
1.5

1
1
0.5

0.5
0

0.2

0.2

0.4

0.6

0.8

1.2

1.4

1.6

1.8

A Finite Element Method Tutorial p. 17/37

TOL nele
TOL nele , for


Equidistribution of error:
Refine elements for which
Derefine elements for which
.
some

Write in the form

Automatic mesh refinement

Fixed fraction method: arrange elements into a list in


decreasing order of error then
Refine elements in top
of list;
Derefine elements in bottom
of list.

A Finite Element Method Tutorial p. 18/37

Given TOL
, an initial mesh
of polynomial degrees , set

  

An adaptive algorithm
and an initial distribution
and
.

1. Calculate the finite element solution

and

2. Calculate the contributions to the error bound,


.
the total error bound


3. If

TOL then STOP.

4. Otherwise mark elements for refinement and


derefinement.




5. Decide whether marked elements should be - or


-refined or derefined.


and

6. Construct the new -mesh consisting of


, set
and go to 1.

A Finite Element Method Tutorial p. 19/37

 

The a posteriori error bound




such that








Finite element formulation: find

such that




Weak formulation: find










In particular









and so we have Galerkin orthogonality

A Finite Element Method Tutorial p. 20/37


























for all suitable .

Let satisfy
Then



The a posteriori error bound

which is independent of the exact solution .

A Finite Element Method Tutorial p. 21/37























Bound for continuous FEM

A Finite Element Method Tutorial p. 22/37

Bound for discontinuous FEM

 

on

 

 

in element

Define

 




on




Then

A Finite Element Method Tutorial p. 23/37

 





 



 

 


 




 





















 


   

 



 



Bound for discontinuous FEM contd

where

A Finite Element Method Tutorial p. 24/37

Example 1



known











known

A Finite Element Method Tutorial p. 25/37

DGFEM)

Final adaptive mesh (




 




Choose
. Final mesh has 287 degrees of
=
.
freedom. Error in
Final mesh with -refinement has 1396 degrees of freedom.
Final mesh using continuous FEM has 11728 degrees of
freedom.
Polynomial degree

Primal Mesh Number 6


2

1.8
1.6

4
1.4
1.2

1
2

0.8
0.6

1
0.4
0.2
0
0

0
0.5

1.5

A Finite Element Method Tutorial p. 26/37

Comparison with -refinement


3

10

sqrt(degrees of freedom)

hpDGFEM
hDGFEM
hCGFEM

10

10

10

0.01

0.02

0.03
TOL

0.04

0.05

0.06

A Finite Element Method Tutorial p. 27/37

Comparison with -refinement


4

10

hpDGFEM
hDGFEM
hCGFEM
3

10

CPU time

10

10

10

10

0.01

0.02

0.03
TOL

0.04

0.05

0.06

A Finite Element Method Tutorial p. 28/37













Example 2

A Finite Element Method Tutorial p. 29/37

Final adaptive mesh


. Final mesh has 617 degrees
.






 

Choose
and
of freedom. Error in

Primal Solution on Mesh Number 2


Polynomial degree

Primal Mesh Number 2


4

5
3.5

1
4

0.8
0.6

2.5
3

0.4

2
2

0.2

0
4

1.5

3
0.5

2
0

0
0

4
3

0.5

1.5

2.5

3.5

1
0

A Finite Element Method Tutorial p. 30/37

Final adaptive mesh


. Final mesh has 1001
=
.









Choose
and
degrees of freedom. Error in

Primal Solution on Mesh Number 5


Polynomial degree

Primal Mesh Number 5


4

5
3.5

1
4

0.8
0.6

2.5
3

0.4

2
2

0.2

0
4

1.5

3
0.5
0
0
0

4
3

0.5

1.5

2.5

3.5

1
0

A Finite Element Method Tutorial p. 31/37













electrolyte:



membrane:





sample:

 




Example 3

A Finite Element Method Tutorial p. 32/37

Solutions:
1

0.8

0.6

0.4

0.2

0
10
8

10
6

8
6

4
4

2
0

polynomial degree
Primal Mesh Number 3 with 7253 degrees of freedom

5
4.5

3.5
3

2.5

2.5

2
2

1.5

1.5

0.5

0.5
0

A Finite Element Method Tutorial p. 33/37

Solutions:
1

0.8

0.6

0.4

0.2

0
10
8

10
6

8
6

4
4

2
0

polynomial degree
Primal Mesh Number 6 with 8836 degrees of freedom

5
4.5

3.5
3

2.5

2.5

2
2

1.5

1.5

0.5

0.5
0

A Finite Element Method Tutorial p. 34/37

CGFEM



Approx

DGFEM

0.5

1.0

24.45

0.5141

0.5301

34811

0.5216

6996

0.5

1.0

1.22

0.9665

1.0157

14668

0.9935

7253

2.0

4.0

84.11

0.6672

0.6833

41914

0.6788

7030

2.0

4.0

24.45

0.7530

0.7758

16007

0.7611

7054

2.0

4.0

1.53

0.9683

1.0113

13291

0.9805

7166

2.0

2.5

19.00

0.8667

0.8847

24132

0.8776

26226

2.0

2.5

1.22

0.9942

1.0185

21644

1.0070

26282

Current

Comparison of results
Current

DOF

Current

DOF

A Finite Element Method Tutorial p. 35/37

Summary
Described an adaptive finite element algorithm for
computing solutions of PDEs (or linear functionals of
these solutions) to within a specified tolerance.
-refinement

Seen that for most examples


outperforms -refinement.

Seen that for particular examples the discontinuous


method outperforms the continuous method.

A Finite Element Method Tutorial p. 36/37

References
K ENNETH E RIKSSON , D ON E STEP, P ETER H ANSBO &
C LAES J OHNSON .
Introduction to Adaptive Methods for Differential Equations.
Acta Numerica (1995) 105158.
C LAES J OHNSON .
A New Paradigm for Adaptive Finite Element Methods.
The Mathematics of Finite Elements and Applications
(1994) Chapter 6.

A Finite Element Method Tutorial p. 37/37

You might also like