From aaea1b933ca0f6037f154e2f7a83c362c7124c17 Mon Sep 17 00:00:00 2001 From: logari81 Date: Thu, 17 Nov 2011 19:58:45 +0000 Subject: [PATCH] + try to make the SQP solver in the Sketcher more robust git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5148 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d --- src/Mod/Sketcher/App/freegcs/GCS.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Mod/Sketcher/App/freegcs/GCS.cpp b/src/Mod/Sketcher/App/freegcs/GCS.cpp index 5ca29a71c..fb8c78f2a 100644 --- a/src/Mod/Sketcher/App/freegcs/GCS.cpp +++ b/src/Mod/Sketcher/App/freegcs/GCS.cpp @@ -984,11 +984,15 @@ int System::solve(SubSystem *subsysA, SubSystem *subsysB, bool isFine) break; } alpha = tau * alpha; + if (alpha < 1e-8) // let the linesearch fail + alpha = 0.; x = x0 + alpha * xdir; subsysA->setParams(plist,x); subsysB->setParams(plist,x); subsysA->calcResidual(resA); f = subsysB->error() + mu * resA.lpNorm<1>(); + if (alpha < 1e-8) // let the linesearch fail + break; } lambda = lambda0 + alpha * lambdadir;