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

Conversation

MakisH
Copy link
Member

@MakisH MakisH commented Mar 20, 2024

Very use-case-specific, outdated, and trivial to reproduce from plot-displacement.sh

@MakisH MakisH self-assigned this Mar 20, 2024
@BenjaminRodenberg
Copy link
Member

The purpose of this script is to quickly be able to reproduce this plot:

https://github.com/precice/tutorials/blob/master/perpendicular-flap/images/tutorials-perpendicular-flap-displacement-all-watchpoints.png

As far as I remember this is to some degree a regression test we do more or less regularly. We should at least somehow document how this plot is created.

Copy link
Member

@BenjaminRodenberg BenjaminRodenberg left a comment

Choose a reason for hiding this comment

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

I think we should not delete this file and keep everything as it is for the distribution release:

  1. Comparing runs {SU2, OpenFOAM, nutils} X {FEniCS, CalculiX, SU2} is valuable. E.g. Change C3D8 elements to C3D8I elements in perpendicular-flap solid-calculix #250
  2. Running all 9 cases and storing them under unique names requires manual effort. I don't think we can easily improve this situation. Giving a name to the watchpoint file that includes the names of both participants (i.e. openfoam-calculix.log) breaks the black-box. The participant that is creating the watchpoint file does not know which participant sits on the other side.
  3. plot-displacements.sh only allows to plot a single curve, not multiple. Extending this to support plotting of several is not trivial in this setting.

Possible todo: Documentation how to do the runs, store the results, and create the plot (manual effort mentioned under 2) could certainly be improved, but this is not really something critical for the distribution release.

@uekerman
Copy link
Member

I would keep the script and add 2 sentences of documentation to the case README.

@MakisH MakisH assigned BenjaminRodenberg and unassigned MakisH Mar 20, 2024
@MakisH MakisH changed the title Remove script plot-all-displacements Document script plot-all-displacements Mar 24, 2024
@MakisH
Copy link
Member Author

MakisH commented Mar 24, 2024

1. Comparing runs `{SU2, OpenFOAM, nutils} X {FEniCS, CalculiX, SU2}` is valuable. E.g. [Change C3D8 elements to C3D8I elements in perpendicular-flap solid-calculix #250](https://github.com/precice/tutorials/pull/250)

The comparison is valuable, the script as-it-is is mostly confusing. I restored the script and added documentation.

2. Running all 9 cases and storing them under unique names requires manual effort. I don't think we can easily improve this situation. Giving a name to the watchpoint file that includes the names of both participants (i.e. `openfoam-calculix.log`) breaks the black-box. The participant that is creating the watchpoint file does not know which participant sits on the other side.

Automation could help, but that would be an overkill even for the system tests, as we need a system with all the solvers installed. We have that already in the VM, but even that would probably take hours to run. Reminder: we now have a cross-product of 3x7 (=21) solvers, with at least Nutils taking quite some time to run. Such automation would need to take fault tolerance into account.

3. `plot-displacements.sh` only allows to plot a single curve, not multiple. Extending this to support plotting of several is not trivial in this setting.

It is. Compare:

gnuplot -p << EOF                                                               
	set grid                                                                        
	set title 'x-displacement of the flap tip'                                        
	set xlabel 'time [s]'                                                           
	set ylabel 'x-displacement [m]'
+	set term pngcairo enhanced size 900,654
+	set output "images/tutorials-perpendicular-flap-displacement-all-watchpoints.png"
- 	plot "$1/precice-Solid-watchpoint-Flap-Tip.log" using 1:4 with lines title "$1"
+       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", \
+            ...
EOF

The difference is in the hard-coding of the filenames (just more than one arguments). The two set should actually also have been used in the simple plot-displacement.sh.

Possible todo: Documentation how to do the runs, store the results, and create the plot (manual effort mentioned under 2) could certainly be improved, but this is not really something critical for the distribution release.

I would keep the script and add 2 sentences of documentation to the case README.

I added more documentation.

We now essentially need to do the manual run of everything and update the picture. I will try to do that next week in the VM, in a separate PR.

Copy link
Member

@BenjaminRodenberg BenjaminRodenberg left a comment

Choose a reason for hiding this comment

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

Minor comment. Rest looks ok.

perpendicular-flap/README.md Outdated Show resolved Hide resolved
@MakisH MakisH merged commit 48f5684 into precice:develop Mar 25, 2024
1 check passed
@MakisH MakisH deleted the plot-all-displacements branch March 25, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants