From 36a56093d13bd039767db1a628986815253400ac Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Mon, 15 Aug 2011 03:57:40 +0000 Subject: [PATCH] Buf fixes for handling boundaries. --- Cantera/src/numerics/RootFind.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cantera/src/numerics/RootFind.cpp b/Cantera/src/numerics/RootFind.cpp index 622a158cf..1b61f1779 100644 --- a/Cantera/src/numerics/RootFind.cpp +++ b/Cantera/src/numerics/RootFind.cpp @@ -772,14 +772,14 @@ namespace Cantera { if (xnew < xmin) { bottomBump++; if (bottomBump < 3) { - xnew = x2 + (x2 - xmin) / 2.0; + xnew = x2 - (x2 - xmin) / 2.0; } else { if (x2 == xmin || x1 == xmin) { // we are here when we are bumping against the bottom limit. // No further action is possible if (xnew < xmin) { slope = (f2 - f1) / delXtmp; - xmin = x2 - f2 / slope; + xnew = x2 - f2 / slope; if (xnew < xmin) { retn = ROOTFIND_SOLNLOWERTHANXMIN; *xbest = xnew;