Skip to content

Commit

Permalink
Merge pull request #167 from precice/fenics-adapter-v2.0.0
Browse files Browse the repository at this point in the history
Release v2.0.0
  • Loading branch information
BenjaminRodenberg authored Feb 12, 2024
2 parents 9aa3e22 + 47dc07e commit 8b76fe2
Show file tree
Hide file tree
Showing 21 changed files with 1,316 additions and 722 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: |
mkdir -p precice
echo "from setuptools import setup" >> precice/setup.py
echo "setup(name='pyprecice', version='2.0.2.1')" >> precice/setup.py
echo "setup(name='pyprecice', version='3.0.0.0')" >> precice/setup.py
python3 -m pip install ./precice/
- name: Run unit tests
run: python3 setup.py test -s tests.unit
Expand Down
39 changes: 33 additions & 6 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
name: Update docker image

on:
workflow_dispatch: # Trigger by hand from the UI
workflow_dispatch: # Trigger by hand from the UI
inputs:
branch:
type: choice
description: branch to build the container from
options:
- develop
- master
push:
branches:
- develop
- master

jobs:
build-and-release-docker-image:
Expand All @@ -13,10 +21,28 @@ jobs:
env:
docker_username: precice
steps:
- name: Get branch name
if: github.event_name != 'pull_request'
- name: Set branch name for manual triggering
if: github.event_name == 'workflow_dispatch'
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
run: |
echo "ADAPTER_REF=${{ inputs.branch }}" >> $GITHUB_ENV
- name: Set branch name for on pull triggering
if: github.event_name != 'pull_request' && github.event_name != 'workflow_dispatch'
shell: bash
run: |
echo "ADAPTER_REF=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Set PYTHON_BINDINGS_REF and the TAG depending on branch
shell: bash
run: |
if [[ '${{ env.ADAPTER_REF }}' == 'master' ]]; then
echo "PYTHON_BINDINGS_REF=latest" >> "$GITHUB_ENV"
echo "TAG=latest" >> "$GITHUB_ENV"
echo "Building TAG: latest"
else
echo "PYTHON_BINDINGS_REF=${{ env.ADAPTER_REF }}" >> "$GITHUB_ENV"
echo "TAG=${{ env.ADAPTER_REF }}" >> "$GITHUB_ENV"
echo "Building TAG: ${{ env.ADAPTER_REF }}"
fi
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
Expand All @@ -31,6 +57,7 @@ jobs:
with:
push: true
file: "./tools/releasing/packaging/docker/Dockerfile"
tags: ${{ env.docker_username }}/fenics-adapter:${{ env.branch }},${{ env.docker_username }}/fenics-adapter:latest
tags: ${{ env.docker_username }}/fenics-adapter:${{ env.TAG }}
build-args: |
branch=${{ env.branch }}
FENICS_ADAPTER_REF=${{ env.ADAPTER_REF }}
PYTHON_BINDINGS_REF=${{ env.PYTHON_BINDINGS_REF }}
4 changes: 2 additions & 2 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist
twine upload dist/*
24 changes: 12 additions & 12 deletions .github/workflows/run-tutorials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ on:
pull_request:
paths:
- '**'
jobs:

jobs:
run_ht_simple:
name: Run HT, simple
runs-on: ubuntu-latest
container: precice/precice
container: precice/precice:develop
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v2
- name: Install Dependencies & FEniCS
run: |
apt-get -qq update
Expand All @@ -30,17 +30,17 @@ jobs:
- name: Get tutorials
run: git clone -b develop https://github.com/precice/tutorials.git
- name: Run tutorial
run: |
cd tutorials/partitioned-heat-conduction/fenics
python3 heat.py -d & python3 heat.py -n
run: |
cd tutorials/partitioned-heat-conduction
cd dirichlet-fenics && ./run.sh & cd neumann-fenics && ./run.sh
run_ht_complex:
name: Run HT, complex
runs-on: ubuntu-latest
container: precice/precice
container: precice/precice:develop
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v2
- name: Install Dependencies & FEniCS
run: |
apt-get -qq update
Expand All @@ -56,5 +56,5 @@ jobs:
run: git clone -b develop https://github.com/precice/tutorials.git
- name: Run tutorial
run: |
cd tutorials/partitioned-heat-conduction-complex/fenics
python3 heat.py -d -i complex & python3 heat.py -n -i complex
cd tutorials/partitioned-heat-conduction-complex
cd dirichlet-fenics && ./run.sh & cd neumann-fenics && ./run.sh
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# FEniCS-preCICE adapter changelog

## 2.0.0

* Drop support for preCICE 2.x version, as this is a breaking release.
* Update adapter to use preCICE v3 API [#153](https://github.com/precice/fenics-adapter/pull/153).
* Remove functionality to define mesh connectivity in 2D cases in the form of triangles due to lack of testing and compatibility problems (might be added again). See [#162](https://github.com/precice/fenics-adapter/issues/162).

## 1.4.0

* Adding CITATION.cff to link the adapter repository to the relevant publication in the journal SoftwareX.
Expand Down
102 changes: 60 additions & 42 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,45 +1,63 @@
# YAML 1.2
---
abstract: "The new software FEniCS-preCICE is a middle software layer, sitting in between the existing finite-element library FEniCS and the coupling library preCICE. The middle layer simplifies coupling (existing) FEniCS application codes to other simulation software via preCICE. To this end, FEniCS-preCICE converts between FEniCS and preCICE mesh and data structures, provides easy-to-use coupling conditions, and manages data checkpointing for implicit coupling. The new software is a library itself and follows a FEniCS-native style. Only a few lines of additional code are necessary to prepare a FEniCS application code for coupling. We illustrate the functionality of FEniCS-preCICE by two examples: a FEniCS heat conduction code coupled to OpenFOAM and a FEniCS linear elasticity code coupled to SU2. The results of both scenarios are compared with other simulation software showing good agreement."
authors:
-
affiliation: "Technical University of Munich"
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: FEniCS-preCICE
message: >-
If you use this software, please cite it using the metadata from this file. When using or referring to preCICE in
academic publications, please follow the [citation guidelines](https://precice.org/fundamentals-literature-guide.html).
type: software
authors:
- given-names: Benjamin
family-names: Rodenberg
given-names: Benjamin
orcid: "https://orcid.org/0000-0002-3116-0133"
-
affiliation: "University Stuttgart"
orcid: 'https://orcid.org/0000-0002-3116-0133'
affiliation: Technical University of Munich
- given-names: Ishaan
family-names: Desai
given-names: Ishaan
orcid: "https://orcid.org/0000-0002-2552-7509"
-
family-names: Hertrich
orcid: 'https://orcid.org/0000-0002-2552-7509'
affiliation: University Stuttgart
- family-names: Hertrich
given-names: Richard
orcid: "https://orcid.org/0000-0003-1722-2841"
-
affiliation: "University of Stuttgart"
family-names: Jaust
given-names: Alexander
orcid: "https://orcid.org/0000-0002-6082-105X"
-
affiliation: "University of Stuttgart"
family-names: Uekermann
given-names: Benjamin
orcid: "https://orcid.org/0000-0002-1314-9969"
cff-version: "1.1.0"
date-released: 2021-01-10
keywords:
- FEniCS
- "Fluid-Structure Interaction"
- "Conjugate Heat Transfer"
- Multiphysics
- "Coupled Problems"
- "Finite Element Method"
- preCICE
license: "LGPL-3.0"
message: "If you use this software, please cite it using these metadata."
repository-code: "https://github.com/precice/fenics-adapter"
title: "FEniCS-preCICE: Coupling FEniCS to other Simulation Software"
version: 1.2.0
doi: 10.1016/j.softx.2021.100807
...
orcid: 'https://orcid.org/0000-0003-1722-2841'
- affiliation: University of Stuttgart
given-names: Jaust
family-names: Alexander
orcid: 'https://orcid.org/0000-0002-6082-105X'
- affiliation: University of Stuttgart
given-names: Uekermann
family-names: Benjamin
orcid: 'https://orcid.org/0000-0002-1314-9969'
repository-code: 'https://github.com/precice/fenics-adapter'
abstract: >-
preCICE-adapter for the open source computing platform
FEniCS.
license: LGPL-3.0
version: 2.0.0
preferred-citation:
title: "FEniCS-preCICE: Coupling FEniCS to other Simulation Software"
type: "article"
authors:
- affiliation: "Technical University of Munich"
family-names: Rodenberg
given-names: Benjamin
orcid: "https://orcid.org/0000-0002-3116-0133"
- affiliation: "University Stuttgart"
family-names: Desai
given-names: Ishaan
orcid: "https://orcid.org/0000-0002-2552-7509"
- family-names: Hertrich
given-names: Richard
orcid: "https://orcid.org/0000-0003-1722-2841"
- affiliation: "University of Stuttgart"
family-names: Jaust
given-names: Alexander
orcid: "https://orcid.org/0000-0002-6082-105X"
- affiliation: "University of Stuttgart"
family-names: Uekermann
given-names: Benjamin
orcid: "https://orcid.org/0000-0002-1314-9969"
doi: 10.1016/j.softx.2021.100807
journal: "SoftwareX"
volume: 16
pages: 100807
year: 2021
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ python3 -m unittest tests.test_write_read.TestWriteandReadData.test_vector_write
**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](https://github.com/precice/fenics-adapter/issues/103).
* If you see `ImportError: cannot import name 'cellname2facetname' from 'ufl.cell'`, refer to [issue #154](https://github.com/precice/fenics-adapter/issues/154).
* If you see `ModuleNotFoundError: No module named 'dolfin'` and have installed PETSc from source, refer to [this forum post](https://fenicsproject.discourse.group/t/modulenotfounderror-no-module-named-dolfin-if-petsc-dir-is-set/4407). Short version: Try to use the PETSc that comes with your system, if possible. Note that you can also [compile preCICE without PETSc](https://www.precice.org/installation-source-configuration.html), if necessary.

If this does not help, you can contact us on [gitter](https://gitter.im/precice/lobby) or [open an issue](https://github.com/precice/fenics-adapter/issues/new).
Expand All @@ -85,7 +86,7 @@ To create and install the `fenicsprecice` python package the following instructi

## Development history

The initial version of this adapter was developed by [Benjamin Rodenberg](https://www.in.tum.de/i05/personen/personen/benjamin-rodenberg/) during his research stay at Lund University in the group for [Numerical Analysis](http://www.maths.lu.se/english/research/research-divisions/numerical-analysis/) in close collaboration with [Peter Meisrimel](https://www.lunduniversity.lu.se/lucat/user/09d80f0367a060bcf2a22d7c22e5e504).
The initial version of this adapter was developed by [Benjamin Rodenberg](https://www.cs.cit.tum.de/sccs/personen/benjamin-rodenberg/) during his research stay at Lund University in the group for [Numerical Analysis](http://www.maths.lu.se/english/research/research-divisions/numerical-analysis/) in close collaboration with Peter Meisrimel.

[Richard Hertrich](https://github.com/richahert) contributed the possibility to perform FSI simulations using the adapter in his [Bachelor thesis](https://mediatum.ub.tum.de/node?id=1520579).

Expand Down
9 changes: 6 additions & 3 deletions docs/ReleaseGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@

Before starting this process make sure to check that all relevant changes are included in the `CHANGELOG.md`. The developer who is releasing a new version of FEniCS-preCICE adapter is expected to follow this workflow:

1. If it does not already exist, create a release branch with the version number of the planned release. Use develop as base for the branch. `git checkout develop`; `git checkout -b fenics-adapter-vX.X.X`. Perform the following steps only on the release branch, if not indicated differently.
1. If it does not already exist, create a release branch with the version number of the planned release. Use develop as base for the branch. `git checkout develop`; `git checkout -b fenics-adapter-vX.X.X`. Perform the following steps only on the release branch, if not indicated differently.

2. [Open a Pull Request from the branch `fenics-adapter-vX.X.X` to `master`](https://github.com/precice/fenics-adapter/compare) named after the version (i.e. `Release v1.0.0`) and briefly describe the new features of the release in the PR description.

3. Bump the version in the following places:

a) Before merging the PR, make sure to bump the version in `CHANGELOG.md` on `fenics-adapter-vX.X.X`
b) There is no need to bump the version anywhere else, since we use the [python-versioneer](https://github.com/python-versioneer/python-versioneer/) for maintaining the version everywhere else.
a) Before merging the PR, make sure to bump the version in `CHANGELOG.md` on `fenics-adapter-vX.X.X`.

b) Update the version in `CITATION.cff` and update the release date.

c) There is no need to bump the version anywhere else, since we use the [python-versioneer](https://github.com/python-versioneer/python-versioneer/) for maintaining the version everywhere else.

4. [Draft a New Release](https://github.com/precice/fenics-adapter/releases/new) in the `Releases` section of the repository page in a web browser. The release tag needs to be the exact version number (i.e.`v1.0.0` or `v1.0.0rc1`, compare to [existing tags](https://github.com/precice/fenics-adapter/tags)). Use `@target:master`. Release title is also the version number (i.e. `v1.0.0` or `v1.0.0rc1`, compare to [existing releases](https://github.com/precice/fenics-adapter/tags)).
*Note:* If it is a pre-release then the option *This is a pre-release* needs to be selected at the bottom of the page. Use `@target:fenics-adapter-vX.X.X` for a pre-release, since we will never merge a pre-release into master.
Expand Down
5 changes: 2 additions & 3 deletions fenicsprecice/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
"The FEniCS adapter might not work as expected.\n\n")

from .fenicsprecice import Adapter
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
from . import _version
__version__ = _version.get_versions()['version']
Loading

0 comments on commit 8b76fe2

Please sign in to comment.