Skip to content

[GeoMechanicsApplication] Improved robustness of nodal hydraulic head tests#13576

Merged
avdg81 merged 10 commits intomasterfrom
geo/improved-head-extrapolation-tests
Jul 3, 2025
Merged

[GeoMechanicsApplication] Improved robustness of nodal hydraulic head tests#13576
avdg81 merged 10 commits intomasterfrom
geo/improved-head-extrapolation-tests

Conversation

@avdg81
Copy link
Contributor

@avdg81 avdg81 commented Jul 1, 2025

📝 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.

@avdg81 avdg81 self-assigned this Jul 1, 2025
@avdg81 avdg81 requested a review from a team as a code owner July 1, 2025 13:00
@avdg81 avdg81 added Testing GeoMechanics Issues related to the GeoMechanicsApplication labels Jul 1, 2025
@avdg81 avdg81 linked an issue Jul 1, 2025 that may be closed by this pull request
Copy link
Contributor

@markelov208 markelov208 left a comment

Choose a reason for hiding this comment

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

Hi Anne, a very useful change. AI has suggested a few modifications. Hope some of then are useful.

@avdg81 avdg81 requested a review from rfaasse July 2, 2025 07:15
avdg81 added 2 commits July 2, 2025 09:52
- 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
markelov208 previously approved these changes Jul 2, 2025
Copy link
Contributor

@markelov208 markelov208 left a comment

Choose a reason for hiding this comment

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

Hi Anne, thank you for the changes. I think the PR is good to be merged.

@github-project-automation github-project-automation bot moved this from In progress to Reviewer approved in GeoMechanicsApplication (Deltares) Jul 2, 2025
Copy link
Contributor

@rfaasse rfaasse left a comment

Choose a reason for hiding this comment

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

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.
Copy link
Contributor

@rfaasse rfaasse left a comment

Choose a reason for hiding this comment

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

Looks good to go to me!

@avdg81 avdg81 merged commit c906013 into master Jul 3, 2025
11 checks passed
@avdg81 avdg81 deleted the geo/improved-head-extrapolation-tests branch July 3, 2025 07:20
@github-project-automation github-project-automation bot moved this from Reviewer approved to Done in GeoMechanicsApplication (Deltares) Jul 3, 2025
avdg81 added a commit that referenced this pull request Jul 4, 2025
…3593)

The file comparison function was accidentally not removed as part of PR #13576.

Furthermore, two example Python unit test cases have been removed, as they contained sample checks only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GeoMechanics Issues related to the GeoMechanicsApplication Testing

Development

Successfully merging this pull request may close these issues.

[GeoMechanicsApplication] Make flow analysis tests more robust

3 participants