Skip to content

Commit

Permalink
Elastic tube 1D: Update solver sections, removing the now automatic b…
Browse files Browse the repository at this point in the history
…uild steps, and adding rust (precice#531)
  • Loading branch information
fsimonis authored Apr 25, 2024
1 parent a82eb16 commit 42ecfdd
Showing 1 changed file with 6 additions and 42 deletions.
48 changes: 6 additions & 42 deletions elastic-tube-1d/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,34 +39,14 @@ preCICE configuration (image generated using the [precice-config-visualizer](htt

Both fluid and solid participant are supported in:

- *C++*: An example solver using the intrinsic [C++ API of preCICE](https://www.precice.org/couple-your-code-api.html). This solver also depends on LAPACK (e.g. on Ubuntu `sudo apt-get install liblapack-dev`)
- *Python*: An example solver using the preCICE [Python bindings](https://www.precice.org/installation-bindings-python.html). This solver also depends on the Python libraries `numpy scipy matplotlib vtk mpi4py`, which you can get from your system package manager or with `pip3 install --user <package>`.

### Building the C++ Solver

In order to use the C++ solver, you first need to build the scripts `FluidSolver` and `SolidSolver`. Each script needs to be built separately.

```bash
cd fluid-cpp
mkdir build && cd build
cmake ..
make all
```

```bash
cd solid-cpp
mkdir build && cd build
cmake ..
make all
```

Building can be skipped if you do not plan to use the C++ version.
- *C++*: example solvers using the intrinsic [C++ API of preCICE](https://www.precice.org/couple-your-code-api.html). The fluid solver also depends on LAPACK (e.g. on Ubuntu `sudo apt-get install liblapack-dev`)
- *Python*: example solvers using the preCICE [Python bindings](https://www.precice.org/installation-bindings-python.html). Both solvers depend on `numpy`. The fluid solver additionally depends on the Python libraries `scipy matplotlib`. You can get these libraries from your system package manager or with `pip3 install --user <package>`.
- *Rust*: example solvers using the preCICE [Rust bindings](https://www.precice.org/installation-bindings-rust.html). They need `cargo` to be installed.

## Running the Simulation

### C++

Open two separate terminals and start each participant by calling the respective run script.
Choose one solver for each pariticipant, then open two separate terminals and start each soler by calling the respective run script.
Here we use both C++ solvers:

```bash
cd fluid-cpp
Expand All @@ -80,23 +60,7 @@ cd solid-cpp
./run.sh
```

### Python

Open two separate terminals and start each participant by calling the respective run script. Only serial run is possible:

```bash
cd fluid-python
./run.sh
```

and

```bash
cd solid-python
./run.sh
```

**Optional:** A run-time plot visualization can be triggered by passing `--enable-plot` in `run.sh` of `FluidSolver.py`. Additionally a video of the run-time plot visualization can be generated by additionally passing `--write-video`
**Optional for python-fluid:** A run-time plot visualization can be triggered by passing `--enable-plot` in `run.sh` of `FluidSolver.py`. Additionally a video of the run-time plot visualization can be generated by additionally passing `--write-video`

{% warning %}
The C++ and Python solvers lead to different results. Please consider the Python results as the correct ones and refer to this [open issue](https://github.com/precice/tutorials/issues/195) for more insight. Contributions are particularly welcome here.
Expand Down

0 comments on commit 42ecfdd

Please sign in to comment.