Skip to content

Commit 625f215

Browse files
committed
Fix condition to exit loop
1 parent 6a05d92 commit 625f215

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/ImprovedJacobiConstraintSolver.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,15 @@ void ImprovedJacobiConstraintSolver::doSolve( SReal timeout)
141141

142142
}
143143

144-
if (current_cp->allVerified && constraintsAreVerified)
144+
if (current_cp->allVerified)
145145
{
146-
convergence = true;
147-
return;
146+
if (constraintsAreVerified)
147+
{
148+
convergence = true;
149+
break;
150+
}
148151
}
149-
150-
if(error < tol && i > 0) // do not stop at the first iteration (that is used for initial guess computation)
152+
else if(error < tol && i > 0) // do not stop at the first iteration (that is used for initial guess computation)
151153
{
152154
convergence = true;
153155
break;

0 commit comments

Comments
 (0)