Skip to content

Commit f9af292

Browse files
Fix structure of volume-coupled-diffusion (#489)
1 parent eb3daf5 commit f9af292

File tree

9 files changed

+24
-40
lines changed

9 files changed

+24
-40
lines changed

volume-coupled-diffusion/README.md

+9-12
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,24 @@ This case illustrates how to implement volume coupling in a simple toy problem.
1515

1616
## Available solvers and dependencies
1717

18+
Both participants (Source and Drain):
19+
1820
* 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.
1921

2022
## Running the simulation
2123

22-
This tutorial is for FEniCS. You can find the corresponding `run.sh` script in the folder `fenics`.
23-
24-
To choose whether you want to run the source or the drain solver, please provide the following command line input:
25-
26-
* `-s` flag will create a source.
27-
* `-d` flag will create a drain.
28-
29-
For running the case, open two terminals run:
24+
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:
3025

3126
```bash
32-
cd fenics
33-
./run.sh -s
27+
cd source-fenics
28+
./run.sh
3429
```
3530

3631
and
3732

3833
```bash
39-
cd fenics
40-
./run.sh -d
34+
cd drain-fenics
35+
./run.sh
4136
```
37+
38+
in order to use FEniCS for both participants in this test case.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
set -e -u
3+
4+
python3 ../solver-fenics/volume-coupled-diffusion.py --drain

volume-coupled-diffusion/fenics/run.sh

-24
This file was deleted.

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

+1-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ def inside(self, x, on_boundary):
2626
command_group.add_argument("-d", "--drain", help="create a drain", dest="drain", action="store_true")
2727
args = parser.parse_args()
2828

29-
if args.source:
30-
precice = Adapter(adapter_config_filename="precice-adapter-config-source.json")
31-
elif args.drain:
32-
precice = Adapter(adapter_config_filename="precice-adapter-config-drain.json")
29+
precice = Adapter(adapter_config_filename="precice-adapter-config.json")
3330

3431
mesh = UnitSquareMesh(10, 10)
3532
V = FunctionSpace(mesh, "P", 1)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
set -e -u
3+
4+
. ../../tools/cleaning-tools.sh
5+
6+
clean_fenics .
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
set -e -u
3+
4+
python3 ../solver-fenics/volume-coupled-diffusion.py --source

0 commit comments

Comments
 (0)