[GeoMechanicsApplication] Improved robustness of nodal hydraulic head tests#13576
Merged
[GeoMechanicsApplication] Improved robustness of nodal hydraulic head tests#13576
Conversation
This script uses the C++ workflow.
These include the C++ "unit test" file as well as the expected GiD output files.
markelov208
reviewed
Jul 1, 2025
Contributor
markelov208
left a comment
There was a problem hiding this comment.
Hi Anne, a very useful change. AI has suggested a few modifications. Hope some of then are useful.
applications/GeoMechanicsApplication/tests/test_GeoMechanicsApplication.py
Show resolved
Hide resolved
applications/GeoMechanicsApplication/tests/test_nodal_hydraulic_head.py
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/tests/test_nodal_hydraulic_head.py
Outdated
Show resolved
Hide resolved
…xtrapolation-tests
- Use module `parameterized` to simplify the test script. - Store the test path in an attribute of the test fixture and set it in method `setUp`. - Made a method a `@staticmethod`.
markelov208
previously approved these changes
Jul 2, 2025
Contributor
markelov208
left a comment
There was a problem hiding this comment.
Hi Anne, thank you for the changes. I think the PR is good to be merged.
rfaasse
reviewed
Jul 2, 2025
Contributor
rfaasse
left a comment
There was a problem hiding this comment.
Very clear PR and nice we now have the possibility to run geoflow from python! I only have a single suggestion.
Make sure that the hydraulic head at each and every node is being checked.
This was referenced Jul 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
The nodal hydraulic head tests are no longer implemented using the C++ unit test framework, but using the Python unit test framework, since these are integration tests. Previously, these tests were rather fragile, since they compared GiD output files, character by character. If the file contents would differ by at least one character, the test would fail.
Now we read the produced results from the GiD output files and compare the obtained hydraulic head values against the analytical solution, taking into account a tolerance value. This should make the test much more robust when the obtained results change slightly, e.g. when the precision of the produced results changes.
To run the flow analysis from a Python test script using the C++ workflow, a Python runner script has been added to the custom Python scripts directory.