Skip to content

Commit

Permalink
Merge pull request #303 from lanl/hls/fix-helm-test
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurlungur authored Sep 13, 2023
2 parents f9360ad + e0d99dc commit d745d76
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions test/test_eos_helmholtz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,26 +101,23 @@ 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) {
Real ein =
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 =
eos.BulkModulusFromDensityTemperature(rho_in[i], temp_in[j], lambda);
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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit d745d76

Please sign in to comment.