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

Fix u Dirichtlet condition in GeoMechanicsApplication by earlier initialization of the constitutive law #13014

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

WPK4FEM
Copy link
Contributor

@WPK4FEM WPK4FEM commented Jan 16, 2025

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.

@WPK4FEM WPK4FEM requested a review from rfaasse January 16, 2025 13:39
@WPK4FEM WPK4FEM self-assigned this Jan 16, 2025
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 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!

Comment on lines 149 to 154
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);
}
Copy link
Contributor

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:

Suggested change
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());

@WPK4FEM WPK4FEM enabled auto-merge (squash) January 17, 2025 12:28
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.

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,
Copy link
Contributor

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.

@WPK4FEM WPK4FEM merged commit 3acfdfe into master Jan 17, 2025
11 checks passed
@WPK4FEM WPK4FEM deleted the geo/13013_Dirichlet_condition branch January 17, 2025 15:33
avdg81 added a commit that referenced this pull request Jan 21, 2025
…tep`

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.
avdg81 added a commit that referenced this pull request Jan 24, 2025
… 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[GeoMechanicsApplication] Fix the displacement Dirichlet boundary condition
2 participants