Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix structure of volume-coupled-diffusion #489

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
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