A library for advanced finite element computations in Rust

Overview

Fenris logo

A Rust library for building advanced applications with the Finite Element Method (FEM).

Although developed with a special emphasis on solid mechanics in computer graphics, Fenris is a highly generic and versatile library applicable to many other domains.

Status

As of October 2021, Fenris is heavily developed alongside several of our ongoing academic projects, with the overarching goal of supporting our research efforts.

Our goal is to rework, document and polish the library for external users during 2022. In its current state, Fenris is not recommended for general usage. We currently offer no API stability whatsoever, the documentation is severely lacking, and only parts of the library has been extensively tested. Moreover, some parts of the library will likely be removed altogether in future versions.

Goals

With Fenris, we aim to provide an open-source, composable, flexible and performant library for advanced finite element computations in Rust.

Fenris is intended primarily as an alternative to C++ FEM libraries. With Fenris, users can take advantage of the significant productivity boost afforded by working with Rust, a modern programming language with a best-in-class dependency management system and a revolutionary model for memory-safe, high-performance system programming.

This statement is motivated by our own experiences writing FEM code in Rust: gone are the hours upon hours of wrestling with CMake to integrate an external library. Furthermore, the expressive type system and borrow checker model employed by Rust encourages good designs that are free of the myriads of footguns associated with (even modern) C++. And perhaps even more important, the excellent generic trait system found in Rust - which importantly is type-checked at compile time - allows us to write highly generic code with explicit invariants encoded in the type system that are automatically and correctly represented in the generated documentation.

In short, we have found that Rust allows us to spend more time on solving interesting and complex problems (the fun part), and less time on dealing with auxiliary issues largely caused by language deficiencies (the annoying part).

Summary of technical goals

  • Provide a number of low-order and high-order standard Lagrange elements of a variety of geometric shapes in 2D and 3D (at the very least triangles, quadrilaterals, tetrahedra and hexahedra).
  • High-performance shared-memory parallelism for assembly.
  • A composable architecture: Higher-level functionality is built by the composition of lower-level functionality. Users choose the level at which they need to work at.
  • Facilitates generic programming: write code once and have it work across a number of different elements, dimensions and operators.
  • Convent I/O, currently in the form of export to VTK/VTU for visualization in ParaView.

Non-goals

  • Fenris is not intended to compete with the likes of FEniCS or similar libraries that let users provide high-level weak formulations of PDEs. In contrast, Fenris targets users who need lower-level functionality, and is perhaps more comparable to the likes of deal.II.
  • Fenris by itself provides no functionality for solving (non-)linear systems, only the functionality for assembling (as scalars/vectors/matrices) and applying discrete operators.
  • We have no plans for supporting distributed computing or GPU acceleration at this time.

Publications

An older incarnation of Fenris was used for the code associated with the following academic papers:

  • Longva, A., Löschner, F., Kugelstadt, T., Fernández-Fernández, J. A., & Bender, J. (2020). Higher-order finite elements for embedded simulation. ACM Transactions on Graphics (TOG), 39(6), 1-14.
  • Löschner, F., Longva, A., Jeske, S., Kugelstadt, T., & Bender, J. (2020).
    Higher‐Order Time Integration for Deformable Solids. In Computer Graphics Forum (Vol. 39, No. 8, pp. 157-169).

Contribution

Apart from minor bug fixes or changes, we do not accept source code contributions at this time. We would however be happy for daring users who want to try out our library to report issues on our issue tracker.

We have a number of unrealized plans that will require significant reworking of parts of the library. Once the library is in a more stable state we will be grateful for contributions from the community.

License

Fenris is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See LICENSE-APACHE and LICENSE-MIT for details. Opening a pull requests is assumed to signal agreement with these licensing terms.

Comments
  • Fix deprecation warnings in Actions workflow

    Fix deprecation warnings in Actions workflow

    The Actions workflows produce several deprecation warnings. This PR fixes them.

    • Update actions/checkout@v2 and actions/cache@v2 to v3
    • Replace unmaintained actions-rs/toolchain@v1 with dtolnay/rust-toolchain
    opened by w1th0utnam3 2
  • Implement VectorParAssembler

    Implement VectorParAssembler

    This PR mainly

    • refactors color_nodes to use &FiniteElementConnectivity + ?Sized instead of &[Connectivity]
    • renames SerialVectorAssembler to VectorAssembler
    • implements VectorParAssembler
    • adds assert_eq checks to the convergence tests to compare the results of the serial and parallel assemblers

    The interface of the VectorParAssembler is currently only

    impl<T: RealField> VectorParAssembler<T> {
        pub fn assemble_vector_into<'a>(
            &self,
            output: impl Into<DVectorSliceMut<'a, T>>,
            colors: &[DisjointSubsets],
            element_assembler: &(impl ElementVectorAssembler<T> + ?Sized + Sync),
        ) -> eyre::Result<()>;
    }
    
    opened by w1th0utnam3 2
  • Set VTK file format version depending on extension

    Set VTK file format version depending on extension

    Sets the VTK file format Version in FiniteElementMeshDataSetBuilder::try_export depending on the used file extension (.vtu or .vtk) to fix warnings shown by Paraview.

    Workaround for vtkio issue https://github.com/elrnv/vtkio/issues/12

    opened by w1th0utnam3 1
  • Update nalgebra to 0.31

    Update nalgebra to 0.31

    nalgebra 0.29 removed the Copy requirement for RealField types. For now, we work around this by introducing a fenris-traits crate with a trait alias Real: RealField + Copy. Long term there should be some more sweeping reforms of traits in nalgebra, which is why we postpone removing the Copy bound in our code for now.

    opened by Andlon 0
  • WIP: Interpolation API

    WIP: Interpolation API

    Revamps the space, integrate and error modules to support interpolation at arbitrary points. This can further be used as a proxy for the ground truth in error estimation, since it's possible to turn a finite element space along with interpolation weights into a function $u(x)$ (and $\nabla u(x)$ ).

    opened by Andlon 1
Owner
Interactive Computer Graphics
Interactive Computer Graphics
A library to compile USDT probes into a Rust library

sonde sonde is a library to compile USDT probes into a Rust library, and to generate a friendly Rust idiomatic API around it. Userland Statically Defi

Ivan Enderlin 40 Jan 7, 2023
A Rust library for calculating sun positions

sun A rust port of the JS library suncalc. Install Add the following to your Cargo.toml [dependencies] sun = "0.2" Usage pub fn main() { let unixti

Markus Kohlhase 36 Dec 28, 2022
A cross-platform serial port library in Rust.

Introduction serialport-rs is a general-purpose cross-platform serial port library for Rust. It provides a blocking I/O interface and port enumeration

Bryant Mairs 143 Nov 5, 2021
A high level diffing library for rust based on diffs

Similar: A Diffing Library Similar is a dependency free crate for Rust that implements different diffing algorithms and high level interfaces for it.

Armin Ronacher 617 Dec 30, 2022
A reactive DOM library for Rust in WASM

maple A VDOM-less web library with fine-grained reactivity. Getting started The recommended build tool is Trunk. Start by adding maple-core to your Ca

Luke Chu 1.8k Jan 3, 2023
transmute-free Rust library to work with the Arrow format

Arrow2: Transmute-free Arrow This repository contains a Rust library to work with the Arrow format. It is a re-write of the official Arrow crate using

Jorge Leitao 708 Dec 30, 2022
Cross-platform Window library in Rust for Tauri. [WIP]

Cross-platform application window creation library in Rust that supports all major platforms like Windows, macOS, Linux, iOS and Android. Built for you, maintained for Tauri.

Tauri 899 Jan 1, 2023
A library in Rust for theorem proving with Intuitionistic Propositional Logic.

Prop Propositional logic with types in Rust. A library in Rust for theorem proving with Intuitionistic Propositional Logic. Supports theorem proving i

AdvancedResearch 48 Jan 3, 2023
A Rust library for constructing tilings of regular polygons

tiling tiling is a library for constructing tilings of regular polygons and their dual tilings. Resources Documentation Tilings by regular polygons Li

Jonas Michel 29 Sep 30, 2021
miette is a diagnostic library for Rust. It includes a series of traits/protocols that allow you to hook into its error reporting facilities, and even write your own error reports!

miette is a diagnostic library for Rust. It includes a series of traits/protocols that allow you to hook into its error reporting facilities, and even write your own error reports!

Kat Marchán 1.2k Jan 1, 2023
Generative arts library in Rust

Generative Generative (WIP) is 2D generational arts creation library written in Rust. Currently it is in nascent stage and is somewhat unstable. Examp

Gaurav Patel 22 May 13, 2022
Membrane is an opinionated crate that generates a Dart package from a Rust library. Extremely fast performance with strict typing and zero copy returns over the FFI boundary via bincode.

Membrane is an opinionated crate that generates a Dart package from a Rust library. Extremely fast performance with strict typing and zero copy returns over the FFI boundary via bincode.

Jerel Unruh 70 Dec 13, 2022
Stack unwinding library in Rust

Unwinding library in Rust and for Rust This library serves two purposes: Provide a pure Rust alternative to libgcc_eh or libunwind. Provide easier unw

Gary Guo 51 Nov 4, 2022
Easy to use Rust i18n library based on code generation

rosetta-i18n rosetta-i18n is an easy-to-use and opinionated Rust internationalization (i18n) library powered by code generation. rosetta_i18n::include

null 38 Dec 18, 2022
Mononym is a library for creating unique type-level names for each value in Rust.

Mononym is a library for creating unique type-level names for each value in Rust.

MaybeVoid 52 Dec 16, 2022
tiny_id is a Rust library for generating non-sequential, tightly-packed short IDs.

tiny_id tiny_id is a Rust library for generating non-sequential, tightly-packed short IDs. Most other short ID generators just string together random

Paul Butler 33 Aug 6, 2022
islam is an Islamic library for Rust.

islam is an Islamic library for Rust. It is a direct port of PyIslam with a slight change in the API part.

azzamsa 8 Dec 31, 2022
A Rust library for managing eBPF programs.

oxidebpf oxidebpf is a permissive licensed Rust library for managing eBPF programs. Motivation The motivation behind oxidebpf is to create a permissiv

Red Canary 92 Jan 1, 2023
A rust library that makes reading and writing memory of the Dolphin emulator easier.

dolphin-memory-rs A crate for reading from and writing to the emulated memory of Dolphin in rust. A lot of internals here are directly based on aldela

Madison Barry 4 Jul 19, 2022