Repository navigation
[GeoMechanicsApplication] geomechanics_residual_criteria - #14910
markelov208 wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Counting unreduced master residuals can prevent Newton–Raphson convergence at constrained equilibrium.
1 open issue
What changed in this PR
Introduces a GeoMechanics-specific residual criterion to replace the core constraint utility’s active-DOF masking.
Changes:
- Keeps master DOFs active while excluding fixed and active slave DOFs.
- Switches the convergence factory to the new criterion.
- Adds a focused masking test.
| File | Description |
|---|---|
| applications/GeoMechanicsApplication/tests/cpp_tests/custom_utilities/test_geomechanics_residual_criteria.cpp | Tests fixed, master, and active/inactive slave masking. |
| applications/GeoMechanicsApplication/custom_utilities/geomechanics_residual_criteria.hpp | Implements application-specific residual masking. |
| applications/GeoMechanicsApplication/custom_utilities/convergence_criteria_factory.hpp | Selects the new residual criterion. |
Review effort: Balanced
WPK4FEM
left a comment
There was a problem hiding this comment.
Hi Gennady,
This indeed overrules the function that causes the zero count of D.o.F., but still marks master D.o.F. as inactive. That leads to the same ( in my eyes wrong ) behaviour.
Regards, Wijtze Pieter
| for (const auto& r_constraint : rModelPart.MasterSlaveConstraints()) { | ||
| if (r_constraint.IsActive()) { | ||
| for (const auto& p_master_dof : r_constraint.GetMasterDofsVector()) { | ||
| this->mActiveDofs[p_master_dof->EquationId()] = 0; |
There was a problem hiding this comment.
This marks the master D.o.F. as inactive, just like currently the Kratos::ConstraintUtilities::ComputeActiveDofs( ) and Kratos::ConstraintUtilities::DistributedComputeActiveDofs( ) do. With this I still end up with an empty list of active D.o.F. where I try to reduce a system to only active master D.o.F. and all other D.o.F. marked as slave D.o.F. As a result of that on line 200 of residual_criteria.h size_residual will become 0 and line 210 will be a division by zero.
There was a problem hiding this comment.
Thank you very much for the review. These lines are added due to the Copilot review on GeoMechanicsNewtonRaphsonStrategy. Now it is getting more clear. The updated version considers quasi_newton as constraint-reduced residual and keeps the original logic for raw RHS.

created geomechanics_residual_criteria to avoid using kratos/utilities/constraint_utilities.cpp