Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GeoMechanicsApplication] Add reset displacement to interfaces #12871

Merged
merged 8 commits into from
Nov 29, 2024

Conversation

rfaasse
Copy link
Contributor

@rfaasse rfaasse commented Nov 26, 2024

📝 Description
Added a test case for reset-displacement and made the necessary changes to the line interface element

Comment on lines +36 to +39
if (stresses_on_integration_points.empty()) {
rElement.CalculateOnIntegrationPoints(
CAUCHY_STRESS_VECTOR, stresses_on_integration_points, mrModelPart.GetProcessInfo());
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I now made the change here that the CAUCHY_STRESS_VECTOR can also be used. Let me know if you think this is a good idea, or if we should stick with PK2_STRESS_VECTOR only

@rfaasse rfaasse marked this pull request as ready for review November 27, 2024 06:52
@rfaasse rfaasse self-assigned this Nov 27, 2024
@rfaasse rfaasse added the GeoMechanics Issues related to the GeoMechanicsApplication label Nov 27, 2024
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.

Dear Richard,
Thank you for fixing the functionality. Some comments, but nothing of really serious nature.
Think it should merge soon after small modifications.
Wijtze Pieter

Comment on lines 196 to 197
if (!rCurrentProcessInfo[IS_RESTARTED] ||
mConstitutiveLaws.size() != shape_function_values_at_integration_points.size()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The ! is hard to comprehend for the human mind. I guess the else branch is for restarted models with correct constitutive law size. If so, I suggest to use:
if ( rCurrentProcessInfo[IS_RESTARTED] && mConstitutiveLaws.size() == shape_function_values_at_integration_points.size()) {}
else {}
and in this way switch the contents of the if and else branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, made the switch

@@ -33,6 +33,10 @@ void ResetDisplacementProcess::ExecuteInitialize()
std::vector<Vector> stresses_on_integration_points;
rElement.CalculateOnIntegrationPoints(PK2_STRESS_VECTOR, stresses_on_integration_points,
mrModelPart.GetProcessInfo());
if (stresses_on_integration_points.empty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This check apparently means that the PK2_STRESS_VECTOR was not computed or computable for this element. Is to let the element tell what is natural stress and strain measure are and then compute that one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally yes, I don't really know if there is such a mechanism?

"model_part_name": "PorousDomain.LoadedSide",
"variable_name": "TANGENTIAL_CONTACT_STRESS",
"active": [false,true],
"value": [0.0,667.0],
Copy link
Contributor

Choose a reason for hiding this comment

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

For the normal contact stress the value array is filled with zeros, values come from the table. Here a value is given , but it will be taken from the table anyway. The syntax itself is already confusing, may leave the unused value at zero.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, done (and in the test I based this one on)

def test_multi_stage_3_plus_3_line_interface_element_with_neumann_conditions_and_reset_displacements(self):
file_path = test_helper.get_file_path(os.path.join('line_interface_elements', 'Neumann_multi_stage_reset_displacements'))

initial_cwd = os.getcwd()
Copy link
Contributor

Choose a reason for hiding this comment

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

Initial current working directory? Behaviour reads like I remember where I am now and will return here when finished wandering. initial_directory is more clear to me as variable name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No objections there!

Copy link
Contributor

@mnabideltares mnabideltares left a comment

Choose a reason for hiding this comment

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

@rfaasse
Thank you for fixing this issue. It looks OK to me. I just have very minor remarks.

"strategy_type": "newton_raphson",
"convergence_criterion": "residual_criterion",
"displacement_relative_tolerance": 1.0E-4,
"displacement_absolute_tolerance": 1.0E-4,
Copy link
Contributor

Choose a reason for hiding this comment

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

Usually we set "displacement_absolute_tolerance": 1.0E-9,
Did you set it intentially to 1e-4?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Put them both to 1e-9, it doesn't really matter since we use residual_criterion anyway, but it's better for consistency, nice catch!

"variable_name": "TANGENTIAL_CONTACT_STRESS",
"active": [false,true],
"value": [0.0,667.0],
"table": [0,1],
Copy link
Contributor

Choose a reason for hiding this comment

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

The value comes from the table. Value is not relevant here. It can be set to zero

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, changed (also in the test on which I based this one)

"active": [false,true],
"value": [0.0,667.0],
"table": [0,1],
"fluid_pressure_type": "Uniform"
Copy link
Contributor

Choose a reason for hiding this comment

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

Preferly to have "fluid_pressure_type" before "value". It makes it easier to follow. However, it is matter of preference.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, moved!

"strategy_type": "newton_raphson",
"convergence_criterion": "residual_criterion",
"displacement_relative_tolerance": 1.0E-4,
"displacement_absolute_tolerance": 1.0E-4,
Copy link
Contributor

Choose a reason for hiding this comment

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

1.0e-9? see prevoues comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Put them both to 1e-9, it doesn't really matter since we use residual_criterion anyway, but it's better for consistency, nice catch!

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.

Good to go for me.

@rfaasse rfaasse merged commit 1d7ec51 into master Nov 29, 2024
10 of 11 checks passed
@rfaasse rfaasse deleted the geo/12868-add-reset-displacement-to-interfaces branch November 29, 2024 07:37
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
3 participants