Skip to content
Open
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
6 changes: 6 additions & 0 deletions partitioned-heat-conduction-direct/dirichlet-gismo/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh
set -e -u

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

clean_gismo .
9 changes: 9 additions & 0 deletions partitioned-heat-conduction-direct/dirichlet-gismo/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e -u

. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

partitioned-heat-conduction -s 0 ../precice-config.xml --plot

close_log
6 changes: 6 additions & 0 deletions partitioned-heat-conduction-direct/neumann-gismo/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh
set -e -u

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

clean_gismo .
9 changes: 9 additions & 0 deletions partitioned-heat-conduction-direct/neumann-gismo/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e -u

. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

partitioned-heat-conduction -s 1 ../precice-config.xml --plot

close_log
38 changes: 37 additions & 1 deletion partitioned-heat-conduction/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Partitioned heat conduction
permalink: tutorials-partitioned-heat-conduction.html
keywords: FEniCS, Nutils, Heat conduction
keywords: FEniCS, Nutils, G+Smo, Heat conduction
summary: We solve a simple heat equation. The domain is partitioned and the coupling is established in a Dirichlet-Neumann fashion.
---

Expand Down Expand Up @@ -37,6 +37,8 @@ You can either couple a solver with itself or different solvers with each other.

* OpenFOAM. This case uses the custom [heatTransfer](https://github.com/precice/tutorials/blob/master/partitioned-heat-conduction/solver-openfoam/heatTransfer.C) solver (find it in `solver-openfoam` and build with `wmake`). Read more details in the [OpenFOAM adapter](https://precice.org/adapter-openfoam-overview.html).

* G+Smo. Inatsll [G+Smo](https://github.com/gismo/gismo).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* G+Smo. Inatsll [G+Smo](https://github.com/gismo/gismo).
* G+Smo. Install [G+Smo](https://github.com/gismo/gismo).

But we need a bit more details, or better link to the adapter documentation:

Suggested change
* G+Smo. Inatsll [G+Smo](https://github.com/gismo/gismo).
* G+Smo. Install the [G+Smo adapter](https://precice.org/adapter-gismo.html).


## Running the simulation

You can find the corresponding `run.sh` script for running the case in the folders corresponding to the participant you want to use:
Expand Down Expand Up @@ -73,6 +75,38 @@ If you want to use Nutils or OpenFOAM, use `cd dirichlet/neumann-nutils`, respec
mpirun -n <N_PROC> heat.py -d
```

The G+Smo-based version of the tutorial offers IsoGeometric Analysis discretization method. To run the example you need to follow the following steps:

- Download G+Smo and Create a Build Folder
```
git clone [email protected]:gismo/gismo.git
cd gismo
mkdir build
```
- Configure G+Smo
```
cmake .. -DGISMO_OPTIONAL="<other submodules>;gsPreCICE"
```
- Build the Example
```
make partitioned-heat-conduction -j <number of threads to use>
```
- Link the compiled executable to the gismo-executable folder within the tutorial directory
```
cd <Your preCICE tutorial folder>/partitioned-heat-conduction/gismo-executable
ln -sf <You G+Smo build folder>/bin/partitioned-heat-conduction ./gismo_executable`
```
- Open two terminals and run
```
cd dirichlet-gismo
./run.sh
```

```
cd neumann-gismo
./run.sh
```
Comment on lines +78 to +108
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we move most of this content to the adapter documentation, and refer to that?

The path ./gismo_executable/gismo_executable is assumed by the run.sh, so it should probably be documented here. But we should better call that directory solver-gismo.


### Note on the combination of Nutils & FEniCS

You can mix the Nutils and FEniCS solver, if you like. Note that the error for a pure FEniCS simulation is lower than for a mixed one. We did not yet study the origin of this error, but assume that this is due to the fact that Nutils uses Gauss points as coupling mesh and therefore entails extrapolation in the data mapping at the top and bottom corners.
Expand All @@ -85,6 +119,8 @@ For FEniCS you can visualize the content with paraview by opening the `*.pvd` fi

For Nutils, please use the files `Dirichlet-*.vtk` or `Neumann-*.vtk`. Please note that these files contain the temperature as well as the reference solution.

For G+Smo, please use the file `solution.pvd` in both dirichlet-gismo and neumann-gismo directories.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For G+Smo, please use the file `solution.pvd` in both dirichlet-gismo and neumann-gismo directories.
For G+Smo, please use the generated `solution.pvd` files in the dirichlet-gismo and neumann-gismo directories.

(I thought this was a file in this PR for a moment)


![Animation of the partitioned heat equation](images/tutorials-partitioned-heat-conduction-FEniCS-movie.gif)

Visualization in paraview for `x_c = 1.5`.
Expand Down
27 changes: 27 additions & 0 deletions partitioned-heat-conduction/dirichlet-gismo/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Cleaning script for partitioned-heat-conduction directory

echo "Cleaning unnecessary files..."

# Remove precice-profiling directory
if [ -d "precice-profiling" ]; then
rm -rf precice-profiling
echo "Deleted 'precice-profiling' folder."
fi

# Remove precice-run directory
if [ -d "../precice-run" ]; then
rm -rf ../precice-run
echo "Deleted 'precice-run' folder."
fi
Comment on lines +7 to +17
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be handled by clean_precice_logs(), called by clean_gismo() (see https://github.com/precice/tutorials/blob/develop/tools/cleaning-tools.sh)



# Remove files ending with .pvd, .vts, .vtp, .log, and .txt
for ext in pvd vts vtp log txt; do
find . -type f -name "*.$ext" -exec rm -f {} \;
echo "Deleted all *.$ext files."
done
Comment on lines +20 to +24
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit too intrusive (especially for the .txt files). Better do a fine-grained extension of clean_gismo().

Same in the neumann-gismo directory.


echo "Cleaning completed!"

4 changes: 4 additions & 0 deletions partitioned-heat-conduction/dirichlet-gismo/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e -u

../gismo-executable/gismo-executable -c ../precice-config.xml --plot -s 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet referred to from the README.md. In principle, both FEniCS and G+Smo should give the same solution. If not, we should add the picture in the README.md together with a comment.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions partitioned-heat-conduction/neumann-gismo/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Cleaning script for partitioned-heat-conduction directory

echo "Cleaning unnecessary files..."

# Remove precice-profiling directory
if [ -d "precice-profiling" ]; then
rm -rf precice-profiling
echo "Deleted 'precice-profiling' folder."
fi

# Remove files ending with .pvd, .vts, .vtp, .log, and .txt
for ext in pvd vts vtp log txt; do
find . -type f -name "*.$ext" -exec rm -f {} \;
echo "Deleted all *.$ext files."
done

echo "Cleaning completed!"
4 changes: 4 additions & 0 deletions partitioned-heat-conduction/neumann-gismo/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e -u

../gismo-executable/gismo-executable -c ../precice-config.xml --plot -s 1
Loading