Demo documentation

Under development

Using the Python interface

Introductory DOLFIN demos

These demos illustrate core DOLFIN/FEniCS usage and are a good way to begin learning FEniCS. We recommend that you go through these examples in the given order.

  1. Getting started: Solving the Poisson equation.
  2. Solving nonlinear PDEs: Solving a nonlinear Poisson equation
  3. Using mixed elements: Solving the Stokes equations
  4. Using iterative linear solvers: Solving the Stokes equations more efficiently

More advanced DOLFIN demos

These examples typically demonstrate how to solve a certain PDE using more advanced techniques. We recommend that you take a look at these demos for tips and tricks on how to use more advanced or lower-level functionality and optimizations.

  • Implementing a nonlinear hyperelasticity equation
  • Implementing a splitting method for solving the incompressible Navier-Stokes equations
  • Using a mixed formulation to solve the time-dependent, nonlinear Cahn-Hilliard equation
  • Computing eigenvalues of the Maxwell eigenvalue problem

Demos illustrating specific features

How to

  • work with built-in meshes
  • define and store subdomains
  • integrate over subdomains
  • set boundary conditions on non-trivial geometries
  • solve a basic eigenvalue problem
  • set periodic boundary conditions
  • de-singularize a pure Neumann problem by specifying the nullspace
  • de-singularize a pure Neumann problem by adding a constraint
  • use automated goal-oriented error control
  • specify a Discontinuous Galerkin formulation
  • work with c++ expressions in Python programs
  • specify various finite element spaces