Skip to main content

FEniCS-preCICE adapter

GNU LGPL license DOI Build and Test Run preCICE Tutorials Upload Package

preCICE-adapter for the open source computing platform FEniCS.

Installing the package

Generally, we recommend to create a virtual environment and install the package there. The following commands will create the virtual environment .venv:

python3 -m venv --system-site-packages .venv
. .venv/bin/activate

You can replace .venv with path/of/your/venv/venv_name if you want to create the virtual environment somewhere else. The command --system-site-packages will allow the virtual environment to access the FEniCS installation on your system. Refer to the Python documentation for further details on virtual environments.

If you do not want to use a virtual environment, you might encounter the error: externally-managed-environment during installation of the adapter; this depends on your pip version and operating system. You can read why this error shows up in the documentation.

Using pip to install from PyPI

It is recommended to install fenicsprecice from PyPI via

pip install fenicsprecice

This should work out of the box, if all dependencies are installed correctly. If you face problems during installation or you want to run the tests, see below for a list of dependencies and alternative installation procedures

Clone this repository and use pip

Required dependencies

Make sure to install the following dependencies:

Build and install the adapter

After cloning this repository and switching to the root directory (fenics-adapter), run pip install . from your shell.

Test the adapter

As a first test, try to import the adapter via python3 -c "import fenicsprecice".

You can run the other tests via tox. If you want to run them separately, use tox -e unit and tox -e integration respectively.

Single tests can be also be run. For example the test test_vector_write in the file test_write_read.py can be run as follows:

tox -e all -- tests/integration/test_write_read.py::TestWriteandReadData::test_vector_write

Troubleshooting

FEniCS is suddenly broken: There are two known issues with preCICE, fenicsprecice and FEniCS:

  • If you see ImportError: cannot import name 'sub_forms_by_domain' run pip3 uninstall -y fenics-ufl. For details, refer to issue #103.
  • If you see ImportError: cannot import name 'cellname2facetname' from 'ufl.cell', refer to issue #154.
  • If you see ModuleNotFoundError: No module named 'dolfin' and have installed PETSc from source, refer to this forum post. Short version: Try to use the PETSc that comes with your system, if possible. Note that you can also compile preCICE without PETSc, if necessary.

If this does not help, you can contact us on gitter or open an issue.

Use the adapter

Please refer to our website.

Packaging

To create and install the fenicsprecice Python package the following instructions were used: "How To Package Your Python Code" from python-packaging.readthedocs.io.

Citing

Development history

The initial version of this adapter was developed by Benjamin Rodenberg during his research stay at Lund University in the group for Numerical Analysis (Philipp Birken) in close collaboration with Peter Meisrimel.

Richard Hertrich contributed the possibility to perform FSI simulations using the adapter in his Bachelor thesis.

Ishaan Desai improved the user interface and extended the adapter to allow for parallel FEniCS computations and 3D cases in certain scenarios.

Metadata

Release files for fenicsprecice 2.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fenicsprecice 2.3.1
File Size Uploaded
fenicsprecice-2.3.1.tar.gz 29.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fenicsprecice 2.3.1
File Interpreter ABI Platform
fenicsprecice-2.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 58.5 kB

Release files / fenicsprecice-2.3.1.tar.gz

Download URL fenicsprecice-2.3.1.tar.gz
Size 29.1 kB
Tags Source
SHA-256 checksum
How to use checksums
65c55bf40cd714c05cec28c5255fe0d6c6713a386de8acabe3e9070b61a2116f
BLAKE2b-256 checksum
How to use checksums
20feb19c07aa7b69cdd28f674a831345950b5d56d25c975bf2a1f1d4713bcab2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / fenicsprecice-2.3.1-py3-none-any.whl

Download URL fenicsprecice-2.3.1-py3-none-any.whl
Size 29.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98a24c758de8df50885677603074e29f2a526efba6ccc44c0975441caf59934b
BLAKE2b-256 checksum
How to use checksums
d0b586bfa8310588f6e187151c6203a2daf99d6c07e53da8bae610d1068d5249
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page