Rodin

Rodin Rodin

A modern C++ FEM library for shape and topology optimization.

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 is named after the French sculptor Auguste Rodin, considered the founder of modern sculpture.

Carlos Brito-Pacheco's GitHub profile picture

Active development

The library is in active development and primarily maintained by Carlos Brito-Pacheco, who is actively looking for co-maintainers. Contributions and supporting institutions are acknowledged in the credits.

Poisson example

The compositional form language expresses variational problems in C++ using the mathematical notation of their weak formulations. For example, the Poisson problem with homogeneous Dirichlet boundary conditions, in strong form, for a domain $\Omega$ with boundary $\partial\Omega$ is

\[ \begin{aligned} -\Delta u &= f && \text{in } \Omega,\\ u &= 0 && \text{on } \partial\Omega. \end{aligned} \]

The corresponding weak problem seeks $u \in H^1_0(\Omega)$ such that

\[ \int_\Omega \nabla u \cdot \nabla v \, dx = \int_\Omega f v \, dx \qquad \forall v \in H^1_0(\Omega). \]

The following code constructs the mesh, defines the finite-element space and solves this weak problem. The complete tutorial explains each step and exports the computed field.

Mesh mesh;
mesh = mesh.UniformGrid(Polytope::Type::Triangle, {16, 16});
mesh.scale(1.0 / 15.0);
mesh.getConnectivity().compute(1, 2);

P1 vh(mesh);
TrialFunction u(vh);
TestFunction  v(vh);
RealFunction f = 1;

Problem problem(u, v);
problem = Integral(Grad(u), Grad(v))
        - Integral(f, v)
        + DirichletBC(u, Zero());

Solver::CG(problem).solve();

Architecture

The core modules form the central stack. Models build on these interfaces to the left; third-party integrations and dependencies sit to the right. Shared services support the library across these layers.

Image

Download and build

See the Installation guide for detailed instructions, dependency lists, and platform-specific notes.

Bash installation

git clone --recursive https://github.com/cbritopacheco/rodin
cd rodin
git lfs install
git lfs pull  # required for resources
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j4

Git LFS

For a library-and-headers installation, configure with -DRODIN_INSTALL_RESOURCES=OFF and skip hydrating the Git LFS resources.

Where to start?

New to Rodin? Start by solving a complete problem. Follow the steps below to install the library, build a first program, solve the Poisson equation, and visualize the result.

1. Install Rodin

Set up the dependencies and build the library using the Installation guide.

2. Build a first program

Follow First steps to learn how meshes, finite element spaces, trial and test functions, and solvers fit together.

3. Solve and visualize a problem

Work through A first problem to solve the Poisson equation, then use the I/O and visualization guide to export the solution for inspection in ParaView.

For examples of results produced with Rodin, visit the Gallery.

Design

The architecture draws on the modular design of mosra's Magnum Engine. For Rodin it means meshes, finite element spaces, forms, assembly, and solvers work together, while their interfaces remain accessible for extensions. A custom solver, constitutive law, or integrator can reuse the surrounding components.

The form language keeps the mathematics visible in C++. For real-valued scalar fields $u$ , $v$ , and $f$ on $\Omega$ ,

\[ \begin{aligned} \texttt{Integral(Grad(u), Grad(v))} &\quad\longleftrightarrow\quad \int_\Omega \nabla u \cdot \nabla v \, dx, \\ \texttt{Integral(f, v)} &\quad\longleftrightarrow\quad \int_\Omega f v \, dx. \end{aligned} \]

Spaces, integrals, and boundary conditions are composed explicitly; assembly and the chosen solver realize the discrete problem. Module boundaries follow these responsibilities, allowing new models to reuse existing geometry, evaluation, and algebra.

License and use

Anyone. Rodin is distributed under the Boost Software License 1.0, a permissive open-source license that allows its use, modification, and redistribution in academic, industrial, commercial, and proprietary projects. The aim is to make Rodin useful for research and general-purpose finite element applications with as few restrictions as possible.

Boost logo

Software that uses or links against Rodin can retain its own license, including a proprietary one. The Boost Software License permits that software to retain its source-distribution policy and license. When redistributing Rodin source code or modified portions of it, retain the original copyright notices and the complete license statement. This obligation applies to the redistributed Rodin code.

Acknowledgement

Acknowledgement is optional and appreciated.

If Rodin contributes to research, software, or other work, consider mentioning its use and linking to the project repository. For academic work, a software citation is also welcome. These acknowledgements make Rodin's use visible and support its continued development.

@misc{BritoPacheco2024Rodin,
  author       = {Brito-Pacheco, Carlos},
  title        = {{Rodin}: A modern C++ finite element framework for shape and topology optimization},
  year         = {2024},
  howpublished = {Computer software},
  version      = {0.0.1},
  url          = {https://github.com/cbritopacheco/rodin},
  note         = {Open-source finite element framework}
}