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

Elastic tube 1D: Update solver sections, removing the now automatic build steps, and adding rust #531

Merged
merged 2 commits into from
Apr 25, 2024
Merged
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
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