71 eos.polyk = 2.0 / 3.0 * RK2;
73 bool use_krome =
false;
74 int maxvxyzu = (eos.gamma != 1.) ? 4 : 3;
81 logger::raw_ln(sham::format(
"adiabatic eos: gamma = {}", eos.gamma));
86 "setting isothermal sound speed^2 (polyk) = {}, gamma = {}",
89 if (eos.polyk <= std::numeric_limits<f64>::epsilon()) {
91 sham::format(
"WARNING! sound speed zero in dump!, polyk = {}", eos.polyk));
101 if (std::abs(eos.gamma - 1.0) > std::numeric_limits<f64>::epsilon() && maxvxyzu < 4) {
104 "WARNING! compiled for isothermal equation of state but gamma /= 1, gamma={}",
108 if (ieos == 3 || ieos == 6 || ieos == 7) {
109 if (eos.qfacdisc <= std::numeric_limits<f64>::epsilon()) {
123 if (std::abs(eos.qfacdisc2) <= std::numeric_limits<f64>::epsilon()) {
137namespace shammodels::sph::phdump {
144 if (ieos_dump != ieos) {
146 "You are querying phantom dump eos {} parameters, even though ieos is {}",
165 EOSPhConfig eos = read_headeropts_eos(dump, 1);
167 cs = sycl::sqrt(eos.polyk);
176 write_headeropts_eos(1, dump, eos);
197 EOSPhConfig eos = read_headeropts_eos(dump, 2);
208 write_headeropts_eos(2, dump, eos);
230 EOSPhConfig eos = read_headeropts_eos(dump, 3);
232 cs0 = sycl::sqrt(eos.polyk);
240 eos.polyk = cs0 * cs0 / (r0 * r0);
244 write_headeropts_eos(3, dump, eos);
260 EOSPhConfig eos = read_headeropts_eos(dump, 13);
262 cs0 = sycl::sqrt(eos.polyk);
270 eos.polyk = cs0 * cs0 / (r0 * r0);
274 write_headeropts_eos(13, dump, eos);
288 EOSPhConfig eos = read_headeropts_eos(dump, 14);
290 cs0 = sycl::sqrt(eos.polyk);
298 eos.polyk = cs0 * cs0 / (r0 * r0);
302 write_headeropts_eos(14, dump, eos);
void assert_ieos_val(const PhantomDump &dump, int ieos)
Check that the eos in the dump is the expected one.
void eos2_write(PhantomDump &dump, const f64 &gamma)
Write the EOS2 to the phantom dump.
void eos1_write(PhantomDump &dump, const f64 &cs)
Write the EOS1 to the phantom dump.
void eos2_load(const PhantomDump &dump, f64 &gamma)
Load the EOS2 from the phantom dump.
void eos13_write(PhantomDump &dump, const f64 &cs0, const f64 &q, const f64 &r0)
Write the EOS13 to the phantom dump.
void eos3_load(const PhantomDump &dump, f64 &cs0, f64 &q, f64 &r0)
Load the EOS3 from the phantom dump.
bool is_maxvxyzu_at_least_4(const PhantomDump &dump)
check if alphau is set in the header, which is the case for (maxvxyzu >= 4)
void eos13_load(const PhantomDump &dump, f64 &cs0, f64 &q, f64 &r0)
Load the EOS13 from the phantom dump.
void eos14_write(PhantomDump &dump, const f64 &cs0, const f64 &q, const f64 &r0)
Write the EOS14 to the phantom dump.
void eos14_load(const PhantomDump &dump, f64 &cs0, f64 &q, f64 &r0)
Load the EOS14 from the phantom dump.
void eos3_write(PhantomDump &dump, const f64 &cs0, const f64 &q, const f64 &r0)
Write the EOS3 to the phantom dump.
void eos1_load(const PhantomDump &dump, f64 &cs)
Load the EOS1 from the phantom dump.
double f64
Alias for double.
std::int64_t i64
64 bit integer
std::int32_t i32
32 bit integer
This header file contains utility functions related to exception handling in the code.
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.
i32 world_rank()
Gives the rank of the current process in the MPI communicator.
void raw_ln(Types... var2)
Prints a log message with multiple arguments followed by a newline.
Class representing a Phantom dump file.
T read_header_float(std::string s) const
Retrieves a floating-point value from the table headers.
bool has_header_entry(std::string s) const
Checks if a given string is present in any of the table headers.
PhantomDumpTableHeader< i32 > table_header_i32
Table header for signed 32-bit integer data.
T read_header_int(std::string s) const
Retrieves an integer value from the table headers.
PhantomDumpTableHeader< fort_real > table_header_fort_real
Table header for floating-point data.
Functions related to the MPI communicator.