From 5f8e8e0e5732fab2db886733a36a2626e97ac668 Mon Sep 17 00:00:00 2001 From: Jonah Miller Date: Fri, 3 Jan 2025 16:43:52 -0700 Subject: [PATCH] choose worse, but more generic guess... does that help? --- singularity-eos/eos/eos_base.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/singularity-eos/eos/eos_base.hpp b/singularity-eos/eos/eos_base.hpp index d662d8049b..723cbef461 100644 --- a/singularity-eos/eos/eos_base.hpp +++ b/singularity-eos/eos/eos_base.hpp @@ -854,7 +854,6 @@ class EosBase { DensityEnergyFromPressureTemperature(const Real press, const Real temp, Indexer_t &&lambda, Real &rho, Real &sie) const { using RootFinding1D::findRoot; // more robust but slower. Better default. - using RootFinding1D::regula_falsi; using RootFinding1D::Status; // Pressure is not monotone in density at low densities, which can @@ -875,11 +874,14 @@ class EosBase { }; Real rhoguess = rho; // use input density if ((rhoguess <= rhomin) || (rhoguess >= rhomax)) { // avoid edge effects + /* if ((rhomin < DEFAULT_RHO_GUESS) && (DEFAULT_RHO_GUESS < rhomax)) { rhoguess = DEFAULT_RHO_GUESS; } else { rhoguess = 0.5 * (rhomin + rhomax); } + */ + rhoguess = 0.5 * (rhomin + rhomax); } auto status = findRoot(PofRT, press, rhoguess, rhomin, rhomax, robust::EPS(), robust::EPS(), rho);