Skip to content

Commit

Permalink
fix compilation issues due to EOS namespace (#2938)
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Jul 29, 2024
1 parent dbc6f6b commit c7c6aca
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Exec/hydro_tests/Noh/problem_bc_fill.H
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void problem_bc_fill(int i, int j, int k,

eos_t zone_state;
zone_state.rho = rho_init * std::pow(1.0_rt + time / r, AMREX_SPACEDIM - 1);
zone_state.p = pres_init * std::pow(zone_state.rho / rho_init, 1.0_rt + eos_gamma);
zone_state.p = pres_init * std::pow(zone_state.rho / rho_init, 1.0_rt + eos_rp::eos_gamma);
for (int n = 0; n < NumSpec; ++n) {
zone_state.xn[n] = 1.0_rt / static_cast<Real>(NumSpec);
}
Expand Down
8 changes: 4 additions & 4 deletions Exec/hydro_tests/RT/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ void problem_initialize_state_data (int i, int j, int k,

if (r[AMREX_SPACEDIM-1] < problem::split[AMREX_SPACEDIM-1]) {
Real pres = problem::p0_base - problem::rho_1 * r[AMREX_SPACEDIM-1];
state(i,j,k,UEDEN) = pres / (eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = pres / (eos_gamma - 1.0_rt);
state(i,j,k,UEDEN) = pres / (eos_rp::eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = pres / (eos_rp::eos_gamma - 1.0_rt);
} else {
Real pres = presmid - problem::rho_2 *
(r[AMREX_SPACEDIM-1] - problem::split[AMREX_SPACEDIM-1]);
state(i,j,k,UEDEN) = pres / (eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = pres / (eos_gamma - 1.0_rt);
state(i,j,k,UEDEN) = pres / (eos_rp::eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = pres / (eos_rp::eos_gamma - 1.0_rt);
}

Real pertheight;
Expand Down
4 changes: 2 additions & 2 deletions Exec/hydro_tests/Vortices_LWAcoustics/problem_initialize.H
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ void problem_initialize ()

// Define rho_0

problem::rho_0 = std::pow(problem::p_ref, 1.0_rt/eos_gamma);
problem::rho_0 = std::pow(problem::p_ref, 1.0_rt/eos_rp::eos_gamma);

// Define c_0

problem::c_0 = std::sqrt(eos_gamma * problem::p_ref / problem::rho_0);
problem::c_0 = std::sqrt(eos_rp::eos_gamma * problem::p_ref / problem::rho_0);

// Define r_c, radius of each vortex

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void problem_initialize_state_data (int i, int j, int k,

// internal energy

state(i,j,k,UEINT) = problem::p_ref / (eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = problem::p_ref / (eos_rp::eos_gamma - 1.0_rt);

// Total energy

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ void problem_initialize_state_data (int i, int j, int k,
state(i,j,k,UMZ) = 0.0_rt;

// we are isentropic, so p = (dens/rho0)**Gamma_1
Real p = std::pow(state(i,j,k,URHO) / problem::rho0, eos_gamma);
Real eint = p / (eos_gamma - 1.0_rt);
Real p = std::pow(state(i,j,k,URHO) / problem::rho0, eos_rp::eos_gamma);
Real eint = p / (eos_rp::eos_gamma - 1.0_rt);

state(i,j,k,UEDEN) = eint;
state(i,j,k,UEINT) = eint;
Expand Down
4 changes: 2 additions & 2 deletions Exec/hydro_tests/gamma_law_bubble/Problem_Derive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ void ca_derrhopert(const Box& bx, FArrayBox& derfab, int dcomp, int /*ncomp*/,
if (problem::do_isentropic) {
Real z = static_cast<Real>(j) * dx[AMREX_SPACEDIM-1];
density[j] = problem::dens_base *
std::pow((gravity::const_grav * problem::dens_base * (eos_gamma - 1.0_rt) * z/
(eos_gamma * problem::pres_base) + 1.0_rt), 1.0_rt/(eos_gamma - 1.0_rt));
std::pow((gravity::const_grav * problem::dens_base * (eos_rp::eos_gamma - 1.0_rt) * z/
(eos_rp::eos_gamma * problem::pres_base) + 1.0_rt), 1.0_rt/(eos_rp::eos_gamma - 1.0_rt));
} else {
Real z = (static_cast<Real>(j) + 0.5_rt) * dx[AMREX_SPACEDIM-1];
density[j] = problem::dens_base * std::exp(-z/H);
Expand Down
4 changes: 2 additions & 2 deletions Exec/hydro_tests/gamma_law_bubble/initial_model.H
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ generate_initial_model(const int npts_model, const Real xmin, const Real xmax,

density = model_params.dens_base *
std::pow(gravity::const_grav * model_params.dens_base *
(eos_gamma - 1.0) * z /
(eos_gamma * model_params.p_base) + 1.0_rt, 1.0_rt/(eos_gamma - 1.0_rt));
(eos_rp::eos_gamma - 1.0) * z /
(eos_rp::eos_gamma * model_params.p_base) + 1.0_rt, 1.0_rt/(eos_rp::eos_gamma - 1.0_rt));

} else {
Real z = xmin + (static_cast<Real>(i) + 0.5_rt) * dx;
Expand Down
4 changes: 2 additions & 2 deletions Exec/hydro_tests/gamma_law_bubble/prob_util.H
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ gamma_law_initial_model(Real* const pressure, Real* const density, Real* const t
if (problem::do_isentropic) {
Real z = static_cast<Real>(j) * dx[AMREX_SPACEDIM-1];
density[j] = problem::dens_base *
std::pow((gravity::const_grav * problem::dens_base * (eos_gamma - 1.0_rt) * z/
(eos_gamma * problem::pres_base) + 1.0_rt), 1.0_rt/(eos_gamma - 1.0_rt));
std::pow((gravity::const_grav * problem::dens_base * (eos_rp::eos_gamma - 1.0_rt) * z/
(eos_rp::eos_gamma * problem::pres_base) + 1.0_rt), 1.0_rt/(eos_rp::eos_gamma - 1.0_rt));
} else {
Real z = (static_cast<Real>(j) + 0.5_rt) * dx[AMREX_SPACEDIM-1];
density[j] = problem::dens_base * std::exp(-z/H);
Expand Down
16 changes: 8 additions & 8 deletions Exec/hydro_tests/riemann_2d/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ void problem_initialize_state_data(int i, int j, int k,

state(i, j, k, UMX) = state(i, j, k, URHO) * problem::ux_3;
state(i, j, k, UMY) = state(i, j, k, URHO) * problem::uy_3;
state(i, j, k, UEINT) = problem::p_3 / (eos_gamma - 1.0_rt);
state(i, j, k, UEDEN) = problem::p_3 / (eos_gamma - 1.0_rt)
state(i, j, k, UEINT) = problem::p_3 / (eos_rp::eos_gamma - 1.0_rt);
state(i, j, k, UEDEN) = problem::p_3 / (eos_rp::eos_gamma - 1.0_rt)
+ 0.5 * problem::rho_3 * problem::ux_3 * problem::ux_3
+ 0.5 * problem::rho_3 * problem::uy_3 * problem::uy_3;

Expand All @@ -66,9 +66,9 @@ void problem_initialize_state_data(int i, int j, int k,

state(i, j, k, UMX) = state(i, j, k, URHO) * problem::ux_4;
state(i, j, k, UMY) = state(i, j, k, URHO) * problem::uy_4;
state(i, j, k, UEINT) = problem::p_4 / (eos_gamma - 1.0_rt);
state(i, j, k, UEINT) = problem::p_4 / (eos_rp::eos_gamma - 1.0_rt);

state(i, j, k, UEDEN) = problem::p_4 / (eos_gamma - 1.0_rt)
state(i, j, k, UEDEN) = problem::p_4 / (eos_rp::eos_gamma - 1.0_rt)
+ 0.5 * problem::rho_4 * problem::ux_4 * problem::ux_4
+ 0.5 * problem::rho_4 * problem::uy_4 * problem::uy_4;

Expand All @@ -79,9 +79,9 @@ void problem_initialize_state_data(int i, int j, int k,

state(i, j, k, UMX) = state(i, j, k, URHO) * problem::ux_2;
state(i, j, k, UMY) = state(i, j, k, URHO) * problem::uy_2;
state(i, j, k, UEINT) = problem::p_2 / (eos_gamma - 1.0_rt);
state(i, j, k, UEINT) = problem::p_2 / (eos_rp::eos_gamma - 1.0_rt);

state(i, j, k, UEDEN) = problem::p_2 / (eos_gamma - 1.0_rt)
state(i, j, k, UEDEN) = problem::p_2 / (eos_rp::eos_gamma - 1.0_rt)
+ 0.5 * problem::rho_2 * problem::ux_2 * problem::ux_2
+ 0.5 * problem::rho_2 * problem::uy_2 * problem::uy_2;
} else if (xx > problem::center[0] & yy > problem::center[1])
Expand All @@ -91,9 +91,9 @@ void problem_initialize_state_data(int i, int j, int k,

state(i, j, k, UMX) = state(i, j, k, URHO) * problem::ux_1;
state(i, j, k, UMY) = state(i, j, k, URHO) * problem::uy_1;
state(i, j, k, UEINT) = problem::p_1 / (eos_gamma - 1.0_rt);
state(i, j, k, UEINT) = problem::p_1 / (eos_rp::eos_gamma - 1.0_rt);

state(i, j, k, UEDEN) = problem::p_1 / (eos_gamma - 1.0_rt)
state(i, j, k, UEDEN) = problem::p_1 / (eos_rp::eos_gamma - 1.0_rt)
+ 0.5 * problem::rho_1 * problem::ux_1 * problem::ux_1
+ 0.5 * problem::rho_1 * problem::uy_1 * problem::uy_1;
}
Expand Down
9 changes: 4 additions & 5 deletions Exec/mhd_tests/RT/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ void problem_initialize_state_data (int i, int j, int k,
Real pres;
if (r[AMREX_SPACEDIM-1] < problem::split[AMREX_SPACEDIM-1]) {
pres = problem::p0_base - problem::rho_1 * r[AMREX_SPACEDIM-1];
state(i,j,k,UEDEN) = pres / (eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = pres / (eos_gamma - 1.0_rt);
state(i,j,k,UEDEN) = pres / (eos_rp::eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = pres / (eos_rp::eos_gamma - 1.0_rt);
} else {
pres = presmid - problem::rho_2 * (r[AMREX_SPACEDIM-1] - problem::split[AMREX_SPACEDIM-1]);
state(i,j,k,UEDEN) = pres / (eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = pres / (eos_gamma - 1.0_rt);
state(i,j,k,UEDEN) = pres / (eos_rp::eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = pres / (eos_rp::eos_gamma - 1.0_rt);
}

// doing it similar to 2d, will be something in x-z though
Expand All @@ -61,4 +61,3 @@ void problem_initialize_state_data (int i, int j, int k,

}
#endif

0 comments on commit c7c6aca

Please sign in to comment.