Source code for our paper "Higher-order finite elements for embedded simulation"

Overview

Higher-order Finite Elements for Embedded Simulation

This repository contains the source code used to produce the results for our paper:

Longva, A., Löschner, F., Kugelstadt, T., Fernández-Fernández, J.A. and Bender, J., 2020. Higher-order finite elements for embedded simulation. ACM Transactions on Graphics (TOG), 39(6), pp.1-14.

Please also see the entry on our website for access to the paper, the supplemental document, video and more.

Teaser image from paper

Important information

The code provided here is almost entirely unchanged from the code used to generate the results demonstrated in the paper. After publication, we have discovered a couple of mistakes that we detail in our errata. The code has deliberately not been updated to account for these mistakes.

The code is provided only for the sake of giving researchers the ability to reproduce our results. It is not intended to serve as a base for building your own project on top of. The published code is the result of violently ripping out only the relevant parts from a yet larger code base used for multiple papers. Having grown organically it is generally overly complex and unwieldy. We are actively working on redesigning, cleaning up, documenting and packaging some of the core functionality as reusable libraries. The FEM portion of the code is currently in the process of being redesigned and repackaged as the standalone Fenris FEM library.

If you have issues, questions or comments, please feel free to contact Andreas (first author) directly, or write up an issue here on the GitHub tracker.

Build instructions

The code is written in the Rust programming language.

Although Rust comes with an excellent automated build system, our code relies on a couple of libraries that need to be installed separately:

  • Intel MKL (tested with Intel MKL 2020)
  • libclang (required for automatically generating bindings to MKL)
  • Google OR Tools (required for Simplex solver, tested with version 7.7)

The code should generally work on any of the common platforms (Linux, Windows, Mac), but it has been tested most extensively on Linux (and not at all on Mac).

In order to make this repository stand-alone, we have bundled the libraries mkl-sys and mkl-corrode, that were not available on the central Rust dependency repository crates.io into the extern/ folder of this repositroy.

Once you have installed Rust and the required dependencies (see below for more details), you can build the project by invoking cargo (Rust package manager) from the root of this repository:

cargo build --release

This will download and build the required Rust dependencies (of which there are many).

Running experiments

In order to run the experiments, you will need to download the binary archive assets.zip containing the asset files (meshes etc.) made available through GitHub releases. Unzip the archive into the root directory, which should give you an assets/ folder.

The easiest way to run experiments is to run the provided Python wrapper files in the experiments folder. For example, to run the "Cylinder shell" example (referred to as "hollow cylinder" in our paper), invoke the corresponding Python script from the project root directory:

python experiments/cylinder_shell/run_experiments.py

This will (re-)compile the code and run the experiment for a number of configurations (mesh resolution, element order, FEM vs. FCM etc.). You might want to check out the Python file and make some adjustments. This process will produce a large amount of output in the experiment-specific data directory (see Python script for output directory), including log files, VTK files for analysis in Paraview and PLY surface meshes that can be used for rendering.

NB! We are sadly not permitted to directly redistribute the mesh data for the "Hollow Ball" scene due to licensing restrictions. See assets/meshes/hollow_ball/README for more information.

Additionally, instead of running the Python scripts (which are not available for every experiment), you can explore the scenes provided in the binary itself by running:

# Produces the help text for the scene runner binary
cargo run --release -- --help

# Produces a list of available scenes
cargo run --release -- --list-scenes

# Run a specific scene
cargo run --release -- --scene bicycle_fem_fine

Installing external dependencies

Intel MKL

Recently, Intel rebranded its MKL library as oneMKL. We used Intel MKL 2020 for our experiments, but we believe it should also work with the more recent oneMKL versions.

Install the library as described by the (one)MKL documentation. Our code looks for the MKLROOT environment variable. This environment variable gets automatically set if you run the configuration script provided alongside MKL. For example, on Linux:

source /path/to/intel/mkl/bin/mklvars.sh intel64

LLVM / libclang

Follow the instructions provided for the bindgen project, which is used by the mkl-sys library to automatically generate usable Rust bindings from the MKL C headers.

Google OR Tools

Download the binary OR-Tools distribution and set the the ORTOOLS_ROOT environment variable to the root directory of the OR Tools installation. In addition, you need to add the OR Tools libraries to the linker library search paths. On Linux, this might look like:

export ORTOOLS_ROOT=/path/to/or-tools-7.7.810
export LD_LIBRARY_PATH=$ORTOOLS_ROOT/lib:$LD_LIBRARY_PATH

License

The Rust source code provided in this repository (with the exception of code in extern/, which is separately licensed) is licensed under the MIT license. See LICENSE for details.

Dependencies are licensed under their own respective licenses. Please see assets/README for information about license terms for the meshes we use.

You might also like...
Cloc - cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.

cloc Count Lines of Code cloc counts blank lines, comment lines, and physical lines of source code in many programming languages. Latest release: v1.9

A tool to decompile MSVC PDB files to C++ source code.

PDB Decompiler About Usage Contributing About A tool to decompile MSVC PDB files to C++ source code. This tool is a work in progress and will most lik

ripsecrets is a command-line tool to prevent committing secret keys into your source code.

ripsecrets is a command-line tool to prevent committing secret keys into your source code. ripsecrets has a few features that distinguish it from other secret scanning tools:

it aims to augment git with primitives to build integrated, cryptographically verifiable collaboration workflows around source code

it aims to augment git with primitives to build integrated, cryptographically verifiable collaboration workflows around source code. It maintains the distributed property of git, not requiring a central server. it is transport agnostic, and permits data dissemination in client-server, federated, as well as peer-to-peer network topologies.

The source code of the 'rg' crate. It is an intentional typo-squat that redirects folks to 'ripgrep'.

This is the rg crate that always fails to compile and suggests that folks run cargo install ripgrep instead. Namely, while rg is the command name of r

Downloads and provides debug symbols and source code for nix derivations to gdb and other debuginfod-capable debuggers as needed.

nixseparatedebuginfod Downloads and provides debug symbols and source code for nix derivations to gdb and other debuginfod-capable debuggers as needed

Demo app duplicated in 5 languages (Go/JavaScript/Python/Ruby/Rust) showing how to go from source code to container image using melange+apko

hello-melange-apko 💫 This repo contains an example app duplicated across 5 languages showing how to: Package source code into APKs using melange Buil

Write simple proc-macros inline with other source code.

script-macro An experimental way to write simple proc-macros inline with other source code. Did you ever end up getting frustrated at the boilerplate

Original source code for Practical Rust Projects 2nd ed. by Shing Lyu and Andrew Rzeznik

Apress Source Code This repository accompanies Practical Rust Projects 2nd ed. by Shing Lyu and Andrew Rzeznik (Apress, 2023). Download the files as a

Releases(initial_release)
Owner
Interactive Computer Graphics
Interactive Computer Graphics
All the code for our PWS.

PWS Code All the code for our PWS. The research question of our PWS is: What optimization method for a dynamic fluid computer simulation using the SPH

IllicitPrism 2 Dec 15, 2022
An implementation of Joshua Yanovski's Ghost Cell paper.

A novel safe and zero-cost borrow-checking paradigm from the GhostCell paper. Motivation A number of collections, such as linked-lists, binary-trees,

null 350 Dec 22, 2022
A command line application which sets your wall paper with new image generating pollens once they arrive.

pollenwall Table of Contents pollenwall About Installation Binary releases Build from source Usage Command Line Arguments Running as a service MacOS L

Pollinations.AI 2 Jan 7, 2022
An Rust implementation of the Modified Merkle Patricia Tree described by ETH Yellow Paper

Merkle Patricia Tree的Rust实现 博客文章:https://dere.press/2022/01/24/eth-trie/ 本实现参考下列项目: https://ethereum.github.io/yellowpaper/paper.pdf https://github.co

M4tsuri 3 Dec 13, 2022
Play videos on IT8951-controlled e-paper displays

it8951-video Play videos on IT8951-controlled e-paper displays via USB. This has been tested with a Waveshare 7.8inch e-Paper HAT display. Design This

Andreas Dzialocha 4 Nov 28, 2022
ratlab is a programming platform designed loosely for hobbyist and masochist to analyse and design stuff and things that transform our world?

ratlab A programming language developed by Quinn Horton and Jay Hunter. ratlab is a programming platform designed loosely for hobbyists and masochists

Jay 10 Sep 4, 2023
Code-shape is a tool for extracting definitions from source code files

Code-shape Code-shape is a tool that uses Tree-sitter to extract a shape of code definitions from a source code file. The tool uses the same language

Andrew Hlynskyi 3 Apr 21, 2023
H2O Open Source Kubernetes operator and a command-line tool to ease deployment (and undeployment) of H2O open-source machine learning platform H2O-3 to Kubernetes.

H2O Kubernetes Repository with official tools to aid the deployment of H2O Machine Learning platform to Kubernetes. There are two essential tools to b

H2O.ai 16 Nov 12, 2022
Tmux - tmux source code

Welcome to tmux! tmux is a terminal multiplexer: it enables a number of terminals to be created, accessed, and controlled from a single screen. tmux m

tmux 27.3k Jan 9, 2023
Cargo-eval - A cargo plugin to quickly evaluate some Rust source code.

cargo eval A cargo plugin to quickly evaluate some Rust source code. Installation $ cargo install --git https://github.com/timClicks/cargo-eval.git Us

Tim McNamara 9 Dec 21, 2022