From e32c9cd7934c62df3ea47899bf5be3a37797384d Mon Sep 17 00:00:00 2001 From: forbes Date: Sun, 1 Feb 2026 21:10:12 -0600 Subject: [PATCH] fix: use previous iteration dxNorm in convergence check isConvergedToNumericalLimit() compared dxNorms->at(iterNo) to itself instead of comparing current vs previous iteration. This prevented the solver from detecting convergence improvement, causing it to exhaust its iteration limit on assemblies with many constraints. Fix: read dxNorms->at(iterNo - 1) for the previous iteration's norm. --- OndselSolver/NewtonRaphson.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OndselSolver/NewtonRaphson.cpp b/OndselSolver/NewtonRaphson.cpp index f73c55f..2023125 100644 --- a/OndselSolver/NewtonRaphson.cpp +++ b/OndselSolver/NewtonRaphson.cpp @@ -112,7 +112,7 @@ bool NewtonRaphson::isConvergedToNumericalLimit() size_t nDivergenceMax = 3; auto dxNormIterNo = dxNorms->at(iterNo); if (iterNo > 0) { - auto dxNormIterNoOld = dxNorms->at(iterNo); + auto dxNormIterNoOld = dxNorms->at(iterNo - 1); auto farTooLargeError = dxNormIterNo > tooLargeTol; auto worthIterating = dxNormIterNo > (smallEnoughTol * pow(10.0, (iterNo / iterMax) * nDecade)); bool stillConverging;