[GeoMechanicsApplication] Extend class GeoIncrementalLinearElasticInterfaceLaw to include planar interface behavior#13586
Conversation
This reverts commit 475f8fb. # Conflicts: # applications/GeoMechanicsApplication/custom_constitutive/incremental_linear_elastic_interface_law.cpp # applications/GeoMechanicsApplication/geo_mechanics_application.h # applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_incremental_linear_elastic_interface_law.cpp # applications/GeoMechanicsApplication/tests/cpp_tests/custom_elements/test_line_interface_element.cpp
…faceLaw # Conflicts: # applications/GeoMechanicsApplication/tests/cpp_tests/custom_constitutive/test_incremental_linear_elastic_interface_law.cpp
WPK4FEM
left a comment
There was a problem hiding this comment.
Hi Gennady,
When you and Anne dragged me into talking about this PR, I had started reading. I hardly have anything to add to the discussion we already had. The implementation and testing of it are clear to me.
Wijtze Pieter
| { | ||
| auto result = ConstitutiveLawUtilities::MakeInterfaceConstitutiveMatrix( | ||
| NormalStiffness, ShearStiffness, TractionSize); | ||
| result(2, 2) = result(1, 1); |
There was a problem hiding this comment.
Could we modify MakeInterfaceConstitutiveMatrix such that it fills the (2, 2) position correctly or is it more natural to have a local implementation of it?
There was a problem hiding this comment.
I don't have a solid view right now. Perhaps, Anne and Richard will tell their opinion. Initially, MakeGeneralInterfaceConstitutiveMatrix was created but after our conversation I removed it because many such methods may follow.
There was a problem hiding this comment.
I agree with @WPK4FEM, and I think we can do it as follows. First, we need to add a function parameter of type std::size_t to ConstitutiveLawUtilities::MakeInterfaceConstitutiveMatrix, which represents the number of normal components. Subsequently, when we call this function from either InterfaceThreeDimensionalSurface::CalculateElasticMatrix or InterfacePlaneStrain::CalculateElasticMatrix, we can use the return value of member GetNumberOfNormalComponents to supply the value for this new argument. And then we can remove the assignment here at line 27 (i.e. delete result(2, 2) = result(1, 1);).
The implementation of ConstitutiveLawUtilities::MakeInterfaceConstitutiveMatrix needs to be modified as well. For instance:
Matrix ConstitutiveLawUtilities::MakeInterfaceConstitutiveMatrix(double NormalStiffness,
double ShearStiffness,
std::size_t TractionSize,
std::size_t NumberOfNormalComponents)
{
auto result = Matrix{ZeroMatrix{TractionSize, TractionSize}};
for (auto i = std::size_t{0}; i < NumberOfNormalComponents; ++i) result(i, i) = NormalStiffness;
for (auto i = NumberOfNormalComponents; i < TractionSize; ++i) result(i, i) = ShearStiffness;
return result;
}There was a problem hiding this comment.
used this version. Now I see why there is GetNumberOfNormalComponents function
| KRATOS_REGISTER_CONSTITUTIVE_LAW("Geo_IncrementalLinearElasticInterface3DSurfaceLaw", | ||
| mIncrementalLinearElasticInterface3DSurfaceLaw) |
There was a problem hiding this comment.
We (Gennady, Anne, Wijtze Pieter, Richard) discussed to drop the _ from here and also from line 367. That implies that some tests should be changed accordingly.
There was a problem hiding this comment.
The underscore is removed
…faceLaw # Conflicts: # applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_with_tension_cutoff.cpp # applications/GeoMechanicsApplication/custom_constitutive/mohr_coulomb_with_tension_cutoff.h
avdg81
left a comment
There was a problem hiding this comment.
Hi Gennady,
Thank you very much for creating this clear and well-tested extension of the incremental linear elastic law for interface elements. I have several suggestions, but none of them is blocking. Hope this helps.
One more thing: can you please add an issue on the backlog about updating the dike model with a sheet pile wall, to account for the renaming of the incremental linear elastic law for interfaces? Thanks.
| #pragma once | ||
|
|
||
| #include "containers/flags.h" | ||
| #include "includes/properties.h" |
There was a problem hiding this comment.
Since Properties are passed by reference-to-const, I would prefer to use a forward declaration in the header (i.e. here), and move this #include to the implementation files. In this way, when includes/properties.h is changed, we (hopefully) have to recompile fewer files.
...tions/GeoMechanicsApplication/custom_constitutive/incremental_linear_elastic_interface_law.h
Outdated
Show resolved
Hide resolved
...tions/GeoMechanicsApplication/custom_constitutive/incremental_linear_elastic_interface_law.h
Outdated
Show resolved
Hide resolved
...tions/GeoMechanicsApplication/custom_constitutive/incremental_linear_elastic_interface_law.h
Outdated
Show resolved
Hide resolved
...tions/GeoMechanicsApplication/custom_constitutive/incremental_linear_elastic_interface_law.h
Outdated
Show resolved
Hide resolved
| { | ||
| auto result = ConstitutiveLawUtilities::MakeInterfaceConstitutiveMatrix( | ||
| NormalStiffness, ShearStiffness, TractionSize); | ||
| result(2, 2) = result(1, 1); |
There was a problem hiding this comment.
I agree with @WPK4FEM, and I think we can do it as follows. First, we need to add a function parameter of type std::size_t to ConstitutiveLawUtilities::MakeInterfaceConstitutiveMatrix, which represents the number of normal components. Subsequently, when we call this function from either InterfaceThreeDimensionalSurface::CalculateElasticMatrix or InterfacePlaneStrain::CalculateElasticMatrix, we can use the return value of member GetNumberOfNormalComponents to supply the value for this new argument. And then we can remove the assignment here at line 27 (i.e. delete result(2, 2) = result(1, 1);).
The implementation of ConstitutiveLawUtilities::MakeInterfaceConstitutiveMatrix needs to be modified as well. For instance:
Matrix ConstitutiveLawUtilities::MakeInterfaceConstitutiveMatrix(double NormalStiffness,
double ShearStiffness,
std::size_t TractionSize,
std::size_t NumberOfNormalComponents)
{
auto result = Matrix{ZeroMatrix{TractionSize, TractionSize}};
for (auto i = std::size_t{0}; i < NumberOfNormalComponents; ++i) result(i, i) = NormalStiffness;
for (auto i = NumberOfNormalComponents; i < TractionSize; ++i) result(i, i) = ShearStiffness;
return result;
}
...cation/tests/cpp_tests/custom_constitutive/test_incremental_linear_elastic_interface_law.cpp
Outdated
Show resolved
Hide resolved
avdg81
left a comment
There was a problem hiding this comment.
Hi Gennady,
Thanks a lot for processing the review suggestions. It looks really good to me. I have two more very minor suggestions. So I think we're almost ready to merge this work.
| const Vector& rInitialRelativeDisplacement, | ||
| const Vector& rInitialTraction) |
There was a problem hiding this comment.
Perhaps we can add "Expected" to the function parameter names to make clearer what it means:
| const Vector& rInitialRelativeDisplacement, | |
| const Vector& rInitialTraction) | |
| const Vector& rExpectedInitialRelativeDisplacement, | |
| const Vector& rExpectedInitialTraction) |
| EXPECT_FALSE(std::is_copy_constructible_v<GeoIncrementalLinearElasticInterfaceLaw>); | ||
| EXPECT_FALSE(std::is_copy_assignable_v<GeoIncrementalLinearElasticInterfaceLaw>); | ||
| EXPECT_TRUE(std::is_move_constructible_v<GeoIncrementalLinearElasticInterfaceLaw>); | ||
| EXPECT_TRUE(std::is_move_assignable_v<GeoIncrementalLinearElasticInterfaceLaw>); |
There was a problem hiding this comment.
I really like these checks. But since they are verified at compile time, I'd suggest to move them to the implementation file of the incremental linear elastic constitutive law for interfaces. See for an example the lines near the bottom of file applications/GeoMechanicsApplication/custom_constitutive/small_strain_udsm_2D_interface_law.cpp.
There was a problem hiding this comment.
Thank you for pointing. Done
avdg81
left a comment
There was a problem hiding this comment.
This PR looks ready to go. Thanks for all the work Gennady.
📝 Description
A brief description of the PR.
Please mark the PR with appropriate tags: