This document provides a complete list of the example codes that are distributed with the oomphlib
library. For each code we give a brief description of the problem solved and provide a link to the detailed documentation. The codes are listed in order of increasing complexity. The bulletpoint list in the right column lists the new oomphlib
features that are introduced in the example. You may either work through the examples onebyone, treating the example codes and their documentation as chapters in a selfstudy course, or use the list of topics in the right column as a quick reference to example codes that provide an introduction to a specific feature.
You may also wish to consult the following documents:
oomphlib
.oomphlib's
data structure.oomphlib's
fundamental objects: Problems
, Meshes
, and Elements
.oomphlib
's parallel processing capabilities.. We're still working on the detailed documentation for many of the demo problems listed below. The fullydocumented demo problems are accessible via the links. If you are particularly interested in a specific problem for which the detailed documentation is incomplete, let us know – we might be able to give it a slightly higher priority. We are happy to let you have driver codes before the documentation is complete. Such codes usually need a bit of tidying to make them acceptable for "general release", but they are fully functional. In fact, they are run on a regular basis as part of oomphlib's selftest routines (activated by typing make check in the toplevel directory). 
Problem solved by example code Short description of problem. 

Poisson problems  
We (re)solve the problem considered in the Quick Guide, this time using existing 

We solve a 2D Poisson problem with Dirichlet boundary conditions and compare the results against an exact solution. 

The 2D Poisson equation with flux boundary conditions (I) Another 2D Poisson problem – this time with Dirichlet and Neumann boundary conditions. 

The 2D Poisson equation with flux boundary conditions (II) An alternative solution for the previous problem, using multiple meshes. 

Poisson problems with adaptivity  
Adaptive solution of Poisson's equation in a fishshaped domain We solve a 2D Poisson equation in a nontrivial, fishshaped domain and demonstrate 

The 2D Poisson equation revisited – how to create a refineable mesh We revisit an earlier example and demonstrate how easy it is to "upgrade" an existing mesh to a mesh that can be used with 

We revisit an earlier example and demonstrate how to create refineable meshes for problems with curvilinear and/or moving domain boundaries. 

Adaptive solution of Poisson's equation with flux boundary conditions. We revisit an earlier example and demonstrate how to apply flux boundary conditions in problems with spatial adaptivity. 

Adaptive solution of a 3D Poisson equations in a spherical domain We demonstrate 

The advectiondiffusion equation  
The 2D advection diffusion equation with spatial adaptivity We solve a 2D advectiondiffusion equation and illustrate the characteristic features of solutions at large Peclet number. 

2D advection diffusion equation with Neumann (flux) boundary conditions. We solve a 2D advectiondiffusion equation with flux boundary conditions. 

The 2D advection diffusion equation revisited: PetrovGalerkin methods and SUPG stabilisation. We demonstrate how to implement a stabilised PetrovGalerkin discretisation of the advection diffusion equation. 

The unsteady heat equation and an introduction to timestepping  
We solve the 2D unsteady heat equation and demonstrate 

The 2D unsteady heat equation with restarts We demonstrate 

The 2D unsteady heat equation with adaptive timestepping We demonstrate 

We solve a 2D unsteady heat equation in a nontrivial domain with flux boundary conditions and compare the computed results against the exact solution. 

We demonstrate the spatially adaptive solution of a 2D unsteady heat equation in a nontrivial moving domain. 

We demonstrate the use of combined spatial and temporal adaptivity for the solution of a 2D unsteady heat equation in a nontrivial moving domain. 

The linear wave equation  
We solve a 2D wave equation and demonstrate 

The Helmholtz equation  
We solve a 2D Helmholtz problem, simulating scattering of a planar wave from a circular cylinder. 

Solving the Helmholtz equation on an unstructured mesh. We solve a 2D Helmholtz problem, simulating scattering of a planar wave from a circular cylinder – this time using an unstructured mesh. 

The azimuthally Fourierdecomposed 3D Helmholtz equation  
The azimuthally Fourierdecomposed 3D Helmholtz equation. We solve the 3D Helmholtz equation in cylindrical polar coordinates, using a Fourierdecomposition in the azimuthal direction. 

We revisit the 3D Helmholtz equation in cylindrical polar coordinates, using a Fourierdecomposition in the azimuthal direction – this time using spatial adaptivity and an unstructured mesh 

The Helmholtz equation and perfectly matched layers  
The Helmholtz equation and perfectly matched layers (PMLs). We demonstrate the imposition of the Sommerfeld radiation condition by perfectly matched layers (PMLs) using the example of a radiating cylinder. 

The azimuthally Fourierdecomposed 3D Helmholtz equation and perfectly matched layers (PMLs)  
The azimuthally Fourierdecomposed 3D Helmholtz equation and perfectly matched layers (PMLs). We consider the azimuthally Fourierdecomposed 3D Helmholtz equation and demonstrate the imposition of the Sommerfeld radiation condition by perfectly matched layers (PMLs). 

The Young Laplace equation  
The solution of the YoungLaplace equation. We solve the Young Laplace equation that governs the shape of static airliquid interfaces. 

Contactangle boundary conditions for the YoungLaplace equation We demonstrate how to apply contact angleboundary conditions for the YoungLaplace equation. 

The NavierStokes equations  
The 2D NavierStokes equations: Driven cavity flow Probably the mostsolved problem in computational fluid dynamics: Steady driven cavity flow. We illustrate the problem's discretisation with TaylorHood and CrouzeixRaviart elements. 

The 2D NavierStokes equations: Adaptive solution of the 2D driven cavity problem We employ 

The 2D NavierStokes equations: Driven cavity flow in a quartercircle domain with mesh adaptation We resolve the drivencavity problem in a different domain, demonstrate how to apply body forces and show how to switch between the stressdivergence and simplified forms of the NavierStokes equations. 

Adaptive simulation of 3D finite Reynolds number entry flow into a circular pipe We solve the classical problem of entry flow into a 3D tube. 

We solve a variant of the classical Rayleigh plate problem to demonstrate the use of periodic boundary conditions and timestepping for the NavierStokes equations. 

We demonstrate how to apply traction boundary conditions for the NavierStokes equations. 

2D finiteReynoldsnumberflow driven by an oscillating ellipse We study the 2D finiteReynolds number flow contained inside an oscillating elliptical ring and compare the computed results against an exact solution (an unsteady stagnation point flow). 

2D finiteReynoldsnumberflow in a 2D channel with a moving wall This is a "warmup" problem for the classical fluidstructure interaction problem of flow in a 2D collapsible channel. Here we compute the flow through a 2D channel in which part of one wall is replaced by a moving "membrane" whose motion is prescribed. 

2D finiteReynoldsnumberflow in a 2D channel with a moving wall revisited: Algebraic Node updates. We revisit the problem studied in the previous example and demonstrate an alternative nodeupdate procedure, based on 

We consider a variation of the problem studied in the previous example and demonstrate an alternative nodeupdate procedure, based on 

This is a "warmup" problem for the corresponding fluidstructure interaction problem where the leaflet deforms in response to the fluid traction. Here we consider the case where the motion of the leaflet is prescribed. 

Flow past a cylinder with a waving flag This is a "warmup" problem for Turek & Hron's FSI benchmark problem where the flag deforms in response to the fluid traction. Here we consider the case where the motion of the flag is prescribed. 

Unstructured meshes for fluids problems This is a "warmup" problem for another tutorial in which we demonstrate the use of unstructured meshes for FSI problems. 

Unstructured meshes for 3D fluids problems This is a "warmup" problem for another tutorial in which we demonstrate the use of unstructured 3D meshes for FSI problems. 

Steady finiteReynoldsnumber flow through an iliac bifurcation We show how to simulate physiological flow problems, using the Vascular Modeling Toolkit (VMTK). This is a "warmup" problem for another tutorial in which we consider the corresponding FSI problems in which the vessel wall is elastic. 

Motion of elliptical particles in shear flow: unstructured adaptivity We solve the classical problem of shear flow past a immersed ellipse 

Adaptive simulation of flow at finite Reynolds number in a curved circular pipe We solve the classical problem of flow into a 3D curved tube. 

The axisymmetric NavierStokes equations  
A classical fluid mechanics problem: Spinup of a viscous fluid. A key feature of the flow is the development of thin Ekman (boundary) layers during the early stages of the spinup. We demonstrate how the use of spatial adaptivity helps to resolve these layers. At large times, the flow field approaches a rigidbody rotation – this poses a subtle problem for the spatial adaptivity as its default behaviour would cause strong spatially uniform refinement. 

The freesurface NavierStokes equations  
Interfaces, Free Surfaces and Surface Transport: Theory and Implementation. In this document, we introduce the basic theory of moving surfaces, surface calculus and surface transport equations. In addition, we describe how oomphlib's freesurface and surfacetransport capabilities are implemented. 

Freesurface relaxation oscillations of a viscous fluid layer. We study the oscillations of a perturbed fluid layer and compare the results to the analytic dispersion relation based on linearised disturbances. 

Relaxation oscillations of an interface between two viscous fluids. We study the oscillations of a twolayer fluid system and compare the results to the analytic dispersion relation based on linearised disturbances. 

A static free surface bounding a layer of viscous fluid. A hydrostatics problem: Compute the static free surface that bounds a layer of viscous fluid – harder than you might think! 

A static interface between two viscous fluids. A hydrostatics problem: Compute the static interface between two viscous fluids – harder than you might think! 

Flow of a fluid film down an inclined plane A classical fluid mechanics problem: We study the flow of a film of fluid down an inclined plane and compare the results to the exact solution of Nusselt. The stability is assessed by simulating the timeevolution of a perturbation to the free surface. 

The Bretherton problem: An air finger propagates into a 2D fluidfilled channel. A classical fluid mechanics problem: We study the propagation of an inviscid (air) finger into a 2D fluidfilled channel and compare our results against those from Bretherton's theoretical analysis. 

A finite bubble propagates in a 2D fluidfilled channel. Uses a pseudoelastic remesh strategy and unstructured spatial adaptivity in a nontrivial free surface problem. 

A finite droplet propagates in a 2D fluidfilled channel. Uses a pseudoelastic remesh strategy and unstructured spatial adaptivity in a nontrivial interfacial (twofluid) problem. 

The axisymmetric freesurface NavierStokes equations  
Relaxation oscillations of an interface between two viscous fluids in an axisymmetric domain. We study the oscillations of a twolayer fluid system in an axisymmetric domain and compare the results to the analytic dispersion relation based on linearised disturbances. 

An axisymmetric static free surface bounding a layer of viscous fluid. A hydrostatics problem: Compute the static free surface that bounds a layer of viscous fluid in an axisymmetric geometry. 

Nonlinear solid mechanics problems  
Nonlinear solid mechanics: Theory and implementation In this document we discuss the theoretical background and the practical implementation of 

We study a classical solid mechanics problem: the bending of a cantilever beam subject to a uniform pressure loading on its upper face and/or gravity. We compare the results for zerogravity against the (approximate) analytical St. Venant solution for the stress field. 

Axisymmetric compression of a circular disk We study the axisymmetric compression of a circular, elastic disk, loaded by an external traction. The results are compared against the predictions from smalldisplacement elasticity. 

Compressible and incompressible behaviour We discuss various issues related to (in)compressible material behaviour and illustrate various solution techniques in a simple testproblem: The compression of a square block of (compressible or incompressible) material by a gravitational body force. The results are compared against the predictions from smalldisplacement elasticity. 

Axisymmetric oscillations of a circular disk We study the free axisymmetric oscillations of a circular, elastic disk and compare the eigenfrequencies and modes against the predictions from smalldisplacement elasticity. 

Deformation of a solid by a prescribed boundary motion We study the large deformations of a 2D elastic domain, driven by the prescribed deformation of its boundary. The boundary motion is imposed by Lagrange multipliers. This technique is important for the solution of fluidstructure interaction problems in which the deformation of the fluid mesh is controlled by (pseudo)elasticity. 

Largeamplitude bending of an asymmetric 3D cantilever beam made of incompressible material. We study the deformation of an asymmetric 3D cantilever beam made of incompressible material. 

Unstructured meshes for 2D and 3D solid mechanics problems. We demonstrate how to use unstructured meshes to solve 2D and 3D solid mechanics problems. This tutorial acts as a "warmup" problem for the solution of unstructured FSI problems. 

Unstructured meshes for 3D solid mechanics problems. We demonstrate how to use unstructured meshes to solve 3D solid mechanics problems. This is a "warmup" problem for another tutorial in which we demonstrate the use of unstructured 3D meshes for FSI problems. 

We show how to simulate physiological solid mechanics problems, using the Vascular Modeling Toolkit (VMTK). This is a "warmup" problem for another tutorial in which we consider the corresponding FSI problems in which the vessel conveys (and is loaded by) a viscous fluid. 

Largeamplitude shock waves in a circular disk We study the propagation of shock waves in an elastic 2D circular disk. 

Solid Mechanics using unstructured meshes with adaptivity We study the deflection of a 2D rectangular solid under a lateral pressure load. 

Large shearing deformations of a hyperelastic, incompressible block of material We solve a classical problem in largedisplacement elasticity and compare against Green and Zerna's exact solution. 

Linear elasticity  
Linear Elasticity: Theory and implementation In this document we discuss the theoretical background and the practical implementation of 

We demonstrate how to compute the deformation of a linearly elastic strip, loaded by a spatially periodic surface traction, using spatial adaptivity. 

Axisymmetric linear elasticity  
Axisymmetric linear elasticity: Theory, implementation and a timedependent demo problem. In this document we discuss the theoretical background and the practical implementation of 

Timeharmonic linear elasticity  
The equations of timeharmonic linear elasticity: Theory and implementation In this document we discuss the theoretical background and the practical implementation of equations describing forced, timeharmonic oscillations of elastic bodies. 

Solving the equations of timeharmonic linear elasticity on unstructured meshes We revisit the solution of the equations of timeharmonic linear elasticity – this time using an unstructured mesh. 

Generalised timeharmonic linear elasticity and perfectly matched layers (PMLs)  
The generalised equations of timeharmonic linear elasticity and perfectly matched layers (PMLs). In this document we discuss a generalisation of the equations of timeharmonic linear elasticity that allows the implementation of far field boundary condition by perfectly matched layers 

Azimuthally Fourierdecomposed 3D timeharmonic linear elasticity  
In this document we discuss the theoretical background and the practical implementation of equations describing forced, timeharmonic, nonaxisymmetric oscillations of axisymmetric elastic bodies. 

We simulate the forced, timeharmonic oscillations of a hollow cylinder loaded by a spatiallyconstant pressure load on its inner surface. 

Beam structures  
The deformation of a prestressed elastic beam, loaded by a pressure load We study the lateral deformation of a prestressed elastic beam, using 

Largedisplacement postbuckling of a pressureloaded, thinwalled elastic ring We compute the postbuckling deformation of a thinwalled elastic ring, subjected to a pressure load and compare the results against results from the literature. 

Largeamplitude oscillations of a thinwalled elastic ring. We compute the free, largeamplitude oscillations of a thinwalled elastic ring and demonstrate that Newmark's method is energy conserving. 

Smallamplitude oscillations of a thinwalled elastic ring. We compute the free, smallamplitude oscillations of a thinwalled elastic ring, demonstrate that Newmark's method is energy conserving, and compare the oscillation frequencies and mode shapes against analytical predictions. 

Shell structures  
Largedisplacement postbuckling of a clamped, circular cylindrical shell. We simulate the postbuckling deformation of a pressureloaded, clamped, thinwalled elastic shell. 

Largedisplacement fluidstructure interaction problems  
Warmup problem for freeboundary problems: How to parametrise unknown boundaries. We demonstrate how to "upgrade" a 

We show how to use 

We demonstrate the solution of this classical fluidstructure interaction problem and demonstrate how easy it is to combine the two singlephysics problems (the deformation of an elastic beam under pressure loading and the flow in a 2D channel with a moving wall) to a fullycoupled fluidstructure interaction problem. 

We revisit the problem of flow in a collapsible channel to demonstrate that the sparse algebraic node update procedures first discussed in an earlier nonFSI example lead to a much more efficient code. 

We revisit the problem of flow in a collapsible channel yet again to demonstrate the use of spatial adaptivity in fluidstructure interaction problems. 

We revisit the problem of flow in a collapsible channel once more to demonstrate the use of segregated solvers in fluidstructure interaction problems. 

We revisit the problem of flow in a collapsible channel yet again to demonstrate the use of 

We study the flow in a 2D channel that is partially obstructed by an elastic leaflet. 

Turek & Hron's FSI benchmark: Flow past an elastic flag attached to a cylinder We demonstrate how to discretise and solve this benchmark problem with 

Using unstructured meshes for FSI problems. We demonstrate how to use xfig/trianglegenerated unstructured meshes (together with a pseudosolid node update strategy for the fluid mesh) in fluidstructure interaction problems. 

Using unstructured meshes for 3D FSI problems. We demonstrate how to use tetgengenerated unstructured meshes for 3D fluidstructure interaction problems. 

2D FSI on unstructured meshes with adaptivity We demonstrate how to use spatial adaptivity on unstructured meshes for 2D fluidstructure interaction problems. 

FiniteReynoldsnumber flow through an elastic iliac bifurcation We show how to simulate physiological fluidstructure interaction problems, using the Vascular Modeling Toolkit (VMTK). 

We discuss 

This is a very simple fluidstructure interaction problem: We study the finiteReynolds number internal flow generated by an oscillating ring. The wall motion only has a single degree of freedom: The ring's average radius, which needs to be adjusted to conserve mass. The nodal positions in the fluid domain is updated by 

We revisit the simple fluidstructure interaction problem considered in the earlier example.This time we perform the update of the nodal positions with 

Our first "real" fluidstructure interaction problem: We study the finiteReynolds number internal flow generated by the motion of an oscillating elastic ring and compare the results against asymptotic predictions. 

Acoustic fluidstructure interaction problems  
We provide an overview of 

A brief extension of the previous tutorial illustrating how to solve the problem with unstructured meshes. 

Azimuthally Fourierdecomposed 3D acoustic fluidstructure interaction problems  
We provide an overview of 

A brief extension of the previous tutorial illustrating how to solve the problem on adaptive, unstructured meshes. 

Multiphysics problems  
Simple multiphysics problem: How to combine existing singlephysics elements into new multiphysics elements. We demonstrate how to "combine" a 

We demonstrate how to "combine" a 

Solving multifield problems with multidomain discretisations. We demonstrate an alternative approach to the solution of multifield problems, in which the governing PDEs are discretised in separate meshes and interact via "external elements". 

Thermoelasticity: How to combine singlephysics elements with solid mechanics elements. We demonstrate how to "combine" a 

Surfactant Transport: How to add surface transport equations to free surface elements. We demonstrate how to add general surface transport equations to the 

Eigenproblems  
How to formulate and solve an eigenproblem. We demonstrate how to write 

How to formulate and solve an eigenproblem involving complex eigenvalues. We demonstrate how to write 

Structured meshes  
We list 

Unstructured meshes using input from thirdparty mesh generators  
Unstructured meshes generated via input from thirdparty mesh generators We describe 

Inline unstructured mesh generation We describe how to generate unstructured 2D meshes from within an 

Inline unstructured mesh generation including internal boundaries We describe how to generate unstructured 2D meshes that contain internal boundaries, delineating different regions of space, from within an 


Direct and iterative linear solvers and generalpurpose preconditioners  
We provide an overview of 

(Distributed) linear algebra and oomphlib's block preconditioning framework  
(Distributed) Linear Algebra Infrastructure We provide an overview of oomphlib's (distributed) linear algebra infrastructure. 

(Distributed) Block preconditioners We provide an overview of oomphlib's (distributed) block preconditioning framework and demonstrate how to write a new block preconditioner. 

(Distributed) Generalpurpose block preconditioners We provide an overview of oomphlib's (distributed) general purpose block preconditioners 

Problemspecific preconditioners  
We discuss 

We discuss 

We discuss 

We discuss 

Paraview  
Displaying results with paraview We demonstrate how to use Angelo Simone's conversion scripts that allow the 

Please consult the general tutorial on oomphlib
's parallel processing capabilities.
Distributed problems  
Example code 

Parallel solution of the adaptive driven cavity problem We demonstrate how to distribute a straightforward singlephysics problem. 

Parallel solution of the adaptive driven cavity problem with load balancing We demonstrate the modifications required to perform a load balancing step within the distributed adaptive driven cavity problem 

Parallel solution of the 2D Poisson problem with flux boundary conditions We demonstrate the modifications required to distribute a problem involving 

Parallel solution of the Boussinesq convection problem We demonstrate how to distribute a straightforward multiphysics problem where two domains interact. 

Parallel solution of an FSI problem: Channel with an elastic leaflet We demonstrate how to distribute FSI problems that use algebraic update methods. 

Parallel solution of Turek and Hron's FSI benchmark problem We demonstrate how to distribute a problem involving refineable 2D solid and fluid meshes that interact along interface boundaries. 
