The Finite Element Method, fem12
Information
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, NavierStokes
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.
Course goals
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 L2norm, 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
together

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 LaxMilgram theorem for a given variational
problem.
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.
Modules

(Software environment)

Science  differential equations

Function approximation using polynomials

Galerkin's method (finite element method)

Assembly of discrete systems

Error estimation

Adaptive mesh refinement
Undocumented base code for adaptivity
Starting mesh

Stability
Convectiondiffusion solver (without stabilization)
Mesh
Velocity field
Subdomain markers (for boundary conditions)

Existence and uniqueness of solutions
News (2012):
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.
Teachers
 Coordinator and lecturer:
Johan Jansson; email:
jjan@kth.se
 Assistant:
Doghonay Arjmand; email:
doghonay@kth.se
Office Hours
 Johan Jansson (1517): By appointment.
 Doghonay Arjmand: By appointment.
Registration
NB: Please activate yourself in the
RAPP system.
Examination
The examination consists of submissions of written reports and
software for the course modules and a written exam.
 (1) Written exam: Thursday October 18, 813 in M22. Typical examination questions.
Exam 20121114 solutions
Grading levels (out of 30):
Fx: 10
E: 13
D: 16
C: 19
B: 23
A: 26
 (2) Reports for modules 13 are due September 24, modules 45 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 (jjan@csc.kth.se) with the text "module 13" in the title (replace the numbers appropriately).
The modules should be carried out individually or in groups of two.
Software
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
Environment description and in the extra material below.
Literature
K. Eriksson, D. Estep, P. Hansbo, C. Johnson: Computational Differential Equations.
Studentlitteratur, ISBN ISBN 9144493118.
Extra material
FEniCS Book
FEniCS Quick reference
FEniCS tutorial (long)
Hints and solutions to some of the problems in the book.
Useful inequalities.
NavierStokes quick and easy (from "Applied
Mathematics: Body and Soul III")
Material from exercises:
Exercise notes from Oct 2: 1, 2
Schedule
NB! Johan Jansson will be away at a conference 914 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 1012 will be an exercise session in L1
Thursday 13 September 1315 will be an exercise session in L1
Wednesday 19 September 810 will be a lecture in M31
Wednesday 26 September 1012 will be a lecture in L22
Schedule at kth.se
Preliminary weekly plan
Week 1
 Lecture 1:

Course overview, differential equations, Poisson 1D, boundary conditions, weak formulation, polynomial approximation, Galerkin method, piecewise polynomials 1D
(CDE 14,6,8.1).
Lecture notes
Conference presentation with examples
 Lecture 2:

Poisson 2D, assembly algorithm, FEM mesh, piecewise polynomials 2D,
interpolation, L2 projection
(CDE 5.5,(7),13,14.114.2,14.4,15.1).
Lecture notes
Week 2
 Lecture 3:
 Boundary conditions, FEniCS
(CDE 8.1.5, 15.1,15.3,15,4, Robin boundary conditions in
1D and
2D).
Lecture notes
Expanded Poisson demo (Python)
Robin boundary conditions in 1D (Python)
Simple general matrix/vector assembly (miniFEniCS)
Assembles weak forms on the reference triangle below, compare against handcomputation of matrices.
Reference triangle mesh. Use like so:
mesh = Mesh("triangle.xml")
 Lecture 4:
 error estimation, adaptivity
Lecture notes
Week 3
 Lecture 5:
 error estimation 2D, mesh operations
(CDE 5,8.28.6,14.2,15.215.3).
Example code for help with modules.
Lecture notes
 Lecture 6:
 Initial value problem, heat equation, spacetime FEM, stability
(CDE 9.19.2,16,17).
Week 4
 Lecture 7:
 Convectiondiffusionreaction equation, stabilization, wave equation, adaptive algorithm implementation
(CDE 18,19).
Undocumented base code for adaptive implementation (see module Adaptive mesh refinement)
Lecture notes (combined for lecture 6
and 7, see also the Stability module)
Week 5
 Lecture 8:
 Uniqueness and existence for elliptic PDE, LaxMilgram
(CDE 21,12).
Lecture notes (see also the Existence
and uniqueness module)
Week 6
 Lecture 9:
 ALE, NavierStokes, overview/repetition.
Week 7
Work on modules.
Week 8
Exam.