Skip to content
Snippets Groups Projects
user avatar
Marcel Koch authored
96cd5e74
History

dune-codegen

dune-codegen is an active research project with the goal of generating high-performance integration kernels for the Dune project.

It currently provides the following features:

  • Robust generation of integration kernels from the Unified Form Language (UFL) for use with dune-pdelab.
  • Integration of a code generation workflow into the Dune CMake build system
  • Code generation of DG methods exploiting finite element tensor product structure (sum factorization)
  • Code generation for block-structured FEM

pipeline status

Dependencies

dune-codegen currently depends on the following software packages:

Cloning and Patching

We use several submodules so you should clone with the --recursive option:

git clone --recursive ssh://git@gitlab.dune-project.org:22022/extensions/dune-codegen.git

or

git clone --recursive https://gitlab.dune-project.org/extensions/dune-codegen.git

If you have a feature branch feature/my-branch where you change the submodules of dune-codegen and you want to test your branch it makes sense to checkout this branch directly in a fresh clone:

git clone --recursive -b feature/my-branch ssh://git@gitlab.dune-project.org:22022/dominic/dune-codegen.git

Some tests compare the vtkoutput to a reference vtk output. If you want to have all tests passing you need to install git-lfs before cloning. Cloning via ssh and using a ssh-agent are recommended in this case:

ssh-add
git clone --recursive ssh://git@gitlab.dune-project.org:22022/dominic/dune-codegen.git

After cloning dune-codegen you need apply some patches:

  • Go to the base folder of dune-codegen and run patches/apply_patches.sh. This applies patches to the submodules.

    cd dune-codegen/
    ./patches/apply_patches.sh

Building dune-codegen

Building dune-codegen is done through the Dune build-system using cmake. See the Dune homepage for further details. You need to set the options

-DDUNE_PYTHON_ALLOW_GET_PIP=1
-DDUNE_PYTHON_VIRTUALENV_SETUP=1

in your options file. Your options file could for example look like the following:

CMAKE_FLAGS="
  -DDUNE_PYTHON_FORCE_PYTHON3=1
  -DDUNE_PYTHON_ALLOW_GET_PIP=1
  -DDUNE_PYTHON_VIRTUALENV_SETUP=1
  -DCMAKE_BUILD_TYPE=Release
  -DCMAKE_CXX_FLAGS='-march=native -ffast-math'
  -DDUNE_SYMLINK_TO_SOURCE_TREE=1
"

MAKE_FLAGS="-j2"

Building and Running the Tests

You can build and run the tests via:

cd path/to/dune-codegen/build/directory
make build_tests
ctest

Note that this takes quite a while.

Links