Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make sure we are actually getting lines from helm_table.dat #1355

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading