38 static constexpr int IMAX = 541;
39 static constexpr int JMAX = 201;
46 template <
typename T, std::
size_t J, std::
size_t I>
47 using array2D = std::array<std::array<T, J>, I>;
54 const double dlo = -12.0,
dhi = 15.0;
144 os <<
"HELMTable not loaded\n";
147 double tMin = std::numeric_limits<double>::max(), tMax = std::numeric_limits<double>::lowest();
148 double dMin = std::numeric_limits<double>::max(), dMax = std::numeric_limits<double>::lowest();
150 for (
const auto& temp : table.
t) {
151 if (temp < tMin) tMin = temp;
152 if (temp > tMax) tMax = temp;
155 for (
const auto& dens : table.
d) {
156 if (dens < dMin) dMin = dens;
157 if (dens > dMax) dMax = dens;
160 os <<
"HELMTable Data:\n";
161 os <<
" imax: " << table.
imax <<
", jmax: " << table.
jmax <<
"\n";
162 os <<
" Temperature Range: [" << tMin <<
", " << tMax <<
"]\n";
163 os <<
" Density Range: [" << dMin <<
", " << dMax <<
"]\n";
183 os <<
"HELMEOSInput Data:\n";
184 os <<
" Temperature: " << eosInput.
T <<
"\n";
185 os <<
" Density: " << eosInput.
rho <<
"\n";
186 os <<
" Mean Atomic Mass: " << eosInput.
abar <<
"\n";
187 os <<
" Mean Atomic Number: " << eosInput.
zbar <<
"\n";
216 os <<
"EOS Data:\n" << std::setw(20) << std::left;
217 os <<
" Electron Fraction: " << std::format(
"{0:24.16e}",
eos.ye) <<
"\n";
218 os <<
" Electron Chemical Potential: " << std::format(
"{0:24.16e}",
eos.etaele) <<
"\n";
219 os <<
" Electron Number Density: " << std::format(
"{0:24.16e}",
eos.xnefer) <<
"\n";
220 os <<
" Total Pressure: " << std::format(
"{0:24.16e}",
eos.ptot) <<
"\n";
221 os <<
" dPres/dRho: " << std::format(
"{0:24.16e}",
eos.dpresdd) <<
"\n";
222 os <<
" dPres/dT: " << std::format(
"{0:24.16e}",
eos.dpresdt) <<
"\n";
223 os <<
" Gas Pressure: " << std::format(
"{0:24.16e}",
eos.pgas) <<
"\n";
224 os <<
" Radiation Pressure: " << std::format(
"{0:24.16e}",
eos.prad) <<
"\n";
225 os <<
" Total Energy: " << std::format(
"{0:24.16e}",
eos.etot) <<
"\n";
226 os <<
" dEner/dRho: " << std::format(
"{0:24.16e}",
eos.denerdd) <<
"\n";
227 os <<
" dEner/dT: " << std::format(
"{0:24.16e}",
eos.denerdt) <<
"\n";
228 os <<
" Gas Energy: " << std::format(
"{0:24.16e}",
eos.egas) <<
"\n";
229 os <<
" Radiation Energy: " << std::format(
"{0:24.16e}",
eos.erad) <<
"\n";
230 os <<
" Total Entropy: " << std::format(
"{0:24.16e}",
eos.stot) <<
"\n";
231 os <<
" dEntr/dRho: " << std::format(
"{0:24.16e}",
eos.dentrdd) <<
"\n";
232 os <<
" dEntr/dT: " << std::format(
"{0:24.16e}",
eos.dentrdt) <<
"\n";
233 os <<
" Gas Entropy: " << std::format(
"{0:24.16e}",
eos.sgas) <<
"\n";
234 os <<
" Radiation Entropy: " << std::format(
"{0:24.16e}",
eos.srad);
246 double psi0(
double z);
253 double dpsi0(
double z);
267 double psi1(
double z);
274 double dpsi1(
double z);
288 double psi2(
double z);
295 double dpsi2(
double z);
309 double xpsi0(
double z);
323 double xpsi1(
double z);
345 double h3(
const std::array<double, 36> &fi,
const double w0t,
const double w1t,
const double w0mt,
const double w1mt,
346 const double w0d,
const double w1d,
const double w0md,
const double w1md);
365 double h5(
const std::array<double, 36> &fi,
const double w0t,
const double w1t,
const double w2t,
const double w0mt,
366 const double w1mt,
const double w2mt,
const double w0d,
const double w1d,
const double w2d,
367 const double w0md,
const double w1md,
const double w2md);
374 std::unique_ptr<HELMTable>
read_helm_table(
const std::string& filename);
382 HELMEOSOutput
get_helm_EOS(HELMEOSInput &q,
const HELMTable &table);
Defines a macro for triggering a breakpoint in different compilers and platforms.
double ddpsi1(const double z)
Second derivative of the interpolating polynomial function psi1.
double psi0(const double z)
Interpolating polynomial function psi0.
double dpsi0(const double z)
Derivative of the interpolating polynomial function psi0.
double psi1(const double z)
Interpolating polynomial function psi1.
static constexpr int IMAX
double xdpsi1(const double z)
Derivative of the interpolating polynomial function xpsi1.
double h3(const std::array< double, 36 > &fi, const double w0t, const double w1t, const double w0mt, const double w1mt, const double w0d, const double w1d, const double w0md, const double w1md)
Interpolating polynomial function h3.
double ddpsi2(const double z)
Second derivative of the interpolating polynomial function psi2.
double h5(const std::array< double, 36 > &fi, const double w0t, const double w1t, const double w2t, const double w0mt, const double w1mt, const double w2mt, const double w0d, const double w1d, const double w2d, const double w0md, const double w1md, const double w2md)
Interpolating polynomial function h5.
double xdpsi0(const double z)
Derivative of the interpolating polynomial function xpsi0.
static constexpr int JMAX
double dpsi2(const double z)
Derivative of the interpolating polynomial function psi2.
double dpsi1(const double z)
Derivative of the interpolating polynomial function psi1.
double xpsi1(const double z)
Interpolating polynomial function xpsi1.
double ddpsi0(const double z)
Second derivative of the interpolating polynomial function psi0.
void heap_deallocate_contiguous_2D_memory(double **array)
double xpsi0(const double z)
Interpolating polynomial function xpsi0.
double ** heap_allocate_contiguous_2D_memory(const int rows, const int cols)
std::array< std::array< T, J >, I > array2D
2D array template alias.
serif::eos::helmholtz::HELMEOSOutput get_helm_EOS(serif::eos::helmholtz::HELMEOSInput &q, const serif::eos::helmholtz::HELMTable &table)
Calculate the Helmholtz EOS components.
double psi2(const double z)
Interpolating polynomial function psi2.
std::unique_ptr< HELMTable > read_helm_table(const std::string &filename)
Read the Helmholtz EOS table from a file.
friend std::ostream & operator<<(std::ostream &os, const helmholtz::HELMEOSOutput &eos)
Structure to hold the Helmholtz EOS table data.
friend std::ostream & operator<<(std::ostream &os, const helmholtz::HELMTable &table)