CUMIN
CUMIN: Curved Meshes In Numerical simulations
Author
Charles Pierre

CUMIN is a finite element library including

  • finite elements of high order,
  • curved geometries: meshes of high geometrical order,
  • solvers for diffusion and linear elasticity PDEs,
  • coupling with linear system solvers and eigenvalue problem solvers.

Language: modern Fortran

  • API documentation:

CUMIN also includes the package CHORAL: Cardiac electrophysiology High Order Algorithms:

  • solvers for parabolic semilinear equations coupled to ODE systems
  • high order stabilised time stepping methods.

SOME ILLUSTRATIONS

Poisson problem on a sphere.

\( ~~~~~~~~~~-~~~ {\large \Delta_B u + u= f \qquad {\rm on} \quad \Omega}\)

  • Quadratic mesh of the unit sphere \(\Omega\) with 47 curved triangles,
  • \( P^3 \) finite element,
  • \( \Delta_B \) the Laplace Beltrami operator
  • A posteriori error \( \| u - u_h^l \|_{{\rm L}^2(\Omega)} = 0.02 \),
    using a lift \(u_h^l\) of the numerical solution \(u_h\) on the sphere.

Poisson problem on a disk with 2nd order boundary conditions.

\( \quad\quad\quad\quad {\large \displaystyle{ \begin{array}{lcl} -\Delta u = f \quad & {\rm on}\quad & \Omega \\ -\Delta_B u + \nabla u\cdot n + u= g \quad & {\rm on}\quad & \partial\Omega \end{array} } }\)

  • Quadratic mesh of the unit disk \(\Omega\) with 15 curved triangles,
  • \( P^3 \) finite element,
  • A posteriori error \( \| u - u_h^l \|_{{\rm L}^2(\Omega)} = 4.1E-3 \),
    using a lift \(u_h^l\) of the numerical solution \(u_h\) on the disk.

Laplace eignefunction on a torus.

\( ~~~~~~~~~~-~~~ {\large \Delta_B u = \lambda u \qquad {\rm on} \quad \Omega}\)

  • Quadratic mesh of a torus \(\Omega\)
  • \( P^3 \) finite element,

Spiral wave with the monodomain model (arising in cardiac electrophysiology).

1 INSTALLATION

  • Get the sources
  • Installation requires make and cmake
  1. Move to your project directory and configure with
    cd your_cumin_dir && mkdir build && cd build
    cmake ..
  2. Build with
    make all
  3. Test with
    ctest
  4. Defince your installation directory and install with
    cmake .. -DCMAKE_INSTALL_PREFIX=your_install_dir
    make install

1.1 Configuration variables

Configuration variables are set to default values, they can be modified wirh

ccmake ..
Variable Desscription Default
DEBUG Level of debug 0
REAL_PRECISION Real precision 8
INTEG_TESTS Run integration tests OFF
INTEG_TESTS_3D Run 3D integration tests OFF
COMPIL_APPS Compile applications OFF
USER_PREFIX_PATH User path to dependencies ${HOME}

1.2 Dependances

Dependance
OpenMP Shared memory parallelism
Blas/lapack
Arpack Eigenvalue problem solver
SCOTCH Graph reordering
MUMPS Direct linear system solver
GMSH Meshing and visualisation
MMG Remeshining
  • Cumin dependances are searched when configuring, if not found they are disabled.
    Without any dependencies, you still can install, run the unit tests (tutorial examples and integration tests require GMSH).
  • You can turn-off any dependance using ccmake ...
  • Some dependancies are not available when REAL_PRECISION is not set to 8.
  • If not found, you may update your installation general directory

    cmake .. -DUSER_PREFIX_PATH=your_dependancies_install_dir

    which can also be set using ccmake.

  • More specifically, each dependance has its own installation directory variable, which can be set with (fer e.g. MUMPS)

    cmake .. -DDIR_MUMPS=your_MUMPS_install_dir

    which procedure can also be done using ccmake in advanced mode.

2 TUTORIAL EXAMPLES

  • Tutorial examples are provided in the directory _/examples_ and _/examples/choral_.
  • Try e.g.

    cd build
    make poisson_2d_Neumann_0_expl
    ./examples/poisson_2d_Neumann_0_expl

    that compiles and executes the program poisson_2d_Neumann_0_exp.F90 which solves a Poisson problem and visualises its solution.

  • Tutorial examples are documented in the API documentation .

3 UTILISATION

  • To use the cumin library, your fortran codes should look like this:
    program my_program
    use cumin
    ...
  • Linking at compilation is handled with cmake as follows.
    1. In your own project directory, copy the following lines to your CMakeLists.txt:
      set(CUMIN_INSTALL_DIR "your_cumin_install_dir" CACHE STRING "")
      if(EXISTS "${CUMIN_INSTALL_DIR}/Findcumin.cmake")
      list(APPEND CMAKE_MODULE_PATH ${CUMIN_INSTALL_DIR})
      find_package(cumin)
      else()
      message(FATAL_ERROR "Not found: Findcumin.cmake, reset 'CUMIN_INSTALL_DIR'")
      endif()
    2. create a target for your code and link it with cumin:
      add_executable(target_name program_name.F90)
      target_link_libraries(target_name cumin)
    3. compilation is then done as usual with
      make target_name

4 INSTALLATION WITH GUIX

You can avoid to install the dependances using the guix environment. Guix moreover guarantees fully reproducable results.
For this you first need to: , then:

  • update your guix deposit,
    guix pull
  • open the following guix shell for cumin installation,
    guix shell --pure arpack-ng mumps openmpi scotch32 mmg mmg:lib gmsh make cmake gcc-toolchain gfortran-toolchain coreutils sed doxygen -- /bin/bash --norc
  • configure, build and install with,
    cd your_cumin_dir && mkdir build && cd build
    cmake ..
    make all install












cumin
TOP-LEVEL MODULE for the 'cumin' project.
Definition: cumin.F90:9