From 74ee37788e13d3177f73542c7774de4e18162449 Mon Sep 17 00:00:00 2001 From: Jonah Miller Date: Fri, 3 Jan 2025 16:55:04 -0700 Subject: [PATCH] is it because rho is uninitialized? --- singularity-eos/eos/eos_base.hpp | 3 --- test/eos_unit_test_helpers.hpp | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/singularity-eos/eos/eos_base.hpp b/singularity-eos/eos/eos_base.hpp index 723cbef461..950a5d1e63 100644 --- a/singularity-eos/eos/eos_base.hpp +++ b/singularity-eos/eos/eos_base.hpp @@ -874,14 +874,11 @@ 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); diff --git a/test/eos_unit_test_helpers.hpp b/test/eos_unit_test_helpers.hpp index 80db84884b..3b73e57481 100644 --- a/test/eos_unit_test_helpers.hpp +++ b/test/eos_unit_test_helpers.hpp @@ -150,7 +150,8 @@ CheckRhoSieFromPT(EOS eos, Real rho, Real T, Indexer_t &&lambda = static_cast(nullptr)) { const Real P = eos.PressureFromDensityTemperature(rho, T, lambda); const Real sie = eos.InternalEnergyFromDensityTemperature(rho, T, lambda); - Real rtest, etest; + Real rtest = 12; // set these to something + Real etest = 1; eos.DensityEnergyFromPressureTemperature(P, T, lambda, rtest, etest); Real P_test = eos.PressureFromDensityTemperature(rtest, T, lambda); Real residual = P_test - P;