Merge pull request #22 from tboudreaux/fix/exp10-libc++
fix(helm.cpp): exp10(x) changed to pow(10, x)
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <stdexcept>
|
||||
#include <array>
|
||||
#include <numbers>
|
||||
#include <cerrno>
|
||||
|
||||
|
||||
#include "helm.h"
|
||||
@@ -111,14 +112,15 @@ namespace helmholtz {
|
||||
int i, j;
|
||||
|
||||
//set T and Rho (d) arrays
|
||||
for (j=0; j<table.jmax; j++) { table.t[j] = exp10(tlo + tstp*j); }
|
||||
for (j=0; j<table.jmax; j++) { table.t[j] = pow(10, tlo + tstp*j); }
|
||||
|
||||
for (i=0; i<table.imax; i++) { table.d[i] = exp10(dlo + dstp*i); }
|
||||
for (i=0; i<table.imax; i++) { table.d[i] = pow(10, dlo + dstp*i); }
|
||||
|
||||
ifstream helm_table(filename);
|
||||
if (!helm_table) {
|
||||
LOG_ERROR(logger, "read_helm_table : Error opening file {}", filename);
|
||||
throw std::runtime_error("Error opening file " + filename);
|
||||
int errorCode = errno;
|
||||
LOG_ERROR(logger, "read_helm_table : Error ({}) opening file {}", errorCode, filename);
|
||||
throw std::runtime_error("Error (" + std::to_string(errorCode) + ") opening file " + filename);
|
||||
}
|
||||
//read the Helmholtz free energy and its derivatives
|
||||
for (j=0; j<table.jmax; j++) {
|
||||
@@ -820,4 +822,4 @@ namespace helmholtz {
|
||||
return eos;
|
||||
// TODO: In future this might be made more preformant by avoiding the copy.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user