rodin
Modern C++20 finite element method and shape optimization framework.
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.9%) to scientific vocabulary
Keywords
Repository
Modern C++20 finite element method and shape optimization framework.
Basic Info
- Host: GitHub
- Owner: cbritopacheco
- License: bsl-1.0
- Language: C++
- Default Branch: master
- Homepage: https://cbritopacheco.github.io/rodin/
- Size: 181 MB
Statistics
- Stars: 51
- Watchers: 2
- Forks: 9
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
Rodin 
Rodin is a lightweight and modular finite element framework which provides many of the associated functionalities that are needed when implementing shape and topology optimization algorithms. These functionalities range from refining and remeshing the underlying shape, to providing elegant mechanisms to specify and solve variational problems.
It is named after the French sculptor Auguste Rodin, considered the founder of modern sculpture.
The library is still in development. It is primarily maintained by Carlos Brito-Pacheco and was developed to generate examples for his ongoing PhD.
Any contributors are warmly encouraged and any help or comments are always appreciated!
Status
| Branch | Matrix | Tests | Code Coverage | Benchmarks | Documentation |
|:-----------:|:--------:|:-----:|:-------------:|:----------:|:-------------:|
| master | |
|
|
|
|
| develop |
|
|
|
|
|
Table of Contents
- Building the project
- Features
- Third-Party integrations
- Requirements
- CMake options
- Building the documentation
Building the project
git clone --recursive https://github.com/carlos-brito-pacheco/rodin
cd rodin
mkdir build && cd build
cmake ..
make -j4
Features
Embedded form language for FEM modelling
Rodin comes with a native C++20 form language for assembling and solving variational formulations.
For example, given a domain $\Omega$ with boundary $\Gamma := \partial \Omega$, the Poisson problem:
math
\left\{
\begin{aligned}
-\Delta u &= f && \text{in } \Omega\\
u &= 0 && \text{on } \Gamma \ ,
\end{aligned}
\right.
has the associated weak formulation:
math
\text{Find} \ u \in H^1(\Omega) \quad \text{s.t.} \quad \forall v \in H^1_0(\Omega), \quad \int_\Omega \nabla u \cdot \nabla v \ dx = \int_\Omega f v \ dx, \quad \text{with } \quad H^1_0(\Omega) := \{ v \in H^1(\Omega) \mid v = 0 \text{ on } \Gamma \}
which can be quickly implemented via the following lines of code:
```c++
include
include
include
using namespace Rodin; using namespace Rodin::Geometry; using namespace Rodin::Variational;
int main(int, char**) { Mesh Omega; Omega = Omega.UniformGrid(Polytope::Type::Triangle, 16, 16); mesh.getConnectivity().compute(1, 2);
P1 Vh(Omega);
TrialFunction u(Vh); TestFunction v(Vh);
Solver::SparseLU solver;
Problem poisson(u, v); poisson = Integral(Grad(u), Grad(v)) - Integral(v) + DirichletBC(u, Zero()); poisson.solve(solver);
return 0; } ```
|
| solution of the poisson equation. |
Full high level mesh access and functionalities
Cell, Face, Vertex Iterators
The API offers full support for iteration over all polytopes of the mesh of some given dimension:
```c++ Mesh mesh; mesh = mesh.UniformGrid(Polytope::Type::Triangle, 16, 16); // 2D Mesh
for (auto it = mesh.getCell(); it; ++it) { // Access information about the cell }
for (auto it = mesh.getFace(); it; ++it) { // Access information about the face }
for (auto it = mesh.getVertex(); it; ++it) { // Access information about the vertex }
for (auto it = mesh.getPolytope(1); it; ++it) { // Access information about the face (face dimension in 2D is equal to 1) }
```
Full connectivity computation
Rodin is able to compute any connectivity information on the mesh. For example, the following computes the adjacency information from faces to cells:
```c++ Mesh mesh; mesh = mesh.UniformGrid(Polytope::Type::Triangle, 16, 16); // 2D Mesh
mesh.getConnectivity().compute(1, 2); ```
In general, this means that given a face, we are able to obtain the incident (neighboring) cells.
However, one can also compute any connectivity information on different dimensions. For example, for a mesh $\mathcal{T}_h \subset \mathbb{R}^d$, $d = 2$ of topological dimension $d$, we have:
```c++ // Compute connectivity between vertices and faces // i.e. Given a vertex, give me the incident edges mesh.getConnectivity().compute(0, 1);
// Compute connectivity between faces and cells // i.e. Given a vertex, give me the incident cells mesh.getConnectivity().compute(0, 2);
// Compute connectivity between faces // i.e. Given a face, give me the adjacent faces mesh.getConnectivity().compute(1, 1);
// Compute connectivity between cells // i.e. Given a cell, give me the adjacent cells mesh.getConnectivity().compute(2, 2);
// Compute connectivity between cells and faces // i.e. Given a cell, give me the adjacent faces mesh.getConnectivity().compute(2, 1);
// Etc. ```
Direct integration with Eigen solvers
Support for different finite elements
Support for different mesh and solution file formats
- MFEM
- MEDIT
Different quadrature formulae
Rodin supports different kinds of quadrature.
- Grundmann-Moeller
SubMesh support
Third-Party integrations
MMG
MMG is an open source software for bidimensional and tridimensional surface and volume remeshing.
Loading the mesh:
c++ MMG::Mesh Omega; Omega.load(meshFile, IO::FileFormat::MEDIT);Optimizing the mesh:
c++ MMG::Optimizer().setHMax(hmax) // maximal edge size .setHMin(hmin) // minimal edge size .setGradation(hgrad) // ratio between two edges .setHausdorff(hausd) // curvature refinement .optimize(Omega);
Roadmap
List of features and modules that are in the works:
- Discontinuous Galerkin methods
- Rodin::Plot module
- H1
- L2
- HDiv
- HCurl
- P2
- P0
- PETSc
- METIS
Requirements
Any of these should be available for quick install from your standard package manager.
CMake options
| Option | Description |
|------------------------|---------------------------------------------------|
| RODINBUILDEXAMPLES | Builds the examples in the examples/ directory. |
| RODINBUILDDOC | Builds the documentation using Doxygen |
| RODINUSEMCSS | Builds the documentation using Doxygen and m.css |
| RODINBUILDSRC | Build the Rodin source code |
| RODINBUILDEXAMPLES | Build the Rodin examples |
| RODINBUILDDOC | Build the Rodin documentation |
| RODINUSEMCSS | Use m.css style documentation |
| RODINWITHPLOT | Build the Rodin::Plot module |
| RODINUSEMPI | Build with MPI support |
| RODINUSEOPENMP | Build with OpenMP support |
| RODINUSESUITESPARSE | Build with SuiteSparse support |
| RODINSILENCEWARNINGS | Silence warnings outputted by Rodin |
| RODINBUILDPY | Build Python bindings |
Building the documentation
See this page to see how to build the documentation.
Owner
- Name: Carlos Brito-Pacheco
- Login: cbritopacheco
- Kind: user
- Location: France
- Repositories: 4
- Profile: https://github.com/cbritopacheco
GitHub Events
Total
- Create event: 11
- Commit comment event: 4
- Issues event: 1
- Watch event: 5
- Issue comment event: 33
- Push event: 521
- Pull request review event: 2
- Pull request review comment event: 13
- Pull request event: 18
- Fork event: 1
Last Year
- Create event: 11
- Commit comment event: 4
- Issues event: 1
- Watch event: 5
- Issue comment event: 33
- Push event: 521
- Pull request review event: 2
- Pull request review comment event: 13
- Pull request event: 18
- Fork event: 1
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 1
- Total pull requests: 15
- Average time to close issues: N/A
- Average time to close pull requests: 2 days
- Total issue authors: 1
- Total pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 0.87
- Merged pull requests: 7
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 12
- Average time to close issues: N/A
- Average time to close pull requests: 2 days
- Issue authors: 1
- Pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 1.08
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- cbritopacheco (1)
Pull Request Authors
- cbritopacheco (9)
- Copilot (6)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v2 composite
- platisd/duplicate-code-detection-tool master composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- peaceiris/actions-gh-pages v3 composite
- actions/labeler v4 composite
- Pygments *
- jinja2 *
- actions/checkout v2 composite
- benchmark-action/github-action-benchmark v1 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/upload-artifact v2 composite
- peaceiris/actions-gh-pages v3 composite
- ts-graphviz/setup-graphviz v1 composite
- actions/checkout v2 composite
- codecov/codecov-action v3 composite
