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

Document script plot-all-displacements #485

Merged
merged 6 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 2 additions & 0 deletions perpendicular-flap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ You should get results similar to this one:

![All flap watchpoints](images/tutorials-perpendicular-flap-displacement-all-watchpoints.png)

This plot has been generated with the `plot-all-displacements.sh` script, which requires executing and pre-processing the individual combinations manually.

MakisH marked this conversation as resolved.
Show resolved Hide resolved
Reasons for the differences:

* The CalculiX adapter only supports linear finite elements (deal.II uses 4th order, FEniCS 2nd order).
Expand Down
32 changes: 30 additions & 2 deletions perpendicular-flap/plot-all-displacements.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/bin/sh


# This script cannot be used as-is and is meant to generate the picture
# images/tutorials-perpendicular-flap-displacement-all-watchpoints.png
# rendered on https://precice.org/tutorials-perpendicular-flap.html.
#
# It plots watchpoints of specific combinations of Fluid and Solid participants,
# stored in `images/`. To use this script:
# 1. For each combination you want to plot:
# 1. Run the tutorial with that combination
# 2. Copy the respective watchpoint file to watchpoints/, with names <fluid>-<solid>.log
# 3. Clean the tutorial
# 2. Edit the script to plot the files you want, with the corresponding titles,
# adding one line per combination.
# 3. Call the script with ./plot-all-displacements.sh, from this directory.
#
# If you are only interested in a subset of combinations, remove the respective lines.

gnuplot -p << EOF
set grid
set title 'x-displacement of the flap tip'
Expand All @@ -10,10 +26,22 @@ gnuplot -p << EOF
plot "watchpoints/openfoam-calculix.log" using 1:4 with lines title "OpenFOAM-CalculiX", \
"watchpoints/openfoam-dealii.log" using 1:4 with lines title "OpenFOAM-deal.II", \
"watchpoints/openfoam-fenics.log" using 1:4 with lines title "OpenFOAM-FEniCS", \
"watchpoints/openfoam-dune.log" using 1:4 with lines title "OpenFOAM-DUNE", \
"watchpoints/openfoam-openfoam.log" using 1:4 with lines title "OpenFOAM-OpenFOAM", \
"watchpoints/openfoam-solids4foam.log" using 1:4 with lines title "OpenFOAM-solids4Foam", \
"watchpoints/openfoam-nutils.log" using 1:4 with lines title "OpenFOAM-Nutils", \
"watchpoints/su2-calculix.log" using 1:4 with lines title "SU2-CalculiX", \
"watchpoints/su2-dealii.log" using 1:4 with lines title "SU2-deal.II", \
"watchpoints/su2-fenics.log" using 1:4 with lines title "SU2-FEniCS", \
"watchpoints/su2-dune.log" using 1:4 with lines title "SU2-DUNE", \
"watchpoints/su2-openfoam.log" using 1:4 with lines title "SU2-OpenFOAM", \
"watchpoints/su2-solids4foam.log" using 1:4 with lines title "SU2-solids4Foam", \
"watchpoints/su2-nutils.log" using 1:4 with lines title "SU2-nutils", \
"watchpoints/nutils-calculix.log" using 1:4 with lines title "Nutils-CalculiX", \
"watchpoints/nutils-dealii.log" using 1:4 with lines title "Nutils-deal.II", \
"watchpoints/nutils-fenics.log" using 1:4 with lines title "Nutils-FEniCS"
"watchpoints/nutils-fenics.log" using 1:4 with lines title "Nutils-FEniCS", \
"watchpoints/nutils-dune.log" using 1:4 with lines title "Nutils-DUNE", \
"watchpoints/nutils-openfoam.log" using 1:4 with lines title "Nutils-OpenFOAM", \
"watchpoints/nutils-solids4foam.log" using 1:4 with lines title "Nutils-solids4Foam", \
"watchpoints/nutils-nutils.log" using 1:4 with lines title "Nutils-Nutils"
EOF