Skip to content

Commit

Permalink
Fix structure of volume-coupled-diffusion (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminRodenberg authored Mar 20, 2024
1 parent eb3daf5 commit f9af292
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 40 deletions.
21 changes: 9 additions & 12 deletions volume-coupled-diffusion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,24 @@ This case illustrates how to implement volume coupling in a simple toy problem.

## Available solvers and dependencies

Both participants (Source and Drain):

* FEniCS. Install [FEniCS](https://fenicsproject.org/download/) and the [FEniCS-adapter](https://github.com/precice/fenics-adapter). Additionally, you will need to have preCICE and the python bindings installed on your system.

## Running the simulation

This tutorial is for FEniCS. You can find the corresponding `run.sh` script in the folder `fenics`.

To choose whether you want to run the source or the drain solver, please provide the following command line input:

* `-s` flag will create a source.
* `-d` flag will create a drain.

For running the case, open two terminals run:
FEniCS is used to run the simulation. Open two separate terminals and start the source and drain participant by calling the respective run script `run.sh` located in the participant directory. For example:

```bash
cd fenics
./run.sh -s
cd source-fenics
./run.sh
```

and

```bash
cd fenics
./run.sh -d
cd drain-fenics
./run.sh
```

in order to use FEniCS for both participants in this test case.
File renamed without changes.
4 changes: 4 additions & 0 deletions volume-coupled-diffusion/drain-fenics/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
set -e -u

python3 ../solver-fenics/volume-coupled-diffusion.py --drain
24 changes: 0 additions & 24 deletions volume-coupled-diffusion/fenics/run.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ def inside(self, x, on_boundary):
command_group.add_argument("-d", "--drain", help="create a drain", dest="drain", action="store_true")
args = parser.parse_args()

if args.source:
precice = Adapter(adapter_config_filename="precice-adapter-config-source.json")
elif args.drain:
precice = Adapter(adapter_config_filename="precice-adapter-config-drain.json")
precice = Adapter(adapter_config_filename="precice-adapter-config.json")

mesh = UnitSquareMesh(10, 10)
V = FunctionSpace(mesh, "P", 1)
Expand Down
6 changes: 6 additions & 0 deletions volume-coupled-diffusion/source-fenics/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
set -e -u

. ../../tools/cleaning-tools.sh

clean_fenics .
4 changes: 4 additions & 0 deletions volume-coupled-diffusion/source-fenics/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
set -e -u

python3 ../solver-fenics/volume-coupled-diffusion.py --source

0 comments on commit f9af292

Please sign in to comment.