Jupyter-based course material for a C++ framework

Initial problem

For over a decade, an annual summer school about the Dune framework for the numerical solution of PDEs has been organized at IWR. Typically, participants would work on their own laptops using a virtual machine. Especially in 2021's virtual edition this technical setup created quite some problems. Therefore, the SSC has explored a new way to deliver this content - based on Jupyter notebooks. Jupyter notebooks are a very popular tool in the scientific community - though people typically associate them with the Python programming language. There are however kernels for other languages, including C++.

What we did

  • Set up of a C++ kernel for Jupyter that automatically loads Dune's shared libraries (based on xeus-cling)
  • Abstraction of the necessary build system logic into a standalone project
  • Integration with Dune's Doxygen documentation to enable access to documentation using Jupyter's ? operator
  • Implemented rich display output in Jupyter for many Dune types (e.g. grids)
  • Packaged the kernel and notebooks into a Docker image ready to run in the cloud e.g. on https://mybinder.org/
  • Provided two sample notebooks to showcase the power of the approach.
  • Set up a JupyterHub instance on a local Kubernetes cluster to test the computational environment for future courses.

The entire project can be found on GitHub. Currently, a HiWi is working to port teaching material into notebook form.


You can try the result online on Binder or look at the repository - note that this is still work in progress though and that start up times on Binder can be quite long. With this project, we showcased an interesting new approach to teaching C++ frameworks that otherwise suffer from a steep learning curve.

The SSC has also gained experience with the Jupyter ecosystem (Custom kernels, extensions, renderers etc.) in the process that we will happily share with our customers.