Skip to content

Commit

Permalink
make sure we are actually getting lines from helm_table.dat (#1355)
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Oct 13, 2023
1 parent 657406d commit 9a858fe
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions EOS/helmholtz/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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];
Expand All @@ -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];
Expand All @@ -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];
Expand Down

0 comments on commit 9a858fe

Please sign in to comment.