Skip to content

Getting started

William Jussiau edited this page May 7, 2025 · 27 revisions

Installation 🛠️

conda

The conda environment required to run the code can be extracted from the file environment.yml.

The environment file should look like this:

name: fenics
channels:
  - conda-forge
  - defaults
dependencies:
  - python=3.12.8
  - fenics=2019.1.0
  - meshio=5.3.5
  - scipy=1.14.1
  - pandas=2.2.3
  - control=0.10.1

It is important that python is installed with a version >=3.10 because dataclasses are being used. Also, it is important that the latest version of fenics is used (namely 2019.1.0).

The folders flowcontrol and utils in the root folder should be appended to Python module path, for example with conda develop or directly creating a conda.pth file in your environment site-packages.

Additional path tweaking is sometines required for FEniCS to be found through the dolfin module.

Docker 🐳

[coming soon]

Run examples

After the conda environment has been set-up correctly, you can test the installation from a Python terminal:

  1. Try importing FEniCS with import dolfin
  2. Run examples from the examples folder:
  • examples/cylinder/cylinderflowsolver.py and examples/cavity/cavityflowsolver.py (or the corresponding files run_*.py) with Python for time simulations,
  • mpitest/demo_poisson.py with MPI (e.g. mpirun -np 2 demo_poisson.py) to check that the parallel tools are running smoothly.

Clone this wiki locally