deal.II
C++ finite element library supporting adaptive meshes, high-order elements, multigrid solvers, and massively parallel computations. One of the most comprehensive open-source FEM libraries with extensive hp-adaptivity support.
hp-Adaptive Error Estimation
deal.II uses a posteriori error estimators to drive adaptive refinement. The Kelly error estimator computes:
Where η_K is the error indicator on cell K, h_K is the cell diameter, and ⟦·⟧ denotes the jump of the normal gradient across cell faces.
Library Architecture
Triangulation
Mesh management
DoFHandler
Degree-of-freedom distribution
FiniteElement
Shape functions
LinearAlgebra
PETSc / Trilinos
Numerics
Assembly & postprocess
Key Features
Adaptive Mesh Refinement
Full support for h-refinement (mesh subdivision), p-refinement (polynomial degree elevation), and hp-adaptivity. Error estimators drive automatic refinement for optimal convergence rates.
Rich Element Library
Continuous and discontinuous Lagrange, Raviart-Thomas, Nédélec, BDM elements of arbitrary order. Supports triangles, quadrilaterals, tetrahedra, hexahedra, prisms, and pyramids.
Massively Parallel
Scales to 100,000+ MPI processes. Distributed meshes via p4est. Parallel linear algebra through PETSc/Trilinos. Demonstrated scaling on leadership-class supercomputers.
Multigrid Solvers
Geometric and algebraic multigrid (AMG) preconditioners. Matrix-free operator evaluation for memory-efficient high-order discretisations.
Example: Laplace Problem
// Laplace equation with deal.II (simplified)
#include <deal.II/grid/tria.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/lac/sparse_matrix.h>
#include <deal.II/lac/vector.h>
#include <deal.II/numerics/matrix_tools.h>
#include <deal.II/numerics/vector_tools.h>
using namespace dealii;
template <int dim>
class LaplaceProblem {
Triangulation<dim> triangulation;
FE_Q<dim> fe;
DoFHandler<dim> dof_handler;
SparsityPattern sparsity_pattern;
SparseMatrix<double> system_matrix;
Vector<double> solution;
Vector<double> system_rhs;
public:
LaplaceProblem() : fe(2), dof_handler(triangulation) {}
void run() {
GridGenerator::hyper_cube(triangulation, -1, 1);
triangulation.refine_global(5);
dof_handler.distribute_dofs(fe);
// ... assemble system and solve
}
};Tutorial Programme
deal.II features 80+ well-documented tutorial steps, progressing from basics to advanced topics:
Step 1–6
Basics: Laplace, grids, refinement
Step 7–12
Elasticity, mixed FEM, multigrid
Step 20–30
Navier-Stokes, nonlinear, time-dep.
Step 40+
Parallel, matrix-free, hp-methods
Resources: Visit dealii.org for documentation, tutorials, and the video lecture series. VELSTROM-specific deal.II workflows are under development.