precice / fenics-adapter

preCICE-adapter for the open source computing platform FEniCS
GNU Lesser General Public License v3.0
29 stars 15 forks source link
conjugate-heat-transfer fenics heat-transfer multi-physics precice precice-adapter

FEniCS-preCICE adapter

GNU LGPL license

DOI

Build and Test

Run preCICE Tutorials

Upload Python Package

preCICE-adapter for the open source computing platform FEniCS.

Installing the package

Using pip3 to install from PyPI

It is recommended to install fenicsprecice from PyPI via

pip3 install fenicsprecice

For more recent pip versions you may encounter the error error: externally-managed-environment during installation of the fenicsprecice. You can read why here. In this case, it is recommended to create a virtual environment and install the package in the virtual environment. The following commands will create the virtual environment venv_name at the location path/of/your/venv/:

python3 -m venv --system-site-packages path/of/your/venv/venv_name
. path/of/your/venv/venv_name/bin/activate

You can replace path/of/your/venv/venv_name with the location and name you want to use for your virtual environment. The command --system-size-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.

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 pip3

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 pip3 install --user . 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 python3 setup.py test.

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:

python3 -m unittest tests.test_write_read.TestWriteandReadData.test_vector_write

Troubleshooting

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

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.