Demos#

These demos illustrate the use of DOLFINx. Each is available as a Python script and as a Jupyter notebook (see the “Download sources” box at the top of each demo page). If you are new to DOLFINx, start with Poisson equation and then work through Getting started.

The remaining sections are organised by topic rather than by difficulty, and a demo that illustrates more than one topic is listed in more than one section. Some demos have additional requirements, noted below: the electromagnetics demos require DOLFINx to be built with complex PETSc scalars, and a few demos only run in serial.

Getting started#

  • Poisson equation – the recommended starting point: solve the Poisson equation with mixed Dirichlet/Neumann boundary conditions.

  • Helmholtz equation – solve the Helmholtz equation with both real-valued and complex-valued formulations.

  • Biharmonic equation – solve the biharmonic equation using an interior penalty discontinuous Galerkin method.

Interpolation, IO and visualisation#

  • Visualisation with PyVista – visualise finite element functions with PyVista, including warp-by-scalar and warp-by-vector plots.

  • Interpolation and IO – interpolate into an \(H(\mathrm{curl})\) Nédélec space and visualise it via a discontinuous Lagrange space.

Mixed and hybridised formulations#

Time-dependent and nonlinear problems#

Linear solvers, preconditioners and matrix-free methods#

Custom and advanced finite elements#

Mesh generation, partitioning and parallel data#

Electromagnetics#

All demos in this section require DOLFINx to be built with complex PETSc scalars.