Skip to content

Commit

Permalink
Merge pull request #34 from precice/main
Browse files Browse the repository at this point in the history
Synchronization of `develop` branch with `main` branch
  • Loading branch information
Fujikawas authored Mar 15, 2024
2 parents 97d85cb + 54bc59c commit 53320c4
Show file tree
Hide file tree
Showing 24 changed files with 67 additions and 259 deletions.
4 changes: 2 additions & 2 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ Please provide information about the operating system and relevant versions of
the software.
Example:
Ubuntu 20.04 LTS, preCICE 2.3.0, DuMuX 3.4, DuMuX-preCICE 0.1
Ubuntu 22.04 LTS, preCICE 3.0.0, DuMuX 3.7, DuMuX-preCICE 2.0.0
--->

## Steps to reproduce

<!-- Please describe the steps one has to execture to reproduce the problem. --->
<!-- Please describe the steps one has to execute to reproduce the problem. --->

### Expected behavior

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
max-parallel: 2
matrix:
dumux_version: [3.4, 3.5]
dumux_version: [3.7, 3.8]
precice_version: [develop]
container:
image: precice/dumux-precice:${{ matrix.dumux_version }}-${{ matrix.precice_version }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-docker-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
dockerhub_username: precice
strategy:
matrix:
dumux_version: [3.4, 3.5]
dumux_version: [3.7, 3.8]
precice_version: [develop]
steps:
- name: Checkout Repository
Expand All @@ -37,8 +37,8 @@ jobs:
file: "./dockerfile.slim"
tags: ${{ env.dockerhub_username }}/dumux-precice:${{ matrix.dumux_version }}-${{ matrix.precice_version }}
build-args: |
DUNEVERSION=2.8
PRECICEUBUNTU=focal
DUNEVERSION=2.9
PRECICEUBUNTU=jammy
DUMUXVERSION=${{ matrix.dumux_version }}
PRECICEVERSION=${{ matrix.precice_version }}
build-dune-precice:
Expand Down Expand Up @@ -69,5 +69,5 @@ jobs:
tags: ${{ env.dockerhub_username }}/dune-precice:${{ matrix.dune_version }}-${{ matrix.precice_version }}
build-args: |
DUNEVERSION=${{ matrix.dune_version }}
PRECICEUBUNTU=focal
PRECICEUBUNTU=jammy
PRECICEVERSION=${{ matrix.precice_version }}
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# DuMuX-preCICE change log

## Not released yet
## v2.0.0

- 2023-08-10: Updated the adapter to align with preCICE V3. Updated the examples accordingly.
- 2023-08-10: Updated the adapter to be compatible with preCICE v3.0.0. Updated the examples too.

## v1.0.0

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ The DuMuX-preCICE adapter is a DUNE module named `dumux-precice` which can be bu

### Prerequisites

- DuMuX **newer** than 3.2
- DuMuX >= than 3.7

- Builds using the current `master` branch of DuMuX might fail.
- If you run into trouble with a new DuMuX release, please open an issue in the repository and add the error message that you receive.
- Needs UMFPack (available via SuiteSparse) as solver for linear systems of equations. This is needed to run the examples included in the adapter. Otherwise you can skip UMFPack.

- preCICE >=2.0.0
- preCICE >=3.0.0

- The adapter is build via the DUNE build system that is based on CMake. Thus, the CMake [link instructions for preCICE](https://precice.org/installation-linking.html#cmake) apply.

Expand All @@ -42,7 +42,7 @@ The DuMuX-preCICE adapter should build fine if DuMuX, preCICE and their dependen

### Detailed installation steps

1. Install [DuMuX](https://dumux.org/) and the needed dependencies. The easiest way is to follow [DuMuX's installation instructions](https://dumux.org/installation/). The DuMuX project provides a script that installs and DuMuX and the DUNE modules required by DuMuX. This means, after installing DuMuX via the provided script you should be good to go to use the DuMuX-preCICE adapter.
1. Install [DuMuX](https://dumux.org/) and the needed dependencies. The easiest way is to follow [DuMuX's installation instructions](https://dumux.org/docs/doxygen/master/installation.html). The DuMuX project provides a script that installs and DuMuX and the DUNE modules required by DuMuX. This means, after installing DuMuX via the provided script you should be good to go to use the DuMuX-preCICE adapter.

After the installation you should have a root directory that contains the base DUNE modules, i.e. a number of directories named like `dune-common`, `dune-geometry` etc., and a directory called `dumux`.

Expand All @@ -51,13 +51,13 @@ The DuMuX-preCICE adapter should build fine if DuMuX, preCICE and their dependen
2. Download the DuMuX-preCICE adapter to the same directory as the DUNE modules and the `dumux` folder. It is recommended to use the latest release of the adapter, which can be found by checking out the relevant release tag.

```text
git clone -b v1.0.0 https://github.com/precice/dumux-adapter.git
git clone -b v2.0.0 https://github.com/precice/dumux-adapter.git
```

You can also try to clone the repository via SSH:

```text
git clone -b v1.0.0 git@github.com:precice/dumux-adapter.git
git clone -b v2.0.0 git@github.com:precice/dumux-adapter.git
```

3. Verify that the `dumux-adapter` folder is in the same directory as the DUNE module folders and the `dumux` folder.
Expand All @@ -68,7 +68,7 @@ The DuMuX-preCICE adapter should build fine if DuMuX, preCICE and their dependen
./dune-common/bin/dunecontrol --only=dumux-precice all
```

After the build and configure step a new directory `build-cmake` was created inside the `dumux-precice` directory.
After the build and configure step a new directory `build-cmake` was created inside the `dumux-adapter` directory.

You can configure the build and configuration process using advanced options by manipulating CMake variables. `dunecontrol` allows to pass an options file for that

Expand All @@ -84,7 +84,7 @@ The DuMuX-preCICE adapter should build fine if DuMuX, preCICE and their dependen

This provided `cmake-test.opts` file turns off some system-dependent optimizations such that the tests create comparable results on different computers.

For more ways do manipulate/adapt the build and configuration step, please consult the `dunecontrol` documentation.
For more ways to manipulate/adapt the build and configuration step, please consult the `dunecontrol` documentation.

5. Optional, but recommended: Build all tests to verify the installation. For this navigate in the `build-cmake/` directory and build the `build_tests` target.

Expand Down
6 changes: 3 additions & 3 deletions doc/user/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The DuMuX-preCICE adapter is a DUNE module named `dumux-precice` which can be bu

## Prerequisites

- DuMuX **newer** than 3.2
- DuMuX >= 3.7

- Builds using the current `master` branch of DuMuX might fail.
- If you run into trouble with a new DuMuX release, please open an issue in the repository and add the error message that you receive.
Expand Down Expand Up @@ -46,7 +46,7 @@ The DuMuX-preCICE adapter should build fine if DuMuX, preCICE and their dependen
dune-common/bin/dunecontrol --only=dumux-precice all
```

After the build and configure step a new directory `build-cmake` was created inside the `dumux-precice` directory.
After the build and configure step a new directory `build-cmake` was created inside the `dumux-adapter` directory.

You can configure the build and configuration process using advanced options by manipulating CMake variables. `dunecontrol` allows to pass an options file for that

Expand All @@ -65,7 +65,7 @@ The DuMuX-preCICE adapter should build fine if DuMuX, preCICE and their dependen
To use the adapter in a separate DUNE module, we recommend building the adapter as a shared library. To do so, use the CMake option `-DBUILD_SHARED_LIBS=ON` to build the adapter and upstream modules. The DuMux install script uses `dumux/cmake.opts`, which already sets this option.
Note that to change this setting it may be required to clear the CMake caches in `build-cmake/CMakeCache.txt`.

For more ways do manipulate/adapt the build and configuration step, please consult the `dunecontrol` documentation.
For more ways to manipulate/adapt the build and configuration step, please consult the `dunecontrol` documentation.

5. Optional, but recommended: Build all tests to verify the installation. For this navigate in the `build-cmake/` directory and build the `build_tests` target.

Expand Down
12 changes: 6 additions & 6 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ For more details on what is installed, please check the `Dockerfile`.

The versions of the main dependencies can be manipulated when building the Docker image via the arguments with given default values

- `ARG DUNEVERSION=2.7`: DUNE version. Available in all recipes.
- `ARG DUMUXVERSION=3.4`: DuMuX version. Available in all recipes.
- `ARG PRECICEVERSION=2.2.1`: preCICE version. Available only in "large" and "slim" recipes.
- `ARG PRECICEUBUNTU=focal`: preCICE target platform (here, Ubuntu Focal Fossa). Available only in "large" recipe.
- `ARG DUNEVERSION=2.9`: DUNE version. Available in all recipes.
- `ARG DUMUXVERSION=3.7`: DuMuX version. Available in all recipes.
- `ARG PRECICEVERSION=3.0.0`: preCICE version. Available only in "large" and "slim" (use branch name e.g. "v3.0.0" or "develop") recipes.
- `ARG PRECICEUBUNTU=jammy`: preCICE target platform (here, Ubuntu Jammy Jellyfish). Available only in "large" recipe.

If one wants to build a "slim" image using DUNE 2.8, DuMuX from the current master branch and preCICE 2.4.0 one could call it with the following command:
If one wants to build a "slim" image using DUNE 2.9, DuMuX from the current master branch and preCICE 3.0.0 one could call it with the following command:

```text
sudo docker build --build-arg DUNEVERSION=2.8 --build-arg DUMUXVERSION=master --build-arg PRECICEVERSION=2.4.0 -t ajaust/dumux-precice:master-2.4.0 --file dockerfile.slim .
sudo docker build --build-arg DUNEVERSION=2.9 --build-arg DUMUXVERSION=master --build-arg PRECICEVERSION=v3.0.0 -t precice/dumux-precice:master-v3.0.0 --file dockerfile.slim .
```

The script `rebuild-docker-images.sh` can be used to rebuild the Docker images locally.
6 changes: 3 additions & 3 deletions docker/dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND noninteractive

Expand All @@ -13,8 +13,8 @@ ARG DUMUXINSTALLPATH=/opt/DUMUX
WORKDIR ${DUMUXINSTALLPATH}

# Obtain DuMuX and Dune repositories
ARG DUNEVERSION=2.8
ARG DUMUXVERSION=3.5
ARG DUNEVERSION=2.9
ARG DUMUXVERSION=3.7
COPY checkout_repositories.sh .
RUN bash checkout_repositories.sh ${DUNEVERSION} ${DUMUXVERSION}

Expand Down
12 changes: 6 additions & 6 deletions docker/dockerfile.large
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:22.04

# Install DUNE and DuMuX in /home/dumux
WORKDIR ${USER_HOME}
Expand All @@ -14,8 +14,8 @@ RUN apt-get install -y apt-utils vim htop git
RUN apt-get install -y openmpi-bin libopenmpi-dev git gcc g++ wget cmake sudo libboost-all-dev pkg-config python3

# Obtain DuMuX and Dune repositories
ARG DUNEVERSION=2.7
ARG DUMUXVERSION=3.4
ARG DUNEVERSION=2.9
ARG DUMUXVERSION=3.7
COPY checkout_repositories.sh .
RUN bash checkout_repositories.sh ${DUNEVERSION} ${DUMUXVERSION}

Expand All @@ -31,9 +31,9 @@ ENV DUNE_CONTROL_PATH=${USER_HOME}/dune-common/dune.module:${USER_HOME}/dune-geo
ENV PYTHONPATH ${USER_HOME}/dumux/bin/testing:${PYTHONPATH}

#Install preCICE
ARG PRECICEVERSION=2.2.1
ARG PRECICEUBUNTU=focal
RUN wget https://github.com/precice/precice/releases/download/v${PRECICEVERSION}/libprecice2_${PRECICEVERSION}_${PRECICEUBUNTU}.deb -O libprecice${PRECICEVERSION}-${PRECICEUBUNTU}.deb \
ARG PRECICEVERSION=3.0.0
ARG PRECICEUBUNTU=jammy
RUN wget https://github.com/precice/precice/releases/download/v${PRECICEVERSION}/libprecice3_${PRECICEVERSION}_${PRECICEUBUNTU}.deb -O libprecice${PRECICEVERSION}-${PRECICEUBUNTU}.deb \
&& apt install -y ./libprecice${PRECICEVERSION}-${PRECICEUBUNTU}.deb \
&& rm -f ./libprecice${PRECICEVERSION}-${PRECICEUBUNTU}.deb

Expand Down
13 changes: 6 additions & 7 deletions docker/dockerfile.slim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND noninteractive

Expand All @@ -7,14 +7,14 @@ ADD 01_nodoc /etc/dpkg/dpkg.cfg.d/01_nodoc

# Install dependencies from
RUN apt-get update
RUN apt-get install -y git gcc g++ gfortran cmake pkg-config libboost-log1.71.0 libboost-thread1.71.0 libboost-system1.71.0 libboost-filesystem1.71.0 libboost-program-options1.71.0 libboost-test1.71.0 libboost-container1.71.0 libeigen3-dev libxml2 libboost-log-dev libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-test-dev libboost-container-dev libeigen3-dev libxml2-dev libsuitesparse-dev python3
RUN apt-get install -y git gcc g++ gfortran cmake pkg-config libboost-log1.74.0 libboost-thread1.74.0 libboost-system1.74.0 libboost-filesystem1.74.0 libboost-program-options1.74.0 libboost-test1.74.0 libboost-container1.74.0 libeigen3-dev libxml2 libboost-log-dev libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-test-dev libboost-container-dev libeigen3-dev libxml2-dev libsuitesparse-dev python3

ARG DUMUXINSTALLPATH=/opt/DUMUX
WORKDIR ${DUMUXINSTALLPATH}

# Obtain DuMuX and Dune repositories
ARG DUNEVERSION=2.8
ARG DUMUXVERSION=3.5
ARG DUNEVERSION=2.9
ARG DUMUXVERSION=3.7
COPY checkout_repositories.sh .
RUN bash checkout_repositories.sh ${DUNEVERSION} ${DUMUXVERSION}

Expand All @@ -30,9 +30,8 @@ ENV DUNE_CONTROL_PATH=${DUMUXINSTALLPATH}/dune-common/dune.module:${DUMUXINSTALL
ENV PYTHONPATH ${DUMUXINSTALLPATH}/dumux/bin/testing:${PYTHONPATH}

# Compile minmum version of preCICE
#ARG PRECICEVERSION=2.4.0
ARG PRECICEVERSION=develop
ARG PRECICEUBUNTU=focal
ARG PRECICEVERSION=v3.0.0
ARG PRECICEUBUNTU=jammy
RUN git clone --depth 1 -b ${PRECICEVERSION} https://github.com/precice/precice.git precice-${PRECICEVERSION} && cd precice-${PRECICEVERSION} && mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPRECICE_FEATURE_MPI_COMMUNICATION=OFF -DPRECICE_FEATURE_PETSC_MAPPING=OFF -DPRECICE_FEATURE_PYTHON_ACTIONS=OFF -DCMAKE_INSTALL_PREFIX=/usr && make -j 4 && make test && make install && cd ../../ && rm -rf precice-${PRECICEVERSION}

RUN apt-get purge -y libboost-log-dev libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-test-dev libboost-container-dev libxml2-dev
Expand Down
11 changes: 5 additions & 6 deletions docker/dockerfile_dune-precice.slim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND noninteractive

Expand All @@ -7,13 +7,13 @@ ADD 01_nodoc /etc/dpkg/dpkg.cfg.d/01_nodoc

# Install dependencies from
RUN apt-get update
RUN apt-get install -y git gcc g++ gfortran cmake pkg-config libboost-log1.71.0 libboost-thread1.71.0 libboost-system1.71.0 libboost-filesystem1.71.0 libboost-program-options1.71.0 libboost-test1.71.0 libboost-container1.71.0 libeigen3-dev libxml2 libboost-log-dev libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-test-dev libboost-container-dev libeigen3-dev libxml2-dev libsuitesparse-dev python3
RUN apt-get install -y git gcc g++ gfortran cmake pkg-config libboost-log1.74.0 libboost-thread1.74.0 libboost-system1.74.0 libboost-filesystem1.74.0 libboost-program-options1.74.0 libboost-test1.74.0 libboost-container1.74.0 libeigen3-dev libxml2 libboost-log-dev libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-test-dev libboost-container-dev libeigen3-dev libxml2-dev libsuitesparse-dev python3

ARG DUMUXINSTALLPATH=/opt/DUMUX
WORKDIR ${DUMUXINSTALLPATH}

# Obtain DuMuX and Dune repositories
ARG DUNEVERSION=2.8
ARG DUNEVERSION=2.9
COPY checkout_repositories.sh .
RUN bash checkout_repositories.sh ${DUNEVERSION} none

Expand All @@ -27,9 +27,8 @@ RUN dunecontrol --opts=cmake-test.opts all
ENV DUNE_CONTROL_PATH=${DUMUXINSTALLPATH}/dune-common/dune.module:${DUMUXINSTALLPATH}/dune-geometry/dune.module:${DUMUXINSTALLPATH}/dune-grid/dune.module:${DUMUXINSTALLPATH}/dune-localfunctions/dune.module:${DUMUXINSTALLPATH}/dune-istl/dune.module:${DUMUXINSTALLPATH}/dune-subgrid/dune.module

# Compile minmum version of preCICE
#ARG PRECICEVERSION=2.4.0
ARG PRECICEVERSION=develop
ARG PRECICEUBUNTU=focal
ARG PRECICEVERSION=v3.0.0
ARG PRECICEUBUNTU=jammy
RUN git clone --depth 1 -b ${PRECICEVERSION} https://github.com/precice/precice.git precice-${PRECICEVERSION} && cd precice-${PRECICEVERSION} && mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPRECICE_FEATURE_MPI_COMMUNICATION=OFF -DPRECICE_FEATURE_PETSC_MAPPING=OFF -DPRECICE_FEATURE_PYTHON_ACTIONS=OFF -DCMAKE_INSTALL_PREFIX=/usr && make -j 4 && make test && make install && cd ../../ && rm -rf precice-${PRECICEVERSION}

RUN apt-get purge -y libboost-log-dev libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-test-dev libboost-container-dev libxml2-dev
Expand Down
4 changes: 2 additions & 2 deletions docker/rebuild-docker-images.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

DUNE_VERSION="2.8"
DUMUX_VERSIONS=("3.4" "3.5")
DUNE_VERSION="2.9"
DUMUX_VERSIONS=("3.7" "3.8")
PRECICE_VERSIONS=("develop")

for dumux_version in ${DUMUX_VERSIONS[@]}; do
Expand Down
4 changes: 2 additions & 2 deletions dune.module
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

#Name of the module
Module: dumux-precice
Version: 1.0.0
Version: 2.0.0
Maintainer: ishaan.desai@ipvs.uni-stuttgart.de
# Required build dependencies
Depends: dumux (>=3.2)
Depends: dumux (>=3.7)
# Optional build dependencies
Suggests: dune-subgrid
2 changes: 1 addition & 1 deletion examples/dummysolver/precice-dummy-solver-config.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>

<precice-configuration >
<precice-configuration>

<log>
<sink type="stream" output="stdout" filter= "%Severity% > debug" format="preCICE:%ColorizedSeverity% %Message%" enabled="true" />
Expand Down
36 changes: 8 additions & 28 deletions examples/ff-pm/flow-over-cube-3d/1pspatialparams.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@
#ifndef DUMUX_1P_TEST_SPATIALPARAMS_HH
#define DUMUX_1P_TEST_SPATIALPARAMS_HH

#if DUMUX_VERSION_MAJOR >= 3 & DUMUX_VERSION_MINOR >= 5
#include <dumux/porousmediumflow/fvspatialparams1p.hh>
#else
#include <dumux/material/spatialparams/fv1p.hh>
#endif

namespace Dumux
{
Expand All @@ -39,30 +35,16 @@ namespace Dumux
* 1p cc model
*/
template<class FVGridGeometry, class Scalar>
class OnePSpatialParams
#if DUMUX_VERSION_MAJOR >= 3 & DUMUX_VERSION_MINOR >= 5
: public FVPorousMediumFlowSpatialParamsOneP<
FVGridGeometry,
Scalar,
OnePSpatialParams<FVGridGeometry, Scalar>>
#else
: public FVSpatialParamsOneP<FVGridGeometry,
Scalar,
OnePSpatialParams<FVGridGeometry, Scalar>>
#endif
class OnePSpatialParams : public FVPorousMediumFlowSpatialParamsOneP<
FVGridGeometry,
Scalar,
OnePSpatialParams<FVGridGeometry, Scalar>>
{
using GridView = typename FVGridGeometry::GridView;
using ParentType =
#if DUMUX_VERSION_MAJOR >= 3 & DUMUX_VERSION_MINOR >= 5
FVPorousMediumFlowSpatialParamsOneP<
FVGridGeometry,
Scalar,
OnePSpatialParams<FVGridGeometry, Scalar>>;
#else
FVSpatialParamsOneP<FVGridGeometry,
Scalar,
OnePSpatialParams<FVGridGeometry, Scalar>>;
#endif
using ParentType = FVPorousMediumFlowSpatialParamsOneP<
FVGridGeometry,
Scalar,
OnePSpatialParams<FVGridGeometry, Scalar>>;

using Element = typename GridView::template Codim<0>::Entity;
using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
Expand Down Expand Up @@ -108,7 +90,6 @@ public:
return alphaBJ_;
}

#if DUMUX_VERSION_MAJOR >= 3 & DUMUX_VERSION_MINOR > 4
/*!
* \brief Return the temperature within the domain in [K].
*
Expand All @@ -118,7 +99,6 @@ public:
{
return 273.15 + 10; // 10°C
}
#endif

private:
Scalar permeability_;
Expand Down
Loading

0 comments on commit 53320c4

Please sign in to comment.