From 5ff0173cb54e9ef687c2e34e95ae3a3efb302306 Mon Sep 17 00:00:00 2001
From: Anthony <dhun@uliege.be>
Date: Fri, 17 Mar 2023 18:31:11 +0100
Subject: [PATCH] first push

---
 NonLinearSolver/materialLaw/mlawHyperelastic.cpp | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/NonLinearSolver/materialLaw/mlawHyperelastic.cpp b/NonLinearSolver/materialLaw/mlawHyperelastic.cpp
index 60d192e0a..bcecf02a5 100644
--- a/NonLinearSolver/materialLaw/mlawHyperelastic.cpp
+++ b/NonLinearSolver/materialLaw/mlawHyperelastic.cpp
@@ -859,7 +859,7 @@ void mlawPowerYieldHyper::predictorCorrector_nonAssociatedFlow(const STensor3& F
       q1->getRefToDissipationActive() = true;
        // plasticity
       int ite = 0;
-      int maxite = 100; // maximal number of iters
+      int maxite = 1000; // maximal number of iters
 
 
       //Msg::Error("plasticity occurs f = %e",f);
@@ -919,8 +919,13 @@ void mlawPowerYieldHyper::predictorCorrector_nonAssociatedFlow(const STensor3& F
 
         if(ite > maxite){
           Msg::Error("No convergence for plastic correction in mlawPowerYieldHyper nonAssociatedFlow Maxwell iter = %d, f = %e!!",ite,f);
-          P(0,0) = P(1,1) = P(2,2) = sqrt(-1.);
-          return;
+	  if(fabs(f)<100.*_tol)
+	    break;
+	  else
+	  {
+            P(0,0) = P(1,1) = P(2,2) = sqrt(-1.);
+            return;
+	  }
         }
       };
 
-- 
GitLab