Rodin
Modern C++20 finite element method and shape optimization framework.
What is Rodin?
Rodin is a lightweight and modular C++20 finite element framework designed for solving partial differential equations (PDEs) and performing shape and topology optimization. It provides a compositional form language that lets you express variational problems in C++ code that closely mirrors the mathematical notation:
Mesh mesh; mesh = mesh.UniformGrid(Polytope::Type::Triangle, {16, 16}); mesh.getConnectivity().compute(1, 2); P1 Vh(mesh); TrialFunction u(Vh); TestFunction v(Vh); Problem problem(u, v); problem = Integral(Grad(u), Grad(v)) - Integral(f, v) + DirichletBC(u, Zero()); Solver::CG(problem).solve();

It is named after the French sculptor Auguste Rodin, considered the founder of modern sculpture.
Architecture
Rodin is organized as a set of orthogonal modules that remain composable:
| Module | Responsibility |
|---|---|
| Geometry | Meshes, polytopes, connectivity, geometric transformations |
| Variational | Finite element spaces (P0, P1, H1), trial/test functions, forms, and problem composition |
| Assembly | Low-level assembly of stiffness matrices and load vectors |
| Solver | Direct solvers (SparseLU, UMFPack) and iterative solvers (CG, GMRES) |
| QF | Quadrature formulas (Gauss–Legendre, Grundmann–Möller) |
| IO | I/O in MFEM, MEDIT, HDF5, and XDMF (ParaView) formats |
| FormLanguage | Expression template infrastructure for the variational form language |
| Math | Mathematical constants, dense vector/matrix types, common functions |
Optional extension modules add capabilities without replacing core functionality:
| Extension | Purpose |
|---|---|
| MMG | Mesh adaptation and optimization via the Mmg Platform |
| PETSc | Distributed solvers (KSP, SNES) and PETSc-backed variational forms for large-scale problems |
| MPI | Distributed mesh partitioning, sharding, and parallel assembly via Boost.MPI |
| Solid | Hyperelastic solid mechanics: NeoHookean, SaintVenantKirchhoff, MooneyRivlin constitutive laws |
| Advection | Semi-Lagrangian transport via characteristic tracing |
| Eikonal | Fast Marching Method for the Eikonal equation | | Distance | Distance function computation (Eikonal, Poisson, level-set normalization) |
Download and build
git clone --recursive https://github.com/cbritopacheco/rodin cd rodin mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release make -j4
See the Installation guide for detailed instructions, dependency lists, and platform-specific notes.
Where to start?
- New users: Start with the Installation guide and the First Steps tutorial
- Learn the concepts: Read about finite elements, finite element spaces, and variational formulations
- See examples: Browse the examples and tutorials including the Poisson equation and linear elasticity
- Visual showcase: Visit the Gallery for images and descriptions of simulations built with Rodin
- I/O and visualization: Learn how to export results using XDMF for ParaView visualization
- Parallel computing: See MPI distributed computing and PETSc solvers for large-scale problems
- Notation reference: Consult the Notation page for the mathematical symbols used throughout the documentation
Philosophy behind Rodin
From its inception, Rodin was built with a "batteries included, but screws not glued in" philosophy. The design principles are:
- Compositional: Users build problems explicitly by composing trial/test functions, integrals, boundary conditions, and solvers. Nothing is hidden behind opaque orchestration objects.
- Mathematically transparent: The C++ form language mirrors the mathematical notation.
Integral(Grad(u), Grad(v))corresponds directly to . - Modular: Each module (Geometry, Variational, Solver, etc.) has a well-defined responsibility. New functionality extends existing abstractions rather than duplicating them.
- Readable: Code should be well documented and stick very close to the mathematical notation it represents.
Development Status
The library is currently in very active development! Some interfaces are likely to change. However, a lot of the functionality is already implemented with various extension points. Contributors are always welcome! Currently it is maintained (and primarily used) by Carlos Brito-Pacheco.