The Finite Element Method, fem12
Basic laws of nature are typically expressed in the form of partial
differential equations (PDE), such as Navier's equations of
elasticity, Maxwell's equations of electromagnetics, Navier-Stokes
equations of fluid flow, and Schrödinger's equations of quantum
mechanics. The Finite element method (FEM) has emerged as a universal
tool for the computational solution of PDEs with a multitude of
applications in engineering and science. Adaptivity is an important
computational technology where the FEM algorithm is automatically
tailored to compute a user specified output of interest to a chosen
accuracy, to a minimal computational cost. This FEM course aims to
provide the student both with abstract skills (for example proving
properties of methods) and concrete skills (for example constructing
methods and formulating them in computer language), including the
ability to construct adaptive FEM algorithms for an important family
of PDEs and analyzing their properties.
In the course the student should be able to:
construct a finite element method by deriving the weak formulation,
formulating the corresponding finite element approximation, and
formulating the approximation in computer language, or modifying an
existing general computer program for scalar linear PDE.
derive a priori and a posteriori error estimates in the energy norm,
the L2-norm, and linear functionals of the solution.
construct an adaptive finite element method based on an a posteriori
error estimate, implement an adaptive mesh refinement algorithm, and
analyze the performance of the adaptive method.
describe standard components in general FEM algorithms and how they fit
estimate the stability of a given linear PDE and its FEM approximation
and be able to reflect on the concept of stability
state and apply the Lax-Milgram theorem for a given variational
Advanced course continuation
A natural continuation of the finite element course is the Advanced
Computation in Fluid Mechanics
course (DN2275), starting in
january 2013 given by Johan Hoffman.
Science - differential equations
Function approximation using polynomials
Galerkin's method (finite element method)
Assembly of discrete systems
Adaptive mesh refinement
Undocumented base code for adaptivity
Convection-diffusion solver (without stabilization)
Subdomain markers (for boundary conditions)
Existence and uniqueness of solutions
Nov 14: Grades for written exam sent out, put up exam and solutions on home page.
Oct 17: Note that the written exam will take place in M22.
Oct 12: Put up updated source code and data/mesh files for
module 6 and 7 (see above).
Oct 5: Please register yourself in the RAPP system. Put up notes from exercise.
Sep 25: Put up lecture notes up to and including lecture 8.
Sep 18: Moved first module deadline to September 24.
Sep 17: Updated modules.
Sep 7: Schedule updates.
- Coordinator and lecturer:
Johan Jansson; email:
Doghonay Arjmand; email:
- Johan Jansson (1517): By appointment.
- Doghonay Arjmand: By appointment.
NB: Please activate yourself in the RAPP
The examination consists of submissions of written reports and
software for the course modules and a written exam.
- (1) Written exam: Thursday October 18, 8-13 in M22. Typical examination questions.
Exam 2012-11-14 solutions
Grading levels (out of 30):
- (2) Reports for modules 1-3 are due September 24, modules 4-5 October 8, the rest of the modules October 22. Give your answers with source code and possible figures in a PDF. Mail the PDF to me (firstname.lastname@example.org) with the text "module 1-3" in the title (replace the numbers appropriately).
The modules should be carried out individually or in groups of two.
In this course we will study the open source FEniCS
automated finite element framwork for solving partial differential
equations. More information is in the Software
description and in the extra material below.
K. Eriksson, D. Estep, P. Hansbo, C. Johnson: Computational Differential Equations.
Studentlitteratur, ISBN ISBN 91-44-49311-8.
FEniCS Quick reference
FEniCS tutorial (long)
Hints and solutions to some of the problems in the book.
Navier-Stokes quick and easy (from "Applied
Mathematics: Body and Soul III")
Material from exercises:
Exercise notes from Oct 2: 1, 2
NB! Johan Jansson will be away at a conference 9-14 September and
unable to give lectures. Therefore the schedule will be modified as
follows (just a switch between exercise sessions and lecures):
Monday 10 September 10-12 will be an exercise session in L1
Thursday 13 September 13-15 will be an exercise session in L1
Wednesday 19 September 8-10 will be a lecture in M31
Wednesday 26 September 10-12 will be a lecture in L22
Schedule at kth.se
Preliminary weekly plan
- Lecture 1:
Course overview, differential equations, Poisson 1D, boundary conditions, weak formulation, polynomial approximation, Galerkin method, piecewise polynomials 1D
Conference presentation with examples
- Lecture 2:
Poisson 2D, assembly algorithm, FEM mesh, piecewise polynomials 2D,
interpolation, L2 projection
- Lecture 3:
- Boundary conditions, FEniCS
(CDE 8.1.5, 15.1,15.3,15,4, Robin boundary conditions in
Expanded Poisson demo (Python)
Robin boundary conditions in 1D (Python)
Simple general matrix/vector assembly (mini-FEniCS)
Assembles weak forms on the reference triangle below, compare against hand-computation of matrices.
Reference triangle mesh. Use like so:
mesh = Mesh("triangle.xml")
- Lecture 4:
- error estimation, adaptivity
- Lecture 5:
- error estimation 2D, mesh operations
Example code for help with modules.
- Lecture 6:
- Initial value problem, heat equation, space-time FEM, stability
- Lecture 7:
- Convection-diffusion-reaction equation, stabilization, wave equation, adaptive algorithm implementation
Undocumented base code for adaptive implementation (see module Adaptive mesh refinement)
Lecture notes (combined for lecture 6
and 7, see also the Stability module)
- Lecture 8:
- Uniqueness and existence for elliptic PDE, Lax-Milgram
Lecture notes (see also the Existence
and uniqueness module)
- Lecture 9:
- ALE, Navier-Stokes, overview/repetition.
Work on modules.