Recent developments in DOLFINx allow for the block assembly of linear algebraic systems arising from discretisations of coupled partial differential equations. Each algebraic block represents a subproblem associated with a coupling of the unknown fields. Designing and implementing robust and scalable solution and preconditioning strategies for block-structured linear systems is an active area of research.
In this contribution we show how DOLFINx can now exploit one of the most significant features of PETSc; the dynamic composition of the hierarchical solver and preconditioner options at runtime, see Brown et al . The idea is inspired by the work of Kirby and Mitchell  that was originally implemented in the Firedrake Project.
One of the most significant benefits of the approach is the possibility to construct advanced preconditioners that require structure beyond a purely algebraic problem description, eg the pressure-convection-diffusion (PCD) approximation of the Schur complement for the Navier–Stokes equations, see Silvester et al .
We illustrate the capabilities of our implementation on examples ranging from incompressible flow of a viscous fluid, through temperature-driven convection, to flows described by rate-type viscoelastic fluid models.