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#

Problems on manifolds#

  • Mixed Poisson equation on the sphere – solve the Poisson equation in mixed form on the sphere, with Raviart-Thomas elements on a surface taken from a Gmsh volume mesh, widening the ghost layer with a custom partitioner so that the facets can be signed in parallel.

  • Mixed Poisson on a Möbius strip – solve the same equation on a Möbius strip, where no consistent orientation of the cells exists, on a higher-order mesh built by hand, with a cylinder as a control.

  • The eikonal equation on a Möbius strip – compute the distance to the boundary of a Möbius strip, solving the eikonal equation with the latent variable proximal point algorithm in mixed form.

  • Mixed Poisson on a branching surface – solve the Poisson equation in mixed form on three sheets meeting along a line, with a Raviart-Thomas space on each sheet, coupled by a Lagrange multiplier on the joint, transferring mesh tags to the submeshes of the sheets.

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.