-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Add Fortran elastic-tube-1d solvers (precice Fortran module) #607
Add Fortran elastic-tube-1d solvers (precice Fortran module) #607
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @YonatanGM,
wearing my preCICE hat here 🤠 (it is a bit unfortunate that I am also supervising your SSE project, maybe @fsimonis can control my conflict of interest).
With a first look, I think we could keep both contributions, since we support both ways of using preCICE via Fortran. Let's start with this one, and at the same time port any changes to the other one as well (should not be too many). Not sure yet how we could reduce duplication, but I have the impression the simplest would be to keep both, in different directories (fluid-fortran
and fluid-fortran-module
).
I had a first look and I ran the code, mixing languages to check for potential incompatibilities. I arrive at the same results.
In terms of the solver source code, I have only reviewed the FluidComputeSolution.f90
so far, as well as the shell scripts and CMakeLists.txt
. I will check the rest of the Fortran files during the day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of my comments were still somehow pending publishing. @YonatanGM let me know if everything is clear.
Hi @MakisH, Thanks for the comments!! I will address them later today or tomorrow. |
…nsistent precision
15a9a88
to
b0d4593
Compare
Hi @MakisH, I addressed your suggestions! I renamed the folder to |
@MakisH I noticed there are no precice finalize calls in the C++ and python versions. Could that be problematic? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for the prompt and very clean updates. Looks already very good! Just a couple of tiny points, mostly replying to your questions.
Good observation, thanks for asking! In the C++ API, the In C and Fortran, the whole paradigm is procedural, so we need to call this explicitly. tl;dr: All good. |
Also: Don't forget the changelog entry (in both PRs). |
The code works. Still pending:
(putting my SSE hat on: these are trivial, but still have some learning significance) |
@MakisH With both directory and file removed, it didnt work for me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the very clean contribution and the very prompt and clear answers, @YonatanGM! I am merging this and I will merge #606 next.
After merging, I noticed one small thing that I would have done differently and slipped my review: the If you want to contribute this as well, that would be great, but I can also do it later. |
This PR adds Fortran solvers for the elastic-tube-1d case using the fortran module (precice.f90). I also opened PR #606 that doesn't rely on this module.
The
run.sh
script downloads precice.f90 from the Fortran module repository to get the latest version and the file gets compiled with the solvers source files using CMake. Since the module is just a wrapper around the precicef functions in the library, which are updated with preCICE release, I imagine it will stay compatible with the precice version used in the solvers (as long as the function names stay consistent)LAPACK is needed for the fluid solver (same as the C++ case). Just run ./run.sh to build and execute via CMake. The plotting scripts (plot-diameter.sh and plot-all.sh) are updated to show results for the Fortran case. The precommit yaml didnt have hooks for Fortran files, so I maunally formatted them using fprettify.
Results look consistent with the other solvers. I checked the VTK output, and the numbers match up to 5 decimal places on the last timestep. Also tested running the fortran case against the other solves and that seems to work fine too.
Checklist:
changelog-entries/<PRnumber>.md
.