The tutorial programs in the tutorial/ directory are small, self-contained example programs. Each one solves a concrete mathematical problem with Kaskade 7 and prints or writes a verifiable result, so that a run confirms that the program is correct. They are the recommended starting point for learning how to use the library.
The tutorials are meant to be read in the order below. The first group introduces the basic workflow (define a variational functional, assemble, solve, verify). Later groups build on this and add one new ingredient at a time (curved domains and materials, error estimation, time stepping, systems of equations, nonlinear and inverse problems, parallel solution). Most tutorials write their result to a VTK file (.vtu) that can be inspected in ParaView.
The tutorials registered in TUTORIALMODULES are built by make tutorial and run by make run-tutorial from the top-level directory; each can also be built and run individually in its own subdirectory. A few additional examples (electrostatic, sst_pollution, mpiexample, steady_state_saturated_groundwater_flow) are kept as standalone programs with their own Makefile and are not part of make tutorial. New users should start with Laplacian.
Basic workflow
- laplacian — the "hello world" of Kaskade 7. Solves the Poisson equation on the unit square with a manufactured solution and verifies the computed solution against the known exact solution. Shows the complete workflow: generate a grid, build an \(H^1\)-conforming Lagrange space, define the variational functional, assemble the linear system, solve it directly, and write VTK output. Learn: how a PDE problem is turned into a variational functional and solved end to end.
- artificial_1d_testProblem — solves a scalar model problem on a one-dimensional grid. Shows how to construct a custom grid (a Dune::OneDGrid with prescribed vertices), how to assemble on it, and how to set up a variational functional in the simplest possible setting. Learn: the 1D case, custom grid construction, and the anatomy of a variational functional.
- stationary_heattransfer — Poisson solver comparison on the unit square with a manufactured solution. Runs all available direct solvers (UMFPACK, CHOLMOD, MUMPS) and iterative solvers (CG with Identity, Jacobi, hierarchical basis (HB), BPX additive multigrid and multiplicative geometric multigrid preconditioners) and prints timing, error, and VKT tables (Iteration | Residual | maxError | Time). The VTK output of the remaining error shows which error components are reduced slowly — these correspond essentially to eigenvectors of the iteration matrix with the largest eigenvalues. Learn: comparing linear solvers, VKT-style convergence monitoring, error visualization.
Grids, geometry and materials
- gridIO — no PDE is solved; instead this demonstrates grid input and output. Shows how to read grids from VTK/Amira/gmsh files, how to modify a grid (rotate, translate, scale), how to write grids back, and how to read and write solution fields. Learn: handling meshes and file formats.
- geomgrid — solves the Poisson equation on a curved domain. Shows how Dune::GeometryGrid together with an analytical coordinate function maps a simple reference mesh onto a curved geometry (here a circle) with an exact boundary representation. Learn: representing curved domains.
- extrusion — grid generation by extrusion. Extrudes a lower-dimensional surface mesh (a curve in 2D, a triangulated surface in 3D) into a conforming simplicial volume grid of prescribed thickness with the function Kaskade::extrude. Learn: how to create volume grids from surface grids (e.g. for thin shells or interface layers).
- electrostatic — the electrostatic potential equation with a piecewise constant permittivity. Shows inhomogeneous material coefficients and reading a mesh from a gmsh file. Learn: multi-material problems and external meshes.
Error estimation and adaptivity
- Embedded_errorEstimation — solves a Poisson problem with a localized peak source and drives adaptive mesh refinement by an embedded error estimator. Shows how to obtain a posteriori error indicators from the discretization and how to refine the mesh accordingly. Learn: a posteriori error estimation and adaptive refinement.
- HB_errorEstimation — a Poisson problem with a localized Gaussian peak on the unit square, solved with P1 elements. Shows how a hierarchic basis (HB) error estimator produces cell-wise indicators from a defect problem on a higher-order extension space, and how these indicators drive a simple refine-only adaptive loop. Learn: the hierarchic basis error estimator and the essential adaptive cycle without solver or file-format distractions.
Time-dependent problems
- instationary_heattransfer — the unsteady heat equation with a moving source. Shows time integration with the IMEX Limex solver (including embedded error estimation and adaptive time steps) and with a semi-implicit Euler scheme, and how to write a time series of VTK files. Learn: time discretization of parabolic problems.
- cardio — the monodomain model of cardiac electrophysiology with the Aliev–Panfilov ionic model in 3D. Shows a coupled reaction-diffusion system advanced in time with an IMEX scheme. Learn: reaction-diffusion systems and IMEX time stepping for coupled problems.
Systems of equations
- stokes — the stationary Stokes equations (lid-driven cavity). Shows mixed Taylor–Hood elements, the saddle-point block structure, and its solution by either a direct solver or an Uzawa iteration. Learn: mixed finite elements and saddle-point problems.
- instationary_NavierStokes — the unsteady incompressible Navier–Stokes equations for several benchmark flows (driven cavity, Kármán vortex street, airfoil). Shows time stepping of a nonlinear system with streamline-diffusion stabilization. Learn: unsteady nonlinear flow problems.
- elastomechanics — linear elasticity for a solid body with several materials. Shows the elasticity functional, threaded assembly, and a multigrid (BPX/additive) preconditioned CG solver. A simpler simple_beam variant is included. Learn: elasticity and multigrid-preconditioned solvers.
Convection-dominated problems
- convection_diffusion_equation/stationary — the stationary convection-diffusion-reaction equation in the convection-dominated regime. Shows streamline-diffusion stabilization and comparison of the numerical with the analytical solution. Learn: stabilized discretization of convection-dominated problems.
Nonlinear and inverse problems
- inverse — an inverse heat transfer problem: recover an unknown heat source from noisy measurements. Shows the adjoint-based optimization loop and the use of several finite element spaces. Learn: parameter identification and adjoint methods.
- sst_pollution — a nonlinear coupled reaction-diffusion system (sediment-pollution model). Shows Newton's method and alternative nonlinear solvers (NLEQ, GIANT) with a BiCGSTAB/ILUK linear solver. Learn: nonlinear systems and their solution strategies.
- steady_state_saturated_groundwater_flow — steady groundwater flow with a nonlinear (pressure-dependent) conductivity. Shows a nonlinear material law and multilayer materials. Learn: nonlinear elliptic problems.
Parallel computing
- mpiexample — the stationary heat equation solved with the parallel direct solver MUMPS-MPI. Shows distributed matrix assembly (lower triangle only) and parallel solution. Learn: MPI-parallel solution of linear systems.