Skip to content

Commit

Permalink
Merge pull request #136 from precice/fenics-adapter-v1.2.0
Browse files Browse the repository at this point in the history
Release v1.2.0
  • Loading branch information
BenjaminRodenberg authored Jul 13, 2021
2 parents beabcd1 + 8ff280d commit 69a16bd
Show file tree
Hide file tree
Showing 14 changed files with 330 additions and 131 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ on:
- '**'

jobs:
sdist:
name: Build distribution
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build distribution
run: python3 setup.py sdist
test:
name: Run mock unit tests
runs-on: ubuntu-latest
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Update docker image

on:
workflow_dispatch: # Trigger by hand from the UI
push:
branches:
- develop

jobs:
build-and-release-docker-image:
name: Builds a dockerimage with the fenics adapter of preCICE
runs-on: ubuntu-latest
env:
docker_username: precice
steps:
- name: Get branch name
if: github.event_name != 'pull_request'
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ env.docker_username }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Dockerfile
uses: docker/build-push-action@v2
with:
push: true
file: "./tools/releasing/packaging/docker/Dockerfile"
tags: ${{ env.docker_username }}/fenics-adapter:${{ env.branch }},${{ env.docker_username }}/fenics-adapter:latest
build-args: |
branch=${{ env.branch }}
21 changes: 21 additions & 0 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Lint scripts and docs
on: [push, pull_request]
jobs:
check_markdown_files:
name: Lint scripts and docs
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Lint markdown files (markdownlint)
uses: articulate/actions-markdownlint@v1
with:
config: .markdownlint.json
files: '.'
ignore: changelog-entries
- name: Check links in markdown files (markdown-link-check)
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'no'
config-file: '.markdown-link-check-config.json'
3 changes: 3 additions & 0 deletions .markdown-link-check-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"aliveStatusCodes": [429, 200]
}
4 changes: 4 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"MD013": false,
"MD033": false
}
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

22 changes: 14 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
# FEniCS-preCICE adapter changelog

## 1.2.0

* Reduce complexity of initialization to reduce runtime for large cases. [See PR #135](https://github.com/precice/fenics-adapter/pull/135)
* Raise warning, if FEniCS is not found on system. [See PR #130](https://github.com/precice/fenics-adapter/pull/130)
* Add test for python3 setup.py sdist. [See PR #127](https://github.com/precice/fenics-adapter/pull/127)

## 1.1.0

* Only warn during initialization, if duplicate boundary point is found for point sources.
* Remove deprecated package `fenicsadapter`. Don't use `import fenicsadapter`. Please use `import fenicsprecice`. https://github.com/precice/fenics-adapter/pull/121
* Remove deprecated package `fenicsadapter`. Don't use `import fenicsadapter`. Please use `import fenicsprecice`. [See PR #121](https://github.com/precice/fenics-adapter/pull/121)

## 1.0.1

* Bugfix for PointSources https://github.com/precice/fenics-adapter/issues/109
* Bugfix in parallelization https://github.com/precice/fenics-adapter/pull/110
* Bugfix for PointSources in [PR #109](https://github.com/precice/fenics-adapter/issues/109)
* Bugfix in parallelization in [PR #110](https://github.com/precice/fenics-adapter/pull/110)

## 1.0.0

* The paper *FEniCS-preCICE: Coupling FEniCS to other Simulation Software* (in preparation) describes features, usage and API of the adapter.
* The software is called FEniCS-preCICE adapter, the corresponding python package `fenicsprecice`. Our software uses the naming proposed in https://github.com/precice/fenics-adapter/issues/85.
* `fenicsprecice` is published via PyPI https://github.com/precice/fenics-adapter/pull/94.
* The software is called FEniCS-preCICE adapter, the corresponding python package `fenicsprecice`. Our software uses the naming proposed in [PR #85](https://github.com/precice/fenics-adapter/issues/85).
* `fenicsprecice` is published via PyPI. [See PR #94](https://github.com/precice/fenics-adapter/pull/94).
* FEniCS PointSource and Expressions are used to create boundary conditions for coupling.
* The adapter uses a `SegregatedRBFinterpolationExpression` for interpolation, if an Expression is used https://github.com/precice/fenics-adapter/pull/83.
* The adapter uses a `SegregatedRBFinterpolationExpression` for interpolation, if an Expression is used. [See PR #83](https://github.com/precice/fenics-adapter/pull/83).
* The adapter supports one-way coupling and two-way coupling.
* The adapter supports explicit and implicit coupling schemes.
* The adapter supports checkpointing and subcycling.
* The adapter supports up to one read and one write data set.
* The current state of the adapter API was mainly designed in https://github.com/precice/fenics-adapter/pull/59.
* Supports parallel solvers for Expressions, but not for PointSources as coupling boundary conditions. See https://github.com/precice/fenics-adapter/pull/71.
* The current state of the adapter API was mainly designed in [PR #59](https://github.com/precice/fenics-adapter/pull/59).
* Supports parallel solvers for Expressions, but not for PointSources as coupling boundary conditions. [See PR #71](https://github.com/precice/fenics-adapter/pull/71).
49 changes: 22 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FEniCS-preCICE adapter
----------------------
# FEniCS-preCICE adapter

<a style="text-decoration: none" href="https://github.com/precice/fenics-adapter/blob/master/LICENSE" target="_blank">
<img src="https://img.shields.io/github/license/precice/fenics-adapter.svg" alt="GNU LGPL license">
Expand All @@ -13,25 +12,25 @@ FEniCS-preCICE adapter
</a>
<a style="text-decoration: none" href="https://pypi.org/project/fenicsprecice/" target="_blank">
<img src="https://github.com/precice/fenics-adapter/actions/workflows/pythonpublish.yml/badge.svg" alt="Upload Python Package">
</a>

preCICE-adapter for the open source computing platform FEniCS
</a>

**currently only supports 2D simulations in FEniCS**
preCICE-adapter for the open source computing platform FEniCS. Note: The adapter **currently only supports 2D simulations in FEniCS.**

# Installing the package
## Installing the package

## Using pip3 to install from PyPI
### Using pip3 to install from PyPI

It is recommended to install [fenicsprecice from PyPI](https://pypi.org/project/fenicsprecice/) via

```bash
pip3 install --user fenicsprecice
```
$ pip3 install --user 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 pip3
### Clone this repository and use pip3

### Required dependencies
#### Required dependencies

Make sure to install the following dependencies:

Expand All @@ -41,22 +40,23 @@ Make sure to install the following dependencies:
* [FEniCS](https://fenicsproject.org/) (with python interface, installed by default)
* and scipy (`pip3 install scipy`)

### Build and install the adapter
#### 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
#### 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:
```

```bash
python3 -m unittest tests.test_write_read.TestWriteandReadData.test_vector_write
```

### Troubleshooting
#### Troubleshooting

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

Expand All @@ -65,33 +65,28 @@ python3 -m unittest tests.test_write_read.TestWriteandReadData.test_vector_write

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).

# Use the adapter
## Use the adapter

Please refer to [our website](https://www.precice.org/adapter-fenics.html#how-can-i-use-my-own-solver-with-the-adapter-).

# Packaging
## Packaging

To create and install the `fenicsprecice` python package the following instructions were used: https://python-packaging.readthedocs.io/en/latest/index.html.
To create and install the `fenicsprecice` python package the following instructions were used: [How To Package Your Python Code from python-packaging.readthedocs.io](https://python-packaging.readthedocs.io/en/latest/index.html).

# Citing
## Citing

If you are using this adapter, please refer to the [citing information on the FEniCS adapter](https://www.precice.org/adapter-fenics.html#how-to-cite).

preCICE is an academic project, developed at the [Technical University of Munich](https://www5.in.tum.de/) and at the [University of Stuttgart](https://www.ipvs.uni-stuttgart.de/). If you use preCICE, please [cite us](https://www.precice.org/publications/):

*H.-J. Bungartz, F. Lindner, B. Gatzhammer, M. Mehl, K. Scheufele, A. Shukaev, and B. Uekermann: preCICE - A Fully Parallel Library for Multi-Physics Surface Coupling. Computers and Fluids, 141, 250–258, 2016.*

If you are using FEniCS, please also consider the information on https://fenicsproject.org/citing/.

# Disclaimer
If you are using FEniCS, please also consider the information on [the official FEniCS website on citing](https://fenicsproject.org/citing/).

This offering is not approved or endorsed by the FEniCS Project, producer and distributor of the FEniCS software via https://fenicsproject.org/.

# Development history
## 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).

[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).

[Ishaan Desai](https://www.ipvs.uni-stuttgart.de/institute/team/Desai/) improved the user interface and extended the adapter to also allow for parallel FEniCS computations.

2 changes: 1 addition & 1 deletion docs/ReleaseGuide.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Guide to release new version of the FEniCS-preCICE adapter
# Guide to release new version of the FEniCS-preCICE adapter

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:

Expand Down
8 changes: 8 additions & 0 deletions fenicsprecice/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
import warnings

try:
from fenics import *
except ModuleNotFoundError:
warnings.warn("No FEniCS installation found on system. Please check whether it is found correctly. "
"The FEniCS adapter might not work as expected.\n\n")

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

0 comments on commit 69a16bd

Please sign in to comment.