Skip to content

Conversation

@avdg81
Copy link
Contributor

@avdg81 avdg81 commented Dec 24, 2025

📝 Description
Fixed some bugs that were found while testing the nodal extrapolation process.

🆕 Changelog

  • Each nodal extrapolation process now keeps track of which elements are connected to which nodes. Previously, this information was stored at the nodes themselves. This was, however, problematic when multiple nodal extrapolation processes were referencing the same nodes, since the element counters were shared across all processes. Also, we now keep a set of element IDs rather than a simple counter, to avoid incorrect smoothing when elements were repeatedly referenced.
  • As a result of the above changes, we no longer need to clear the element counter that was stored by the nodes. Member function ExecuteFinalize had become redundant and is now removed.
  • Replaced a raw for loop by a call to std::inner_product. This change required the introduction of member functions that return the zero value of the variable to be extrapolated.
  • Added a helper function that creates nodes on the given model part.
  • Attempted to make the unit tests of the nodal extrapolation process as consistent as possible in the way they are structured.
  • Removed several redundant retention law parameters from the settlement workflow test.
  • The settlement workflow test is now more specific about which model parts to consider for the nodal extrapolation processes.
  • Removed a duplicated model part from the settlement workflow test.
  • Removed several empty items from the mesh file of the settlement workflow test.
  • Modified and extended the documentation about the nodal extrapolation process where needed.

avdg81 and others added 30 commits December 19, 2025 11:36
- The extrapolation process now keeps its own map from node ID to a set of element IDs rather than an element counter that is stored with the nodes themselves. In this way, we avoid interference of model parts that share nodes and/or multiple extrapolation processes per stage.
- Removed member `ExecuteFinalize`, since we no longer need to reset the element counters that were kept by the nodes.
- Two nodes were added to a different model part than the intended one. That has been corrected now.
- Made the error messages a little bit more descriptive when the unit tests fail.
- Use `EXPECT_NEAR` rather than `KRATOS_EXPECT_NEAR`.
- In the unit test that uses two extrapolation processes, each process has its own extrapolation variable.
- Removed a unit test that covered an implementation detail of the extrapolation process.
In this way, we no longer need a loop counter in addition to the loop variable.
Also added some member functions that return the zero value of the given variable (e.g. a scalar, vector, or matrix).
Note that we have to be explicit about the type (`const T`), since using `auto` yields a type with lazy evaluation resulting in test failures. (Or, more accurately, that's what I expect is going on.)
…delPart from .mdpa

Used model_part_name_list to reflect active modelparts for extrapolation to nodes.
Stripped superfluous retention law parameters from MaterialParameters.json.
…ddition and the counting check if the element is active.
It now says that the second element in the test is inactive.

For that test case, we now also use the default absolute tolerance for testing.
One unit test now uses this new utility function.
…or of arrays

Also resolved a few ambiguous function calls.
Also extracted a function to assert matrices at a collection of nodes.
WPK4FEM
WPK4FEM previously approved these changes Dec 24, 2025
Copy link
Contributor

@WPK4FEM WPK4FEM left a 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 massive clean up of the unit test for the extrapolation process. I have some remarks, but none of them is blocking.

@github-project-automation github-project-automation bot moved this from In progress to Reviewer approved in GeoMechanicsApplication (Deltares) Dec 24, 2025
- Added a simple sketch of the model created by `CreateModelPartWithTwoStubElements`.
- Renamed a local helper function.
WPK4FEM
WPK4FEM previously approved these changes Dec 24, 2025
Copy link
Contributor

@WPK4FEM WPK4FEM left a 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 updates.

@avdg81 avdg81 changed the title [GeoMechanicsApplication] More improvements for nodal extrapolation process [GeoMechanicsApplication] More improvements for the nodal extrapolation process Dec 24, 2025
@WPK4FEM WPK4FEM requested a review from rfaasse January 2, 2026 07:41
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.

Thank you for these bugfixes, clean-up and reduction of duplications in the unit tests! I have some questions about the behavior and a couple of suggestions, but all in all a very neat PR

avdg81 added 3 commits January 5, 2026 11:13
- Added `override`s of member `SetValuesOnIntegrationPoints` of the stub element.
- Extracted a helper function that asserts nodal vector values (to reduce duplication).
- Added `override`s of member `SetValuesOnIntegrationPoints` of the stub element.
- Extracted a helper function that asserts nodal vector values (to reduce duplication).
- Removed a redundant unit test.
- Changed the integration point values set on the integration points of the inactive element (to be more confident that inactive elements are not taken into account).
- For two unit tests, used slightly more complicated fields to be extrapolated. Also added two comments that explain the expected nodal values.
- Updated the documentation of the nodal extrapolation process.
rfaasse
rfaasse previously approved these changes Jan 5, 2026
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.

Thanks for processing the review comments! It's good to go from my side

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, very nice improvements and, especially, helpers for the unit tests. I have only minor comments. Would you mind to create an issue to generalized the tests for other elements/interfaces?

- Renamed a private member function to better reflect what it does.
- Renamed a local variable to make it more consistent with other variable names.
@avdg81 avdg81 force-pushed the geo/more-improvements-for-nodal-extrapolation-process branch from e4160af to c564646 Compare January 6, 2026 09:26
@avdg81 avdg81 requested a review from markelov208 January 6, 2026 09:26
Copy link
Contributor

@WPK4FEM WPK4FEM left a comment

Choose a reason for hiding this comment

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

ready for me.

@avdg81 avdg81 enabled auto-merge (squash) January 6, 2026 09:49
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 processing the comments. The PR is ready to be merged

@avdg81 avdg81 merged commit d82d666 into master Jan 6, 2026
10 checks passed
@avdg81 avdg81 deleted the geo/more-improvements-for-nodal-extrapolation-process branch January 6, 2026 12:00
@github-project-automation github-project-automation bot moved this from Reviewer approved to Done in GeoMechanicsApplication (Deltares) Jan 6, 2026
@github-project-automation github-project-automation bot moved this from 👀 In Review to ✅ Done in Kratos Product Backlog Jan 6, 2026
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

Development

Successfully merging this pull request may close these issues.

5 participants