Skip to content

[GeoMechanicsApplication] Incremental displacement variable, output and integration test.#12288

Merged
WPK4FEM merged 4 commits intomasterfrom
geo/incremental_displacement_output
Apr 25, 2024
Merged

[GeoMechanicsApplication] Incremental displacement variable, output and integration test.#12288
WPK4FEM merged 4 commits intomasterfrom
geo/incremental_displacement_output

Conversation

@WPK4FEM
Copy link
Contributor

@WPK4FEM WPK4FEM commented Apr 17, 2024

📝 Description
For clear display of failure mechanisms we would like to inspect the extra deformations computed during one step, additional to the displacements since the start of a stage.

🆕 Changelog

  • Added INCREMENTAL_DISPLACEMENT variable.
  • Computed INCREMENTAL_DISPLACEMENT in python.
  • Added the INCREMENTAL_DISPLACEMENT result to test_dirichlet_u.
  • Added INCREMENTAL_DISPLACEMENT in the .cpp route + unit test.

@WPK4FEM WPK4FEM added the GeoMechanics Issues related to the GeoMechanicsApplication label Apr 17, 2024
@WPK4FEM WPK4FEM self-assigned this Apr 17, 2024
@WPK4FEM WPK4FEM marked this pull request as ready for review April 22, 2024 14:33
@WPK4FEM WPK4FEM requested review from avdg81 and rfaasse April 22, 2024 14:33
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 nice additional variable, clearly (unit)tested and added to all workflows! I have a few suggestions, but this seems like a nice complete feature to me!

Copy link
Contributor

@avdg81 avdg81 left a comment

Choose a reason for hiding this comment

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

This will help to get a better understanding how a failure mechanism develops. The code you've added is clear and compact. Thank you for extending the Python output as well as the C++ output.

Comment on lines +64 to +68
"""
Calculates incremental displacement
:param node:
:return:
"""
Copy link
Contributor

@avdg81 avdg81 Apr 24, 2024

Choose a reason for hiding this comment

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

Feel free to remove these lines, since they have no added value in my opinion. The method's name tells it all.

Comment on lines +69 to +70
incremental_displacement = node.GetSolutionStepValue(KratosMultiphysics.DISPLACEMENT, 0) - \
node.GetSolutionStepValue(KratosMultiphysics.DISPLACEMENT, 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

In general, I would try to avoid using the line continuation marker. You can do that as follows:

Suggested change
incremental_displacement = node.GetSolutionStepValue(KratosMultiphysics.DISPLACEMENT, 0) - \
node.GetSolutionStepValue(KratosMultiphysics.DISPLACEMENT, 1)
incremental_displacement = (node.GetSolutionStepValue(KratosMultiphysics.DISPLACEMENT, 0) -
node.GetSolutionStepValue(KratosMultiphysics.DISPLACEMENT, 1))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment on lines +247 to +248
p_node->GetSolutionStepValue(DISPLACEMENT,1) = displacement_start_time_step;
p_node->GetSolutionStepValue(DISPLACEMENT,0) = displacement_end_time_step;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpicking:

Suggested change
p_node->GetSolutionStepValue(DISPLACEMENT,1) = displacement_start_time_step;
p_node->GetSolutionStepValue(DISPLACEMENT,0) = displacement_end_time_step;
p_node->GetSolutionStepValue(DISPLACEMENT, 1) = displacement_start_time_step;
p_node->GetSolutionStepValue(DISPLACEMENT, 0) = displacement_end_time_step;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

KRATOS_TEST_CASE_IN_SUITE(ComputeIncrementalDisplacementField, KratosGeoMechanicsFastSuite)
{
Model model;
auto& model_part = CreateDummyModelPart(model);
Copy link
Contributor

Choose a reason for hiding this comment

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

Strictly speaking, we should prefix this name with r_ to comply with the Kratos Style Guide. Having said that, I can imagine that this minor inconsistency appears in other tests in the same file as well. So we could either correct those as well, or do that in a separate PR. I'll leave that up to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done for this .cpp file.

@WPK4FEM WPK4FEM requested review from avdg81 and rfaasse April 25, 2024 06:50
@WPK4FEM WPK4FEM enabled auto-merge (squash) April 25, 2024 06:52
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 me! Thanks for incorporating the review comments and for adding this nice bit of functionality!

@WPK4FEM WPK4FEM merged commit 2eede41 into master Apr 25, 2024
@WPK4FEM WPK4FEM deleted the geo/incremental_displacement_output branch April 25, 2024 07:17
loumalouomega pushed a commit that referenced this pull request Apr 29, 2024
…nd integration test. (#12288)

* Incremental displacement variable, output and integration test.
* Output enabled fhrough the C++ route too.
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants