Conversation
rfaasse
left a comment
There was a problem hiding this comment.
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!
applications/GeoMechanicsApplication/custom_workflows/time_loop_executor.hpp
Show resolved
Hide resolved
applications/GeoMechanicsApplication/python_scripts/geomechanics_U_Pw_solver.py
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/python_scripts/geomechanics_analysis.py
Show resolved
Hide resolved
| """ | ||
| Calculates incremental displacement | ||
| :param node: | ||
| :return: | ||
| """ |
There was a problem hiding this comment.
Feel free to remove these lines, since they have no added value in my opinion. The method's name tells it all.
| incremental_displacement = node.GetSolutionStepValue(KratosMultiphysics.DISPLACEMENT, 0) - \ | ||
| node.GetSolutionStepValue(KratosMultiphysics.DISPLACEMENT, 1) |
There was a problem hiding this comment.
In general, I would try to avoid using the line continuation marker. You can do that as follows:
| incremental_displacement = node.GetSolutionStepValue(KratosMultiphysics.DISPLACEMENT, 0) - \ | |
| node.GetSolutionStepValue(KratosMultiphysics.DISPLACEMENT, 1) | |
| incremental_displacement = (node.GetSolutionStepValue(KratosMultiphysics.DISPLACEMENT, 0) - | |
| node.GetSolutionStepValue(KratosMultiphysics.DISPLACEMENT, 1)) |
| p_node->GetSolutionStepValue(DISPLACEMENT,1) = displacement_start_time_step; | ||
| p_node->GetSolutionStepValue(DISPLACEMENT,0) = displacement_end_time_step; |
There was a problem hiding this comment.
Nitpicking:
| 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; |
| KRATOS_TEST_CASE_IN_SUITE(ComputeIncrementalDisplacementField, KratosGeoMechanicsFastSuite) | ||
| { | ||
| Model model; | ||
| auto& model_part = CreateDummyModelPart(model); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Done for this .cpp file.
rfaasse
left a comment
There was a problem hiding this comment.
Looks good to me! Thanks for incorporating the review comments and for adding this nice bit of functionality!
…nd integration test. (#12288) * Incremental displacement variable, output and integration test. * Output enabled fhrough the C++ route too.
📝 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