rodin

Modern C++20 finite element method and shape optimization framework.

https://github.com/cbritopacheco/rodin

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

c-plus-plus cpp fem finite-element-analysis finite-element-methods form-language mesh multiphysics partial-differential-equations pde pde-solver rodin rodin-fem shape-optimization topology-optimization
Last synced: 6 months ago · JSON representation

Repository

Modern C++20 finite element method and shape optimization framework.

Basic Info
Statistics
  • Stars: 51
  • Watchers: 2
  • Forks: 9
  • Open Issues: 0
  • Releases: 0
Topics
c-plus-plus cpp fem finite-element-analysis finite-element-methods form-language mesh multiphysics partial-differential-equations pde pde-solver rodin rodin-fem shape-optimization topology-optimization
Created over 4 years ago · Last pushed 6 months ago
Metadata Files
Readme Funding License Citation Codeowners

README.md

Rodin

Rodin License

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 | Build | Tests | codecov | Benchmarks | Documentation | | develop | Build | Tests | codecov | Benchmarks | Documentation |

Table of Contents

  1. Building the project
  2. Features
  3. Third-Party integrations
  4. Requirements
  5. CMake options
  6. 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; } ```

poisson.png
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

See here for the full list.

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

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
variational (7) examples (7) geometry (6) form-language (6) math (6) utility (5) qf (5) unit-tests (5) solver (4) plot (4) context (4) io (4) docs (3) alerts (2) benchmarks (2) mmg (2) cmake (1)

Dependencies

.github/workflows/Build.yml actions
  • actions/checkout v2 composite
.github/workflows/DCC.yml actions
  • platisd/duplicate-code-detection-tool master composite
.github/workflows/Documentation.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • peaceiris/actions-gh-pages v3 composite
.github/workflows/Labeler.yml actions
  • actions/labeler v4 composite
doc/requirements.txt pypi
  • Pygments *
  • jinja2 *
.github/workflows/Benchmarks.yml actions
  • actions/checkout v2 composite
  • benchmark-action/github-action-benchmark v1 composite
.github/workflows/StaticAnalysis.yml actions
  • 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
.github/workflows/Tests.yml actions
  • actions/checkout v2 composite
  • codecov/codecov-action v3 composite
pyproject.toml pypi
setup.py pypi