-
Notifications
You must be signed in to change notification settings - Fork 247
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
[GeoMechanicsApplication] Add reset displacement to interfaces #12871
Conversation
if (stresses_on_integration_points.empty()) { | ||
rElement.CalculateOnIntegrationPoints( | ||
CAUCHY_STRESS_VECTOR, stresses_on_integration_points, mrModelPart.GetProcessInfo()); | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this 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
if (!rCurrentProcessInfo[IS_RESTARTED] || | ||
mConstitutiveLaws.size() != shape_function_values_at_integration_points.size()) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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()) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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], |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No objections there!
There was a problem hiding this 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, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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], |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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!
There was a problem hiding this 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.
📝 Description
Added a test case for reset-displacement and made the necessary changes to the line interface element