-
Notifications
You must be signed in to change notification settings - Fork 254
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
Fix u Dirichtlet condition in GeoMechanicsApplication by earlier initialization of the constitutive law #13014
Conversation
…kp format changes.
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.
Very nice we finally got a grip on this issue and fixed it! I have only a minor suggestion for brevity, but other than that, this is good to go!
std::vector<Vector> strain_vectors; | ||
strain_vectors.resize(number_of_integration_points); | ||
for (auto& r_strain_vector : strain_vectors) { | ||
r_strain_vector.resize(GetStressStatePolicy().GetVoigtSize()); | ||
std::fill(r_strain_vector.begin(), r_strain_vector.end(), 0.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.
In theory, I think this could be shortened to:
std::vector<Vector> strain_vectors; | |
strain_vectors.resize(number_of_integration_points); | |
for (auto& r_strain_vector : strain_vectors) { | |
r_strain_vector.resize(GetStressStatePolicy().GetVoigtSize()); | |
std::fill(r_strain_vector.begin(), r_strain_vector.end(), 0.0); | |
} | |
std::vector<Vector> strain_vectors(number_of_integration_points, ZeroVector(GetStressStatePolicy().GetVoigtSize()); |
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.
Ready to go! I have one suggestion, but I leave that up to you.
@@ -146,14 +146,20 @@ void UPwBaseElement::Initialize(const ProcessInfo& rCurrentProcessInfo) | |||
std::fill(r_stress_vector.begin(), r_stress_vector.end(), 0.0); | |||
} | |||
} | |||
std::vector<Vector> strain_vectors(number_of_integration_points, |
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.
Can be const, but please only do this if you have another reason you'd need to wait on the pipelines.
… from `InitializeSolutionStep` (#13027) In [PR #13014](#13014), initialization of material response has been added to the element initialization. Previously, that was done by the initialization of the solution step. It was, however, not removed there. Now it has been. Data member `mIsInitialised` was no longer needed, since the implicit assumption of class `UPwBaseElement` is that member function `Initialize` must be called prior to calling `InitializeSolutionStep`. A handful of unit tests lacked the call to `Initialize` prior to calling `InitializeSolutionStep`, and therefore started to fail. Those tests have been fixed as well.
u Dirchlet conditions in GeoMechanics application were not working, because the constitutive law strain members were initialized after application of the condition. That is too late and leads to zero unbalance from this load.
🆕 Changelog
Call the strain and stress initialization for the constitutive law in Initialize of the UPW base class already.