[GeoMechanicsApplication] Let the K0 procedure process also accept GEO_FRICTION_ANGLE as optional input#14352
Conversation
WPK4FEM
left a comment
There was a problem hiding this comment.
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? |
WPK4FEM
left a comment
There was a problem hiding this comment.
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
| 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; |
There was a problem hiding this comment.
This check also appear on lines 114 to 116. I would propose do the domain check [0, 90] after the if statement is completed.
| 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 ) .... |
There was a problem hiding this comment.
I've made almost as you proposed. I've also removed a duplication in a similar situation in apply_k0_process.
markelov208
left a comment
There was a problem hiding this comment.
Hi Wijtze Pieter, thank you very much for the prompt review.
| 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; |
There was a problem hiding this comment.
I've made almost as you proposed. I've also removed a duplication in a similar situation in apply_k0_process.
WPK4FEM
left a comment
There was a problem hiding this comment.
Thank you for the better checking. Sorry that I have more nagging when re-reading.
Regards, Wijtze Pieter
| 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; |
There was a problem hiding this comment.
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 << "." |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
added prints of property Id.
| KRATOS_ERROR_IF(phi < 0.0 || phi > 90.0) | ||
| << phi_name << " (" << phi << ") should be between 0 and 90 degrees for element " | ||
| << ElementId << "." << std::endl; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
added prints of property Id.
WPK4FEM
left a comment
There was a problem hiding this comment.
For me this is complete.
Thank you,
Wijtze Pieter
📝 Description
A brief description of the PR.
GEO_FRICTION_ANGLEinApplyK0ProcedureProcessHasFrictionAngleandValidateFrictionAngleinConstitutiveLawUtilitiesGEO_FRICTION_ANGLEuse inREADME.md