![]() |
KASKADE 7 development version
|
Classes and functions that test whether certain parts of Kaskade work as they should.
Classes and functions that test whether certain parts of Kaskade work as they should.
Poisson equation with known exact solution: convergence of the Galerkin error for Lagrange elements.
Unit test for the conjugate gradient solver.
Kaskade 7 provides a set of test programs that check the expected behavior of the library when solving certain PDE problems. The test suite does not cover all library modules, though.
Each test documents itself in this group via a tests/<name>/<name>.dox file, see for example cgtest.
Tests adhere to the following pattern:
tests/cg is a unit test for the unified Kaskade::CG solver (linalg/cgImplementation.hh). In contrast to the PDE-driven tests, it works on explicitly constructed symmetric matrices (tridiagonal and diagonal Dune::BCRSMatrix with scalar entries) and does not require a grid. It verifies the algorithmic properties of the solver:
The test executable returns 0 on success and a non-zero code on failure, printing a diagnostic for each failed check.
tests/poisson solves the Poisson equation
\[ -\Delta u = f \quad \text{in } \Omega = (0,1)^2, \qquad u = g \quad \text{on } \partial\Omega, \]
where the data \( f \) (and, via the weak formulation, the Dirichlet boundary condition \( g \), see poisson.hh) are chosen such that the exact solution is the smooth, non-polynomial function
\[ u(x,y) = \cos(3\pi x) + \sin(4\pi y). \]
The corresponding right hand side is
\[ f = -\Delta u = \pi^2\big( 9\cos(3\pi x) + 16\sin(4\pi y) \big). \]
The weak formulation is discretized by \( H^1 \)-conforming Lagrange elements (ContinuousLagrangeMapper) of polynomial order \( p \in \{1,2,3,5\} \) on the unit square (triangulated into two triangles) and solved on a sequence of uniformly refined meshes with mesh size \( h = 2^{-k} \) (five refinement steps after an initial refinement). The algebraic systems are solved either with a direct solver (MUMPS, UMFPACK) or with the preconditioned CG solver, using the preconditioners ILUT, ILUK, ICC0, ICC, BoomerAMG, Euclid and Jacobi. The unpreconditioned variants and the ARMS and HB preconditioners are known to fail and are not exercised.
For a fixed order \( p \), the theory predicts (for a smooth solution) the \( L^2 \)-error estimate
\[ \| u - u_h \|_{L^2(\Omega)} \le C h^{p+1}, \]
i.e. the \( L^2 \)-norm of the discretization error decays at least with order \( p+1 \) (up to the superconvergence effects observed at the corners of the square). The test verifies two properties:
The test returns 0 on success and a non-zero code on failure, printing the measured errors and convergence orders for each configuration.