Skip to content

[GeoMechanicsApplication] Let the K0 procedure process also accept GEO_FRICTION_ANGLE as optional input#14352

Merged
markelov208 merged 18 commits intomasterfrom
geo/14351-GEO_FRICTION_ANGLE-in-K0
Apr 14, 2026
Merged

[GeoMechanicsApplication] Let the K0 procedure process also accept GEO_FRICTION_ANGLE as optional input#14352
markelov208 merged 18 commits intomasterfrom
geo/14351-GEO_FRICTION_ANGLE-in-K0

Conversation

@markelov208
Copy link
Copy Markdown
Contributor

@markelov208 markelov208 commented Apr 10, 2026

📝 Description

A brief description of the PR.

  • added check for GEO_FRICTION_ANGLE in ApplyK0ProcedureProcess
  • added two helper functions: HasFrictionAngle and ValidateFrictionAngle in ConstitutiveLawUtilities
  • added unit tests for these functions
  • added description of GEO_FRICTION_ANGLE use in README.md

@markelov208 markelov208 self-assigned this Apr 10, 2026
@markelov208 markelov208 requested a review from a team as a code owner April 10, 2026 09:34
Copy link
Copy Markdown
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.

Hi Gennady,
Thank you for your fast actions on this matter, I think it almost ready to go ( but I still need to look better at the unit tests ).
Please have a look at the remark of switching the order of check GEO_FRICTION_ANGLE and the UMAT stuff.
Thank you, Wijtze Pieter

@markelov208
Copy link
Copy Markdown
Contributor Author

Hi Gennady, Thank you for your fast actions on this matter, I think it almost ready to go ( but I still need to look better at the unit tests ). Please have a look at the remark of switching the order of check GEO_FRICTION_ANGLE and the UMAT stuff. Thank you, Wijtze Pieter

Hi Wijtze Pieter, unit tests are coming. The order, what shall be check first? GEO_FRICTION_ANGLE?

@markelov208 markelov208 requested review from WPK4FEM and avdg81 April 10, 2026 12:56
Copy link
Copy Markdown
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.

Hi Gennady,

Thank you for completing the functionality and fixing my spelling mistakes. I have one request to avoid repetition of the phi bounds check in the constitutive_law_utitlities. Otherwise I think this is good to go.

Regards, Wijtze Pieter

Comment on lines +99 to +101
KRATOS_ERROR_IF(phi < 0.0 || phi > 90.0)
<< "GEO_FRICTION_ANGLE (" << phi << ") should be between 0 and 90 degrees for element "
<< ElementId << "." << std::endl;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This check also appear on lines 114 to 116. I would propose do the domain check [0, 90] after the if statement is completed.

Suggested change
KRATOS_ERROR_IF(phi < 0.0 || phi > 90.0)
<< "GEO_FRICTION_ANGLE (" << phi << ") should be between 0 and 90 degrees for element "
<< ElementId << "." << std::endl;
double phi;
if (rProperties.Has(GEO_FRICTION_ANGLE)){
phi = ;
} else if (rProperties.Has(INDEX_OF_UMAT_PHI_PARAMETER) || rProperties.Has(UMAT_PARAMETERS)){
phi = ;
} else {
error ;
}
KRATOS_ERROR_IF( phi < 0.0 || phi > 90.0 ) ....

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've made almost as you proposed. I've also removed a duplication in a similar situation in apply_k0_process.

Copy link
Copy Markdown
Contributor Author

@markelov208 markelov208 left a comment

Choose a reason for hiding this comment

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

Hi Wijtze Pieter, thank you very much for the prompt review.

Comment on lines +99 to +101
KRATOS_ERROR_IF(phi < 0.0 || phi > 90.0)
<< "GEO_FRICTION_ANGLE (" << phi << ") should be between 0 and 90 degrees for element "
<< ElementId << "." << std::endl;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've made almost as you proposed. I've also removed a duplication in a similar situation in apply_k0_process.

@markelov208 markelov208 requested a review from WPK4FEM April 13, 2026 12:39
Copy link
Copy Markdown
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.

Thank you for the better checking. Sorry that I have more nagging when re-reading.
Regards, Wijtze Pieter

Comment on lines +104 to +110
std::ostringstream valid_values;
for (std::size_t i = 0; i < dimension; ++i) {
if (i > 0) {
if (i == dimension - 1) valid_values << " or ";
else valid_values << ", ";
}
valid_values << i;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks like a valid thing to do, but I have some doubts. Plane strain is a 2D analysis, but it still has 3 normal stress components and the K0_MAIN_DIRECTION can be any of 1, 2, or 3 ( out of plane ).
For plane stress analysis, where you have only in plane stresses and it really is a 2D thing, you would be right. However geo-mechanics is plane strain or three-dimensional analysis and hardly ever plane stress analysis.


KRATOS_ERROR_IF(phi_index < 1 || phi_index > number_of_umat_parameters)
<< "INDEX_OF_UMAT_PHI_PARAMETER (" << phi_index
<< ") is not in range [1, size of UMAT_PARAMETERS] for element " << ElementId << "."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The property Id would be more helpful to the user here than the element Id. With the property Id, you can directly find the input. For an element you would first need to look up the property Id used for that element, before you can fix the mistake.
If very precise, we could print both element and property Id in the message.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added prints of property Id.

Comment on lines +120 to +122
KRATOS_ERROR_IF(phi < 0.0 || phi > 90.0)
<< phi_name << " (" << phi << ") should be between 0 and 90 degrees for element "
<< ElementId << "." << std::endl;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same remark as the previous about the property Id being more useful than the element Id.
Otherwise this structure is exactly what I asked for, thank you.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added prints of property Id.

@markelov208 markelov208 requested a review from WPK4FEM April 14, 2026 07:31
Copy link
Copy Markdown
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.

For me this is complete.
Thank you,
Wijtze Pieter

@markelov208 markelov208 merged commit 72cf280 into master Apr 14, 2026
10 checks passed
@markelov208 markelov208 deleted the geo/14351-GEO_FRICTION_ANGLE-in-K0 branch April 14, 2026 08:55
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] Let the K0 procedure process also accept GEO_FRICTION_ANGLE as optional input

2 participants