Overview

This notebook should outline the structure and content of the block course. Material will be added and updated as we go along.

Organisational notes:

  • 9:00 -- 17:00: Lecture, discussion, exercises (mixed)
  • lunch break (flexible)

Exam:

  • Thursday, Sep. 28th + Friday, Sep. 29th
  • oral exam
  • based on the to-be-developed course material

Scope of the course

Numerical topic: Realisation of a Finite Element Method implementation

  • Extends Numerik II, prepares Numerics of Partial Differential Equations
  • Focus on methods / algorithms / implementation aspects
  • Addresses, uses concepts/methods from Numerik I and II:
    • polynomial interpolation
    • numerical integration
    • approximation of differential equations
    • solution of nonlinear problems
    • iterative and direct solution methods for linear problems

The course as a software project

  • Rough skeleton methodsnm of a finite element code is given; with gaps (NotImplementedError)
  • Several simplifications in the setting are chosen (scalar PDEs, 1D/2D)
  • Implementational tools: basic python, object orientation, a bit of numpy, but
    • efficiency, generality, extensibility, ... are not the focus
    • code skeleton is (intentionally) aimed at an educational viewpoint (i.e. loops are not necessarily "evil", ...)
  • Software development tools: git, gitlab, CI (unit tests)
    • software project should be cloned by every participant/group
    • allows to exchange updates/commits/merge requests

Course material: Further remarks

Note that the course material is not a "script" in the classical sense, but rather a collection of notes, examples, exercises, ... that are used during the course. It is not intended to be self-contained, but rather to be used as a reference for the course. Further, it is not complete at the beginning of the course, but will be extended during the course (based on progress and interests).

[Intro1] Introduction unit on the background of finite elements (1st day, 3 hours)

  • Introduction and plan for the course
  • Explanations on Finite elements, including a crash course
  • Most important: context, purpose and identifying of some building blocks for finite elements

We continue with this overview after this first introduction.

$\leadsto$ intro_fem.ipynb

[Intro2] Software project management and tools for the course (1st day, 3 hours)

  • Working with git
  • Continuous integration
  • jupyter, VSCode, ...
  • Explanations on the code skeleton
  • forking/cloning, ...

$\leadsto$ code.ipynb

Now, we start with the first units that involve your own contributions.

  • The next topics are more zoomed in into the several building blocks of the project.
  • We will not work through all of them strictly in order
  • We will jump back and forth (e.g. start to go through with 1D first and add 2D later for some topics)

[FE1] Polynomial basis functions on one finite element (1D, 2D) (remainder of 1st day + 2nd day, 10 hours)

  • Given a set of points, write function objects that compute the basis functions for the polynomial space of degree $k$.
  • Use the function objects to compute the basis functions on a set of points to visualize the basis functions.
  • Start in 1D, then extend to 2D.

$\leadsto$ fe.ipynb

[Tasks: FE1D-1 - FE1D-5, FE2D-1 - FE2D-3]

[Mesh] Mesh topology (3rd day, 0.5 hours)

  • Generate simple meshes (e.g. structured) in 1D / 2D / 3D
  • Data structure of the mesh should be unstructured
  • Keep track of elements and boundary elements
  • Allow iterators over elements and boundary elements

[GlobalFunc] Functions on the global domain (3rd day, 0.5 hours)

  • Extend basis function object to evaluate on mapped domains (given a transformation object)
    • Allow for function evaluations and derivative evaluations of finite elements (given a transformation object). The chain rule is to be applied.
    • Implement an FEFunction object that allows to be evaluated based on an FESpace and a coefficient vector.
  • Implement function handles for global functions
    • Allow to evaluate a function based on an integration point on a reference element and a transformation
  • Visualize global functions and FEFunctions
  • (optional) Interpolate a global given function into a finite element space

$\leadsto$ globalfcts.ipynb

[FESpace] Setup of a finite element space handler (3rd + 4th day, 10 hours)

  • Associated dofs (degrees of freedom) to mesh entities
  • Generate finite elements [FE] upon request for different mesh entities (boundary element, volume element)
  • Generate transformation objects from reference domain to physical domain

$\leadsto$ globalfcts_1d.ipynb

$\leadsto$ globalfcts_2d.ipynb

[Tasks: FES1D-1 - FES1D-4, FES2D-1 - FES2D-6]

[Int] Integration on simple reference domains (1D Line, 2D Triangles) (5th day, 5 hours)

-- skipped at first using NumPy/Scipy integration routines as fallback --

  • Implement simple fixed-order (1,2,3,4) quadrature rules for 1D line
  • Implement flexible order Gauss (Lobatto/Radau) quadrature rules for 1D Line
  • Implement simple fixed-order (1,2,5) Gauss quadrature rules for 2D triangle
  • Implement high order quadrature rules in 2D/3D on triangles and quadrilaterals (based on Duffy)

$\leadsto$ integration.ipynb

[Tasks: INT1D-1 - INT1D-3, INT2D-1 - INT2D-5]

[SetupLS] Setup/Assembly of linear systems (4th + 5th day, 8 hours)

  • Setup of element matrices/vectors for a number of bilinear form or linear form integrals
    • Write integrals that are flexible in the finite elements and quadrature rules (optional: automatically chosen) and the element transformation. These compute local element matrices/vectors. For:
      • $\int_{T} u \cdot v \, dx$
      • $\int_{T} \nabla u \cdot \nabla v \, dx$
  • Assemble the local element matrices/vectors into global matrices/vectors. The matrices should be sparse

$\leadsto$ assembly.ipynb

[Tasks: FormInt-1 - FormInt-3, Assembly-1]

[Solve] Solve PDE problem (6th + 7th day, 9 hours)

  • Setup and solve the linear system to a given PDE problem using numpy/scipy sparse solvers for different PDE problems
  • Deal with different boundary conditions
  • Carry out numerical experiments and convergence studies

$\leadsto$ solve.ipynb

[Tasks: Solve-1, Solve-2, Solve-3]

[Specialization] mini-projects (7th -- 9th day, 20 hours)

In smaller mini-projects further extensions shall be implemented.

$\leadsto$ specializations.ipynb