From 7d92f3c59c08a418c36384237acdecfcba27fe33 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Fri, 13 Oct 2023 12:42:50 -0400 Subject: [PATCH] make sure we are actually getting lines from helm_table.dat --- EOS/helmholtz/actual_eos.H | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/EOS/helmholtz/actual_eos.H b/EOS/helmholtz/actual_eos.H index 51e7da22d9..88cb4ffb0d 100644 --- a/EOS/helmholtz/actual_eos.H +++ b/EOS/helmholtz/actual_eos.H @@ -1364,6 +1364,9 @@ void actual_eos_init () for (int j = 0; j < jmax; ++j) { for (int i = 0; i < imax; ++i) { std::getline(table, line); + if (line.empty()) { + amrex::Error("Error reading free energy from helm_table.dat"); + } std::istringstream data(line); data >> f_local[idx] >> f_local[idx+3] >> f_local[idx+1] >> f_local[idx+4] >> f_local[idx+2] >> f_local[idx+5] @@ -1377,6 +1380,9 @@ void actual_eos_init () for (int j = 0; j < jmax; ++j) { for (int i = 0; i < imax; ++i) { std::getline(table, line); + if (line.empty()) { + amrex::Error("Error reading pressure derivative from helm_table.dat"); + } std::istringstream data(line); data >> dpdf_local[idx] >> dpdf_local[idx+2] >> dpdf_local[idx+1] >> dpdf_local[idx+3]; @@ -1389,6 +1395,9 @@ void actual_eos_init () for (int j = 0; j < jmax; ++j) { for (int i = 0; i < imax; ++i) { std::getline(table, line); + if (line.empty()) { + amrex::Error("Error reading electron chemical potential from helm_table.dat"); + } std::istringstream data(line); data >> ef_local[idx] >> ef_local[idx+2] >> ef_local[idx+1] >> ef_local[idx+3]; @@ -1401,6 +1410,9 @@ void actual_eos_init () for (int j = 0; j < jmax; ++j) { for (int i = 0; i < imax; ++i) { std::getline(table, line); + if (line.empty()) { + amrex::Error("Error reading number density from helm_table.dat"); + } std::istringstream data(line); data >> xf_local[idx] >> xf_local[idx+2] >> xf_local[idx+1] >> xf_local[idx+3];