From e0d99dc407fb11e7cef838be17a6ab3e5cfe064d Mon Sep 17 00:00:00 2001 From: Alexander Holas Date: Tue, 12 Sep 2023 10:37:39 +0200 Subject: [PATCH] Fix lambda shape --- test/test_eos_helmholtz.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/test_eos_helmholtz.cpp b/test/test_eos_helmholtz.cpp index 32d27fe073..b1048ee5c8 100644 --- a/test/test_eos_helmholtz.cpp +++ b/test/test_eos_helmholtz.cpp @@ -101,7 +101,7 @@ SCENARIO("Helmholtz equation of state - Table interpolation (tgiven)", "[Helmhol 4.1219845464736737e-01, }; - Real lambda[2] = {4.0, 2.0}; + Real lambda[3] = {4.0, 2.0, -1.0}; int k = 0; for (int i = 0; i < 4; ++i) { for (int j = 0; j < 4; ++j) { @@ -109,11 +109,6 @@ SCENARIO("Helmholtz equation of state - Table interpolation (tgiven)", "[Helmhol eos.InternalEnergyFromDensityTemperature(rho_in[i], temp_in[j], lambda); Real press = eos.PressureFromDensityTemperature(rho_in[i], temp_in[j], lambda); - // Do not move these checks! I don't know why but if you check all at - // once at the end, rho_in[0] is not accessed correctly. - if (!isClose(ein, ein_ref[k], 1e-10)) nwrong += 1; - if (!isClose(press, press_ref[k], 1e-10)) nwrong += 1; - Real cv = eos.SpecificHeatFromDensityTemperature(rho_in[i], temp_in[j], lambda); Real bulkmod = @@ -121,6 +116,8 @@ SCENARIO("Helmholtz equation of state - Table interpolation (tgiven)", "[Helmhol Real gruen = eos.GruneisenParamFromDensityTemperature(rho_in[i], temp_in[j], lambda); + if (!isClose(ein, ein_ref[k], 1e-10)) nwrong += 1; + if (!isClose(press, press_ref[k], 1e-10)) nwrong += 1; if (!isClose(cv, cv_ref[k], 1e-6)) nwrong += 1; if (!isClose(bulkmod, bulkmod_ref[k], 1e-8)) nwrong += 1; if (!isClose(gruen, gruen_ref[k], 1e-6)) nwrong += 1; @@ -167,7 +164,7 @@ SCENARIO("Helmholtz equation of state - Root finding (egiven)", "[HelmholtzEOS]" 2.0378412737252767e+18, }; - Real lambda[2] = {4.0, 2.0}; + Real lambda[3] = {4.0, 2.0, -1.0}; int k = 0; for (int i = 0; i < 4; ++i) { for (int j = 0; j < 4; ++j) {