From b52dc021b5bb64d22fba25f622ac9a9bb5b5a9ff Mon Sep 17 00:00:00 2001 From: Jonah Maxwell Miller Date: Wed, 6 Dec 2023 13:36:30 -0700 Subject: [PATCH] move ye to variable types --- src/fixup/fixup.cpp | 10 +++++----- src/fixup/fixup_c2p.cpp | 8 ++++---- src/fixup/fixup_radc2p.cpp | 9 +++++---- src/fixup/fixup_src.cpp | 10 +++++----- src/fluid/con2prim.hpp | 9 +++++---- src/fluid/con2prim_robust.hpp | 9 +++++---- src/fluid/fluid.cpp | 16 ++++++++-------- src/fluid/riemann.hpp | 10 ++++++---- src/microphysics/eos_phoebus/eos_phoebus.cpp | 2 +- src/pgen/advection.cpp | 4 ++-- src/pgen/blandford_mckee.cpp | 4 ++-- src/pgen/bondi.cpp | 4 ++-- src/pgen/friedmann.cpp | 4 ++-- src/pgen/kh.cpp | 4 ++-- src/pgen/leptoneq.cpp | 4 ++-- src/pgen/linear_modes.cpp | 4 ++-- src/pgen/p2c2p.cpp | 2 +- src/pgen/progenitor.cpp | 4 ++-- src/pgen/radiation_equilibration.cpp | 4 ++-- src/pgen/rhs_tester.cpp | 4 ++-- src/pgen/rotor.cpp | 4 ++-- src/pgen/sedov.cpp | 4 ++-- src/pgen/shock_tube.cpp | 4 ++-- src/pgen/thin_cooling.cpp | 4 ++-- src/pgen/torus.cpp | 14 +++++++------- src/pgen/tov.cpp | 4 ++-- src/phoebus_utils/variables.hpp | 4 ++-- src/radiation/cooling_function.cpp | 6 +++--- src/radiation/mocmc.cpp | 14 +++++++------- src/radiation/moments.cpp | 4 ++-- src/radiation/moments_source.cpp | 8 ++++---- src/radiation/monte_carlo.cpp | 12 ++++++------ src/radiation/radiation.cpp | 4 ++-- 33 files changed, 108 insertions(+), 103 deletions(-) diff --git a/src/fixup/fixup.cpp b/src/fixup/fixup.cpp index e6771cfe..ac35c953 100644 --- a/src/fixup/fixup.cpp +++ b/src/fixup/fixup.cpp @@ -308,9 +308,9 @@ TaskStatus ApplyFloorsImpl(T *rc, IndexDomain domain = IndexDomain::entire) { const std::vector vars( {p::density::name(), c::density, p::velocity::name(), c::momentum, - p::energy::name(), c::energy::name(), p::bfield::name(), p::ye, c::ye, p::pressure, - p::temperature, p::gamma1, pr::J, pr::H, cr::E, cr::F, impl::cell_signal_speed, - impl::fail, ir::tilPi}); + p::energy::name(), c::energy::name(), p::bfield::name(), p::ye::name(), + c::ye::name(), p::pressure, p::temperature, p::gamma1, pr::J, pr::H, cr::E, cr::F, + impl::cell_signal_speed, impl::fail, ir::tilPi}); PackIndexMap imap; auto v = rc->PackVariables(vars, imap); @@ -330,8 +330,8 @@ TaskStatus ApplyFloorsImpl(T *rc, IndexDomain domain = IndexDomain::entire) { const int shi = imap[impl::cell_signal_speed].second; const int pb_lo = imap[p::bfield::name()].first; const int pb_hi = imap[p::bfield::name()].second; - int pye = imap[p::ye].second; // negative if not present - int cye = imap[c::ye].second; + int pye = imap[p::ye::name()].second; // negative if not present + int cye = imap[c::ye::name()].second; auto idx_J = imap.GetFlatIdx(pr::J, false); auto idx_H = imap.GetFlatIdx(pr::H, false); auto idx_E = imap.GetFlatIdx(cr::E, false); diff --git a/src/fixup/fixup_c2p.cpp b/src/fixup/fixup_c2p.cpp index 4f178d77..8e582d03 100644 --- a/src/fixup/fixup_c2p.cpp +++ b/src/fixup/fixup_c2p.cpp @@ -66,8 +66,8 @@ TaskStatus ConservedToPrimitiveFixupImpl(T *rc) { p::energy::name(), c::energy::name(), p::bfield::name(), - p::ye, - c::ye, + p::ye::name(), + c::ye::name(), p::pressure, p::temperature, p::gamma1, @@ -100,8 +100,8 @@ TaskStatus ConservedToPrimitiveFixupImpl(T *rc) { const int shi = imap[impl::cell_signal_speed].second; const int pb_lo = imap[p::bfield::name()].first; const int pb_hi = imap[p::bfield::name()].second; - int pye = imap[p::ye].second; // negative if not present - int cye = imap[c::ye].second; + int pye = imap[p::ye::name()].second; // negative if not present + int cye = imap[c::ye::name()].second; int ifail = imap[impl::fail].first; int irfail = imap[ir::c2pfail].first; diff --git a/src/fixup/fixup_radc2p.cpp b/src/fixup/fixup_radc2p.cpp index f194fdb5..35881a09 100644 --- a/src/fixup/fixup_radc2p.cpp +++ b/src/fixup/fixup_radc2p.cpp @@ -63,15 +63,16 @@ TaskStatus RadConservedToPrimitiveFixupImpl(T *rc) { bool update_rad = rad_pkg->Param("active"); if (!enable_c2p_fixup || !update_rad) return TaskStatus::complete; - const std::vector vars({p::velocity::name(), p::ye, c::ye, pr::J, pr::H, - cr::E, cr::F, ir::tilPi, ir::c2pfail, impl::fail}); + const std::vector vars({p::velocity::name(), p::ye::name(), c::ye::name(), + pr::J, pr::H, cr::E, cr::F, ir::tilPi, ir::c2pfail, + impl::fail}); PackIndexMap imap; auto v = rc->PackVariables(vars, imap); auto idx_pvel = imap.GetFlatIdx(p::velocity::name()); - int pye = imap[p::ye].second; // negative if not present - int cye = imap[c::ye].second; + int pye = imap[p::ye::name()].second; // negative if not present + int cye = imap[c::ye::name()].second; auto idx_J = imap.GetFlatIdx(pr::J, false); auto idx_H = imap.GetFlatIdx(pr::H, false); auto idx_E = imap.GetFlatIdx(cr::E, false); diff --git a/src/fixup/fixup_src.cpp b/src/fixup/fixup_src.cpp index 3900853d..47be522e 100644 --- a/src/fixup/fixup_src.cpp +++ b/src/fixup/fixup_src.cpp @@ -76,9 +76,9 @@ TaskStatus SourceFixupImpl(T *rc) { const std::vector vars( {p::density::name(), c::density, p::velocity::name(), c::momentum, - p::energy::name(), c::energy::name(), p::bfield::name(), p::ye, c::ye, p::pressure, - p::temperature, p::gamma1, pr::J, pr::H, cr::E, cr::F, impl::cell_signal_speed, - ir::srcfail, ir::tilPi}); + p::energy::name(), c::energy::name(), p::bfield::name(), p::ye::name(), + c::ye::name(), p::pressure, p::temperature, p::gamma1, pr::J, pr::H, cr::E, cr::F, + impl::cell_signal_speed, ir::srcfail, ir::tilPi}); PackIndexMap imap; auto v = rc->PackVariables(vars, imap); @@ -94,8 +94,8 @@ TaskStatus SourceFixupImpl(T *rc) { const int gm1 = imap[p::gamma1].first; const int slo = imap[impl::cell_signal_speed].first; const int shi = imap[impl::cell_signal_speed].second; - int pye = imap[p::ye].second; - int cye = imap[c::ye].second; + int pye = imap[p::ye::name()].second; + int cye = imap[c::ye::name()].second; const int pb_lo = imap[p::bfield::name()].first; const int pb_hi = imap[p::bfield::name()].second; auto idx_J = imap.GetFlatIdx(pr::J); diff --git a/src/fluid/con2prim.hpp b/src/fluid/con2prim.hpp index 3d0aa322..97c51b4b 100644 --- a/src/fluid/con2prim.hpp +++ b/src/fluid/con2prim.hpp @@ -142,8 +142,9 @@ class ConToPrim { pb_lo(imap[fluid_prim::bfield::name()].first), pb_hi(imap[fluid_prim::bfield::name()].second), cb_lo(imap[fluid_cons::bfield::name()].first), - cb_hi(imap[fluid_cons::bfield::name()].second), pye(imap[fluid_prim::ye].second), - cye(imap[fluid_cons::ye].second), prs(imap[fluid_prim::pressure].first), + cb_hi(imap[fluid_cons::bfield::name()].second), + pye(imap[fluid_prim::ye::name()].second), + cye(imap[fluid_cons::ye::name()].second), prs(imap[fluid_prim::pressure].first), tmp(imap[fluid_prim::temperature].first), sig_lo(imap[internal_variables::cell_signal_speed].first), sig_hi(imap[internal_variables::cell_signal_speed].second), @@ -155,8 +156,8 @@ class ConToPrim { return std::vector( {fluid_prim::density::name(), fluid_cons::density, fluid_prim::velocity::name(), fluid_cons::momentum, fluid_prim::energy::name(), fluid_cons::energy::name(), - fluid_prim::bfield::name(), fluid_cons::bfield::name(), fluid_prim::ye, - fluid_cons::ye, fluid_prim::pressure, fluid_prim::temperature, + fluid_prim::bfield::name(), fluid_cons::bfield::name(), fluid_prim::ye::name(), + fluid_cons::ye::name(), fluid_prim::pressure, fluid_prim::temperature, internal_variables::cell_signal_speed, fluid_prim::gamma1, internal_variables::c2p_scratch}); } diff --git a/src/fluid/con2prim_robust.hpp b/src/fluid/con2prim_robust.hpp index 0e6fc2ff..4a0dc6d2 100644 --- a/src/fluid/con2prim_robust.hpp +++ b/src/fluid/con2prim_robust.hpp @@ -239,8 +239,9 @@ class ConToPrim { pb_lo(imap[fluid_prim::bfield::name()].first), pb_hi(imap[fluid_prim::bfield::name()].second), cb_lo(imap[fluid_cons::bfield::name()].first), - cb_hi(imap[fluid_cons::bfield::name()].second), pye(imap[fluid_prim::ye].second), - cye(imap[fluid_cons::ye].second), prs(imap[fluid_prim::pressure].first), + cb_hi(imap[fluid_cons::bfield::name()].second), + pye(imap[fluid_prim::ye::name()].second), + cye(imap[fluid_cons::ye::name()].second), prs(imap[fluid_prim::pressure].first), tmp(imap[fluid_prim::temperature].first), sig_lo(imap[internal_variables::cell_signal_speed].first), sig_hi(imap[internal_variables::cell_signal_speed].second), @@ -253,8 +254,8 @@ class ConToPrim { return std::vector( {fluid_prim::density::name(), fluid_cons::density, fluid_prim::velocity::name(), fluid_cons::momentum, fluid_prim::energy::name(), fluid_cons::energy::name(), - fluid_prim::bfield::name(), fluid_cons::bfield::name(), fluid_prim::ye, - fluid_cons::ye, fluid_prim::pressure, fluid_prim::temperature, + fluid_prim::bfield::name(), fluid_cons::bfield::name(), fluid_prim::ye::name(), + fluid_cons::ye::name(), fluid_prim::pressure, fluid_prim::temperature, internal_variables::cell_signal_speed, fluid_prim::gamma1, internal_variables::c2p_mu}); } diff --git a/src/fluid/fluid.cpp b/src/fluid/fluid.cpp index 5e06a5cb..8ebcf1c6 100644 --- a/src/fluid/fluid.cpp +++ b/src/fluid/fluid.cpp @@ -205,7 +205,7 @@ std::shared_ptr Initialize(ParameterInput *pin) { physics->AddField(p::temperature, mprim_scalar); physics->AddField(p::gamma1, mprim_scalar); if (ye) { - physics->AddField(p::ye, mprim_scalar); + physics->AddField(p::ye::name(), mprim_scalar); } if (pin->GetOrAddString("fluid", "c2p_method", "robust") == "robust") { physics->AddField(impl::c2p_mu, mprim_scalar); @@ -230,7 +230,7 @@ std::shared_ptr Initialize(ParameterInput *pin) { physics->AddField(c::bfield::name(), mcons_threev); } if (ye) { - physics->AddField(c::ye, mcons_scalar); + physics->AddField(c::ye::name(), mcons_scalar); } AllReduce> net_field_totals; @@ -260,12 +260,12 @@ std::shared_ptr Initialize(ParameterInput *pin) { {p::density::name(), p::velocity::name(), p::energy::name()}); riemann::FluxState::ReconVars(rvars); if (mhd) riemann::FluxState::ReconVars(p::bfield::name()); - if (ye) riemann::FluxState::ReconVars(p::ye); + if (ye) riemann::FluxState::ReconVars(p::ye::name()); std::vector fvars({c::density, c::momentum, c::energy::name()}); riemann::FluxState::FluxVars(fvars); if (mhd) riemann::FluxState::FluxVars(c::bfield::name()); - if (ye) riemann::FluxState::FluxVars(c::ye); + if (ye) riemann::FluxState::FluxVars(c::ye::name()); // add some extra fields for reconstruction rvars = std::vector({p::pressure, p::gamma1}); @@ -352,8 +352,8 @@ TaskStatus PrimitiveToConservedRegion(MeshBlockData *rc, const IndexRange const std::vector vars( {p::density::name(), c::density, p::velocity::name(), c::momentum, - p::energy::name(), c::energy::name(), p::bfield::name(), c::bfield::name(), p::ye, - c::ye, p::pressure, p::gamma1, impl::cell_signal_speed}); + p::energy::name(), c::energy::name(), p::bfield::name(), c::bfield::name(), + p::ye::name(), c::ye::name(), p::pressure, p::gamma1, impl::cell_signal_speed}); PackIndexMap imap; auto v = rc->PackVariables(vars, imap); @@ -372,8 +372,8 @@ TaskStatus PrimitiveToConservedRegion(MeshBlockData *rc, const IndexRange const int pb_hi = imap[p::bfield::name()].second; const int cb_lo = imap[c::bfield::name()].first; const int cb_hi = imap[c::bfield::name()].second; - const int pye = imap[p::ye].second; // -1 if not present - const int cye = imap[c::ye].second; + const int pye = imap[p::ye::name()].second; // -1 if not present + const int cye = imap[c::ye::name()].second; const int sig_lo = imap[impl::cell_signal_speed].first; const int sig_hi = imap[impl::cell_signal_speed].second; diff --git a/src/fluid/riemann.hpp b/src/fluid/riemann.hpp index 9bc1765b..057c9d34 100644 --- a/src/fluid/riemann.hpp +++ b/src/fluid/riemann.hpp @@ -222,12 +222,14 @@ class FluxState { pvel_lo(imap[fluid_prim::velocity::name()].first), peng(imap[fluid_prim::energy::name()].first), pb_lo(imap[fluid_prim::bfield::name()].first), - pb_hi(imap[fluid_prim::bfield::name()].second), pye(imap[fluid_prim::ye].second), - prs(imap[fluid_prim::pressure].first), gm1(imap[fluid_prim::gamma1].first), - crho(imap[fluid_cons::density].first), cmom_lo(imap[fluid_cons::momentum].first), + pb_hi(imap[fluid_prim::bfield::name()].second), + pye(imap[fluid_prim::ye::name()].second), prs(imap[fluid_prim::pressure].first), + gm1(imap[fluid_prim::gamma1].first), crho(imap[fluid_cons::density].first), + cmom_lo(imap[fluid_cons::momentum].first), ceng(imap[fluid_cons::energy::name()].first), cb_lo(imap[fluid_cons::bfield::name()].first), - cb_hi(imap[fluid_cons::bfield::name()].second), cye(imap[fluid_cons::ye].first), + cb_hi(imap[fluid_cons::bfield::name()].second), + cye(imap[fluid_cons::ye::name()].first), ncons(5 + (pb_hi - pb_lo + 1) + (cye > 0)) { PARTHENON_REQUIRE_THROWS( ncons <= NCONS_MAX, diff --git a/src/microphysics/eos_phoebus/eos_phoebus.cpp b/src/microphysics/eos_phoebus/eos_phoebus.cpp index 69ca8d5b..a425a6ee 100644 --- a/src/microphysics/eos_phoebus/eos_phoebus.cpp +++ b/src/microphysics/eos_phoebus/eos_phoebus.cpp @@ -97,7 +97,7 @@ std::shared_ptr Initialize(ParameterInput *pin) { // We request that Ye and temperature exist, but do not provide them. Metadata m = Metadata({Metadata::Cell, Metadata::Intensive, Metadata::Derived, Metadata::OneCopy, Metadata::Requires}); - pkg->AddField(fluid_prim::ye, m); + pkg->AddField(fluid_prim::ye::name(), m); pkg->AddField(fluid_prim::temperature, m); const std::string filename = pin->GetString(block_name, "filename"); diff --git a/src/pgen/advection.cpp b/src/pgen/advection.cpp index 977a9814..8fa7bdaf 100644 --- a/src/pgen/advection.cpp +++ b/src/pgen/advection.cpp @@ -28,7 +28,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { PackIndexMap imap; auto v = rc->PackVariables({fluid_prim::density::name(), fluid_prim::velocity::name(), fluid_prim::energy::name(), fluid_prim::bfield::name(), - fluid_prim::ye, fluid_prim::pressure, + fluid_prim::ye::name(), fluid_prim::pressure, fluid_prim::temperature, fluid_prim::gamma1}, imap); @@ -38,7 +38,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { const int ieng = imap[fluid_prim::energy::name()].first; const int ib_lo = imap[fluid_prim::bfield::name()].first; const int ib_hi = imap[fluid_prim::bfield::name()].second; - const int iye = imap[fluid_prim::ye].second; + const int iye = imap[fluid_prim::ye::name()].second; const int iprs = imap[fluid_prim::pressure].first; const int itmp = imap[fluid_prim::temperature].first; const int igm1 = imap[fluid_prim::gamma1].first; diff --git a/src/pgen/blandford_mckee.cpp b/src/pgen/blandford_mckee.cpp index e5647d88..a42e6f6d 100644 --- a/src/pgen/blandford_mckee.cpp +++ b/src/pgen/blandford_mckee.cpp @@ -33,7 +33,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { PackIndexMap imap; auto v = rc->PackVariables({fluid_prim::density::name(), fluid_prim::velocity::name(), fluid_prim::energy::name(), fluid_prim::bfield::name(), - fluid_prim::ye, fluid_prim::pressure, + fluid_prim::ye::name(), fluid_prim::pressure, fluid_prim::temperature, fluid_prim::gamma1}, imap); @@ -43,7 +43,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { const int ieng = imap[fluid_prim::energy::name()].first; const int ib_lo = imap[fluid_prim::bfield::name()].first; const int ib_hi = imap[fluid_prim::bfield::name()].second; - const int iye = imap[fluid_prim::ye].second; + const int iye = imap[fluid_prim::ye::name()].second; const int iprs = imap[fluid_prim::pressure].first; const int itmp = imap[fluid_prim::temperature].first; const int igm1 = imap[fluid_prim::gamma1].first; diff --git a/src/pgen/bondi.cpp b/src/pgen/bondi.cpp index f0f54cc2..96fd79be 100644 --- a/src/pgen/bondi.cpp +++ b/src/pgen/bondi.cpp @@ -93,7 +93,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { PackIndexMap imap; auto v = rc->PackVariables({fluid_prim::density::name(), fluid_prim::velocity::name(), fluid_prim::energy::name(), fluid_prim::bfield::name(), - fluid_prim::ye, fluid_prim::pressure, + fluid_prim::ye::name(), fluid_prim::pressure, fluid_prim::temperature, fluid_prim::gamma1}, imap); @@ -103,7 +103,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { const int ieng = imap[fluid_prim::energy::name()].first; const int ib_lo = imap[fluid_prim::bfield::name()].first; const int ib_hi = imap[fluid_prim::bfield::name()].second; - const int iye = imap[fluid_prim::ye].second; + const int iye = imap[fluid_prim::ye::name()].second; const int iprs = imap[fluid_prim::pressure].first; const int itmp = imap[fluid_prim::temperature].first; const int igm1 = imap[fluid_prim::gamma1].first; diff --git a/src/pgen/friedmann.cpp b/src/pgen/friedmann.cpp index 67c9f090..a7a71f07 100644 --- a/src/pgen/friedmann.cpp +++ b/src/pgen/friedmann.cpp @@ -38,13 +38,13 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { PackIndexMap imap; auto v = rc->PackVariables({fluid_prim::density::name(), fluid_prim::velocity::name(), fluid_prim::energy::name(), fluid_prim::bfield::name(), - fluid_prim::ye, fluid_prim::pressure, + fluid_prim::ye::name(), fluid_prim::pressure, fluid_prim::temperature, fluid_prim::gamma1}, imap); const int irho = imap[fluid_prim::density::name()].first; const int ivlo = imap[fluid_prim::velocity::name()].first; const int ieng = imap[fluid_prim::energy::name()].first; - const int iye = imap[fluid_prim::ye].second; + const int iye = imap[fluid_prim::ye::name()].second; const int iprs = imap[fluid_prim::pressure].first; const int itmp = imap[fluid_prim::temperature].first; const int igm1 = imap[fluid_prim::gamma1].first; diff --git a/src/pgen/kh.cpp b/src/pgen/kh.cpp index a464bc72..86a1f06f 100644 --- a/src/pgen/kh.cpp +++ b/src/pgen/kh.cpp @@ -28,7 +28,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { PackIndexMap imap; auto v = rc->PackVariables({fluid_prim::density::name(), fluid_prim::velocity::name(), fluid_prim::energy::name(), fluid_prim::bfield::name(), - fluid_prim::ye, fluid_prim::pressure, + fluid_prim::ye::name(), fluid_prim::pressure, fluid_prim::temperature, fluid_prim::gamma1}, imap); @@ -38,7 +38,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { const int ieng = imap[fluid_prim::energy::name()].first; const int ib_lo = imap[fluid_prim::bfield::name()].first; const int ib_hi = imap[fluid_prim::bfield::name()].second; - const int iye = imap[fluid_prim::ye].second; + const int iye = imap[fluid_prim::ye::name()].second; const int iprs = imap[fluid_prim::pressure].first; const int itmp = imap[fluid_prim::temperature].first; const int igm1 = imap[fluid_prim::gamma1].first; diff --git a/src/pgen/leptoneq.cpp b/src/pgen/leptoneq.cpp index 77ffb30b..9605c95d 100644 --- a/src/pgen/leptoneq.cpp +++ b/src/pgen/leptoneq.cpp @@ -32,14 +32,14 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { PackIndexMap imap; auto v = rc->PackVariables({p::density::name(), p::velocity::name(), p::energy::name(), - p::ye, p::pressure, p::temperature, p::gamma1}, + p::ye::name(), p::pressure, p::temperature, p::gamma1}, imap); const int irho = imap[p::density::name()].first; const int ivlo = imap[p::velocity::name()].first; const int ivhi = imap[p::velocity::name()].second; const int ieng = imap[p::energy::name()].first; - const int iye = imap[p::ye].first; + const int iye = imap[p::ye::name()].first; const int iprs = imap[p::pressure].first; const int itmp = imap[p::temperature].first; const int igm1 = imap[p::gamma1].first; diff --git a/src/pgen/linear_modes.cpp b/src/pgen/linear_modes.cpp index 7722fbff..067c49d8 100644 --- a/src/pgen/linear_modes.cpp +++ b/src/pgen/linear_modes.cpp @@ -46,7 +46,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { std::vector vars( {fluid_prim::density::name(), fluid_prim::velocity::name(), fluid_prim::energy::name(), fluid_prim::bfield::name(), fluid_prim::pressure, - fluid_prim::temperature, fluid_prim::gamma1, fluid_prim::ye}); + fluid_prim::temperature, fluid_prim::gamma1, fluid_prim::ye::name()}); auto v = rc->PackVariables(vars, imap); const int irho = imap[fluid_prim::density::name()].first; @@ -58,7 +58,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { const int iprs = imap[fluid_prim::pressure].first; const int itmp = imap[fluid_prim::temperature].first; const int igm1 = imap[fluid_prim::gamma1].first; - const int iye = imap[fluid_prim::ye].second; + const int iye = imap[fluid_prim::ye::name()].second; const int nv = ivhi - ivlo + 1; const Real gam = pin->GetReal("eos", "Gamma"); diff --git a/src/pgen/p2c2p.cpp b/src/pgen/p2c2p.cpp index 9e6ef79b..fac0d6a3 100644 --- a/src/pgen/p2c2p.cpp +++ b/src/pgen/p2c2p.cpp @@ -75,7 +75,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { PackIndexMap imap; auto v = rc->PackVariables({fluid_prim::density::name(), fluid_prim::velocity::name(), fluid_prim::energy::name(), fluid_prim::bfield::name(), - fluid_prim::ye, fluid_prim::pressure, + fluid_prim::ye::name(), fluid_prim::pressure, fluid_prim::temperature, fluid_prim::gamma1}, imap); diff --git a/src/pgen/progenitor.cpp b/src/pgen/progenitor.cpp index 461ca83a..aa0bb4c2 100644 --- a/src/pgen/progenitor.cpp +++ b/src/pgen/progenitor.cpp @@ -37,7 +37,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { PackIndexMap imap; auto v = rc->PackVariables({fluid_prim::density::name(), fluid_prim::velocity::name(), fluid_prim::energy::name(), fluid_prim::bfield::name(), - fluid_prim::ye, fluid_prim::pressure, + fluid_prim::ye::name(), fluid_prim::pressure, fluid_prim::temperature, fluid_prim::gamma1}, imap); const int irho = imap[fluid_prim::density::name()].first; @@ -46,7 +46,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { const int ieng = imap[fluid_prim::energy::name()].first; const int ib_lo = imap[fluid_prim::bfield::name()].first; const int ib_hi = imap[fluid_prim::bfield::name()].second; - const int iye = imap[fluid_prim::ye].second; + const int iye = imap[fluid_prim::ye::name()].second; const int iprs = imap[fluid_prim::pressure].first; const int itmp = imap[fluid_prim::temperature].first; const int igm1 = imap[fluid_prim::gamma1].first; diff --git a/src/pgen/radiation_equilibration.cpp b/src/pgen/radiation_equilibration.cpp index 520ae1d8..71151f50 100644 --- a/src/pgen/radiation_equilibration.cpp +++ b/src/pgen/radiation_equilibration.cpp @@ -35,7 +35,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { {radmoment_prim::J, radmoment_prim::H, radmoment_internal::xi, radmoment_internal::phi, fluid_prim::density::name(), fluid_prim::temperature, fluid_prim::pressure, fluid_prim::gamma1, fluid_prim::energy::name(), - fluid_prim::ye, fluid_prim::velocity::name()}, + fluid_prim::ye::name(), fluid_prim::velocity::name()}, imap); auto idJ = imap.GetFlatIdx(radmoment_prim::J); @@ -48,7 +48,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { const int iP = imap[fluid_prim::pressure].first; const int igm1 = imap[fluid_prim::gamma1].first; const int ieng = imap[fluid_prim::energy::name()].first; - const int pye = imap[fluid_prim::ye].first; + const int pye = imap[fluid_prim::ye::name()].first; auto idv = imap.GetFlatIdx(fluid_prim::velocity::name()); const auto specB = idJ.GetBounds(1); diff --git a/src/pgen/rhs_tester.cpp b/src/pgen/rhs_tester.cpp index 116da124..d2ee11da 100644 --- a/src/pgen/rhs_tester.cpp +++ b/src/pgen/rhs_tester.cpp @@ -22,7 +22,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { PackIndexMap imap; auto v = rc->PackVariables({fluid_prim::density::name(), fluid_prim::velocity::name(), fluid_prim::energy::name(), fluid_prim::bfield::name(), - fluid_prim::ye, fluid_prim::pressure, + fluid_prim::ye::name(), fluid_prim::pressure, fluid_prim::temperature, fluid_prim::gamma1}, imap); @@ -32,7 +32,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { const int ieng = imap[fluid_prim::energy::name()].first; const int ib_lo = imap[fluid_prim::bfield::name()].first; const int ib_hi = imap[fluid_prim::bfield::name()].second; - const int iye = imap[fluid_prim::ye].second; + const int iye = imap[fluid_prim::ye::name()].second; const int iprs = imap[fluid_prim::pressure].first; const int itmp = imap[fluid_prim::temperature].first; const int igm1 = imap[fluid_prim::gamma1].first; diff --git a/src/pgen/rotor.cpp b/src/pgen/rotor.cpp index 6e89c7d8..33ced5f6 100644 --- a/src/pgen/rotor.cpp +++ b/src/pgen/rotor.cpp @@ -34,7 +34,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { PackIndexMap imap; auto v = rc->PackVariables({fluid_prim::density::name(), fluid_prim::velocity::name(), fluid_prim::energy::name(), fluid_prim::bfield::name(), - fluid_prim::ye, fluid_prim::pressure, + fluid_prim::ye::name(), fluid_prim::pressure, fluid_prim::temperature, fluid_prim::gamma1}, imap); @@ -44,7 +44,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { const int ieng = imap[fluid_prim::energy::name()].first; const int ib_lo = imap[fluid_prim::bfield::name()].first; const int ib_hi = imap[fluid_prim::bfield::name()].second; - const int iye = imap[fluid_prim::ye].second; + const int iye = imap[fluid_prim::ye::name()].second; const int iprs = imap[fluid_prim::pressure].first; const int itmp = imap[fluid_prim::temperature].first; const int igm1 = imap[fluid_prim::gamma1].first; diff --git a/src/pgen/sedov.cpp b/src/pgen/sedov.cpp index 725b2b43..bf522574 100644 --- a/src/pgen/sedov.cpp +++ b/src/pgen/sedov.cpp @@ -33,7 +33,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { PackIndexMap imap; auto v = rc->PackVariables({fluid_prim::density::name(), fluid_prim::velocity::name(), fluid_prim::energy::name(), fluid_prim::bfield::name(), - fluid_prim::ye, fluid_prim::pressure, + fluid_prim::ye::name(), fluid_prim::pressure, fluid_prim::temperature, fluid_prim::gamma1}, imap); @@ -43,7 +43,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { const int ieng = imap[fluid_prim::energy::name()].first; const int ib_lo = imap[fluid_prim::bfield::name()].first; const int ib_hi = imap[fluid_prim::bfield::name()].second; - const int iye = imap[fluid_prim::ye].second; + const int iye = imap[fluid_prim::ye::name()].second; const int iprs = imap[fluid_prim::pressure].first; const int itmp = imap[fluid_prim::temperature].first; const int igm1 = imap[fluid_prim::gamma1].first; diff --git a/src/pgen/shock_tube.cpp b/src/pgen/shock_tube.cpp index 99732ce0..928c0088 100644 --- a/src/pgen/shock_tube.cpp +++ b/src/pgen/shock_tube.cpp @@ -37,7 +37,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { PackIndexMap imap; auto v = rc->PackVariables({fluid_prim::density::name(), fluid_prim::velocity::name(), fluid_prim::energy::name(), fluid_prim::bfield::name(), - fluid_prim::ye, fluid_prim::pressure, + fluid_prim::ye::name(), fluid_prim::pressure, fluid_prim::temperature, fluid_prim::gamma1}, imap); @@ -47,7 +47,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { const int ieng = imap[fluid_prim::energy::name()].first; const int ib_lo = imap[fluid_prim::bfield::name()].first; const int ib_hi = imap[fluid_prim::bfield::name()].second; - const int iye = imap[fluid_prim::ye].second; + const int iye = imap[fluid_prim::ye::name()].second; const int iprs = imap[fluid_prim::pressure].first; const int itmp = imap[fluid_prim::temperature].first; const int igm1 = imap[fluid_prim::gamma1].first; diff --git a/src/pgen/thin_cooling.cpp b/src/pgen/thin_cooling.cpp index 8bfcdbe0..32890514 100644 --- a/src/pgen/thin_cooling.cpp +++ b/src/pgen/thin_cooling.cpp @@ -32,14 +32,14 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { PackIndexMap imap; auto v = rc->PackVariables({p::density::name(), p::velocity::name(), p::energy::name(), - p::ye, p::pressure, p::temperature, p::gamma1}, + p::ye::name(), p::pressure, p::temperature, p::gamma1}, imap); const int irho = imap[p::density::name()].first; const int ivlo = imap[p::velocity::name()].first; const int ivhi = imap[p::velocity::name()].second; const int ieng = imap[p::energy::name()].first; - const int iye = imap[p::ye].second; + const int iye = imap[p::ye::name()].second; const int iprs = imap[p::pressure].first; const int itmp = imap[p::temperature].first; const int igm1 = imap[p::gamma1].first; diff --git a/src/pgen/torus.cpp b/src/pgen/torus.cpp index f40b2a7d..b153e054 100644 --- a/src/pgen/torus.cpp +++ b/src/pgen/torus.cpp @@ -138,12 +138,12 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { bool do_rad = rad_pkg->Param("active"); PackIndexMap imap; - auto v = - rc->PackVariables({fluid_prim::density::name(), fluid_prim::velocity::name(), - fluid_prim::energy::name(), fluid_prim::bfield::name(), - fluid_prim::ye, fluid_prim::pressure, fluid_prim::temperature, - fluid_prim::gamma1, radmoment_prim::J, radmoment_prim::H}, - imap); + auto v = rc->PackVariables({fluid_prim::density::name(), fluid_prim::velocity::name(), + fluid_prim::energy::name(), fluid_prim::bfield::name(), + fluid_prim::ye::name(), fluid_prim::pressure, + fluid_prim::temperature, fluid_prim::gamma1, + radmoment_prim::J, radmoment_prim::H}, + imap); const int irho = imap[fluid_prim::density::name()].first; const int ivlo = imap[fluid_prim::velocity::name()].first; @@ -151,7 +151,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { const int ieng = imap[fluid_prim::energy::name()].first; const int iblo = imap[fluid_prim::bfield::name()].first; const int ibhi = imap[fluid_prim::bfield::name()].second; - const int iye = imap[fluid_prim::ye].second; + const int iye = imap[fluid_prim::ye::name()].second; const int iprs = imap[fluid_prim::pressure].first; const int itmp = imap[fluid_prim::temperature].first; const int igm1 = imap[fluid_prim::gamma1].first; diff --git a/src/pgen/tov.cpp b/src/pgen/tov.cpp index 82de6624..780bfd10 100644 --- a/src/pgen/tov.cpp +++ b/src/pgen/tov.cpp @@ -73,7 +73,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { PackIndexMap imap; auto v = rc->PackVariables({fluid_prim::density::name(), fluid_prim::velocity::name(), fluid_prim::energy::name(), fluid_prim::bfield::name(), - fluid_prim::ye, fluid_prim::pressure, + fluid_prim::ye::name(), fluid_prim::pressure, fluid_prim::temperature, fluid_prim::gamma1}, imap); @@ -83,7 +83,7 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { const int ieng = imap[fluid_prim::energy::name()].first; const int iblo = imap[fluid_prim::bfield::name()].first; const int ibhi = imap[fluid_prim::bfield::name()].second; - const int iye = imap[fluid_prim::ye].second; + const int iye = imap[fluid_prim::ye::name()].second; const int iprs = imap[fluid_prim::pressure].first; const int itmp = imap[fluid_prim::temperature].first; const int igm1 = imap[fluid_prim::gamma1].first; diff --git a/src/phoebus_utils/variables.hpp b/src/phoebus_utils/variables.hpp index 72b29dcc..98f18ff3 100644 --- a/src/phoebus_utils/variables.hpp +++ b/src/phoebus_utils/variables.hpp @@ -37,7 +37,7 @@ VARIABLE(p, density); VARIABLE(p, velocity); VARIABLE(p, energy); VARIABLE(p, bfield); -constexpr char ye[] = "p.ye"; +VARIABLE(p, ye); constexpr char pressure[] = "pressure"; constexpr char temperature[] = "temperature"; constexpr char gamma1[] = "gamma1"; @@ -48,7 +48,7 @@ constexpr char density[] = "c.density"; constexpr char momentum[] = "c.momentum"; VARIABLE(c, energy); VARIABLE(c, bfield); -constexpr char ye[] = "c.ye"; +VARIABLE(c, ye); } // namespace fluid_cons namespace radmoment_prim { diff --git a/src/radiation/cooling_function.cpp b/src/radiation/cooling_function.cpp index b6c05be3..57ad9a63 100644 --- a/src/radiation/cooling_function.cpp +++ b/src/radiation/cooling_function.cpp @@ -114,8 +114,8 @@ TaskStatus CoolingFunctionCalculateFourForce(MeshBlockData *rc, const doub auto *pmb = rc->GetParentPointer(); std::vector vars({c::density, p::density::name(), p::velocity::name(), - p::temperature, p::ye, c::energy::name(), iv::Gcov, - iv::GcovHeat, iv::GcovCool, iv::Gye, iv::tau, + p::temperature, p::ye::name(), c::energy::name(), + iv::Gcov, iv::GcovHeat, iv::GcovCool, iv::Gye, iv::tau, p::energy::name()}); PackIndexMap imap; @@ -125,7 +125,7 @@ TaskStatus CoolingFunctionCalculateFourForce(MeshBlockData *rc, const doub const int pvlo = imap[p::velocity::name()].first; const int pvhi = imap[p::velocity::name()].second; const int ptemp = imap[p::temperature].first; - const int pye = imap[p::ye].first; + const int pye = imap[p::ye::name()].first; const int penergy = imap[p::energy::name()].first; const int Gcov_lo = imap[iv::Gcov].first; const int Gcov_hi = imap[iv::Gcov].second; diff --git a/src/radiation/mocmc.cpp b/src/radiation/mocmc.cpp index 4602f263..7a62f0c0 100644 --- a/src/radiation/mocmc.cpp +++ b/src/radiation/mocmc.cpp @@ -82,8 +82,8 @@ void MOCMCInitSamples(T *rc) { StateDescriptor *eos = pmb->packages.Get("eos").get(); std::vector variables{ - pr::J, pr::H, pf::density::name(), pf::velocity::name(), - pf::temperature, pf::ye, im::dnsamp}; + pr::J, pr::H, pf::density::name(), pf::velocity::name(), + pf::temperature, pf::ye::name(), im::dnsamp}; PackIndexMap imap; auto v = rc->PackVariables(variables, imap); @@ -92,7 +92,7 @@ void MOCMCInitSamples(T *rc) { auto pdens = imap[pf::density::name()].first; auto pv = imap.GetFlatIdx(fluid_prim::velocity::name()); auto pT = imap[pf::temperature].first; - auto pye = imap[pf::ye].first; + auto pye = imap[pf::ye::name()].first; auto dn = imap[im::dnsamp].first; const int nblock = v.GetDim(5); @@ -529,7 +529,7 @@ TaskStatus MOCMCFluidSource(T *rc, const Real dt, const bool update_fluid) { pf::energy::name(), pf::velocity::name(), pf::temperature, - pf::ye, + pf::ye::name(), ir::tilPi, ir::kappaH, im::dnsamp, @@ -539,7 +539,7 @@ TaskStatus MOCMCFluidSource(T *rc, const Real dt, const bool update_fluid) { if (update_fluid) { variables.push_back(cf::energy::name()); variables.push_back(cf::momentum); - variables.push_back(cf::ye); + variables.push_back(cf::ye::name()); } PackIndexMap imap; auto v = rc->PackVariables(variables, imap); @@ -550,7 +550,7 @@ TaskStatus MOCMCFluidSource(T *rc, const Real dt, const bool update_fluid) { const auto peng = imap[pf::energy::name()].first; const auto pv = imap.GetFlatIdx(fluid_prim::velocity::name()); const auto pT = imap[pf::temperature].first; - const auto pye = imap[pf::ye].first; + const auto pye = imap[pf::ye::name()].first; const auto Inu0 = imap.GetFlatIdx(im::Inu0); const auto Inu1 = imap.GetFlatIdx(im::Inu1); const auto ijinvs = imap.GetFlatIdx(im::jinvs); @@ -562,7 +562,7 @@ TaskStatus MOCMCFluidSource(T *rc, const Real dt, const bool update_fluid) { if (update_fluid) { ceng = imap[cf::energy::name()].first; cmom_lo = imap[cf::momentum].first; - cye = imap[cf::ye].first; + cye = imap[cf::ye::name()].first; } const auto &ncov = swarm->template Get("ncov").Get(); diff --git a/src/radiation/moments.cpp b/src/radiation/moments.cpp index 429e70c7..716b5513 100644 --- a/src/radiation/moments.cpp +++ b/src/radiation/moments.cpp @@ -945,7 +945,7 @@ TaskStatus MomentCalculateOpacities(T *rc) { namespace c = fluid_cons; namespace p = fluid_prim; std::vector vars{ - p::density::name(), p::temperature, p::ye, p::velocity::name(), + p::density::name(), p::temperature, p::ye::name(), p::velocity::name(), ir::kappaJ, ir::kappaH, ir::JBB}; PackIndexMap imap; @@ -954,7 +954,7 @@ TaskStatus MomentCalculateOpacities(T *rc) { int prho = imap[p::density::name()].first; int pT = imap[p::temperature].first; - int pYe = imap[p::ye].first; + int pYe = imap[p::ye::name()].first; auto idx_kappaJ = imap.GetFlatIdx(ir::kappaJ); auto idx_kappaH = imap.GetFlatIdx(ir::kappaH); diff --git a/src/radiation/moments_source.cpp b/src/radiation/moments_source.cpp index e92ac2a7..7e0c637d 100644 --- a/src/radiation/moments_source.cpp +++ b/src/radiation/moments_source.cpp @@ -219,14 +219,14 @@ TaskStatus MomentFluidSourceImpl(T *rc, Real dt, bool update_fluid) { std::vector vars{c::density, c::energy::name(), c::momentum, - c::ye, + c::ye::name(), cr::E, cr::F, c::bfield::name(), p::density::name(), p::temperature, p::energy::name(), - p::ye, + p::ye::name(), p::velocity::name(), p::pressure, p::gamma1, @@ -256,7 +256,7 @@ TaskStatus MomentFluidSourceImpl(T *rc, Real dt, bool update_fluid) { int pT = imap[p::temperature].first; int pprs = imap[p::pressure].first; int pgm1 = imap[p::gamma1].first; - int pYe = imap[p::ye].first; + int pYe = imap[p::ye::name()].first; int pb_lo = imap[p::bfield::name()].first; int cb_lo = imap[c::bfield::name()].first; @@ -264,7 +264,7 @@ TaskStatus MomentFluidSourceImpl(T *rc, Real dt, bool update_fluid) { int ceng = imap[c::energy::name()].first; int cmom_lo = imap[c::momentum].first; int cmom_hi = imap[c::momentum].second; - int cye = imap[c::ye].first; + int cye = imap[c::ye::name()].first; IndexRange ib = rc->GetBoundsI(IndexDomain::interior); IndexRange jb = rc->GetBoundsJ(IndexDomain::interior); diff --git a/src/radiation/monte_carlo.cpp b/src/radiation/monte_carlo.cpp index 793045ea..4af727e3 100644 --- a/src/radiation/monte_carlo.cpp +++ b/src/radiation/monte_carlo.cpp @@ -54,10 +54,10 @@ void ComputeTotalEmissivity(Mesh *pmesh) { namespace p = fluid_prim; PackIndexMap imap; - auto v = rc->PackVariables({p::density::name(), p::temperature, p::ye}, imap); + auto v = rc->PackVariables({p::density::name(), p::temperature, p::ye::name()}, imap); const int prho = imap[p::density::name()].first; const int ptemp = imap[p::temperature].first; - const int pye = imap[p::ye].first; + const int pye = imap[p::ye::name()].first; Real Jtot_b = 0.0; // per block // into par_for @@ -150,12 +150,12 @@ TaskStatus MonteCarloSourceParticles(MeshBlock *pmb, MeshBlockData *rc, const Real h_code = code_constants.h; const Real mp_code = code_constants.mp; - std::vector vars({p::density::name(), p::temperature, p::ye, + std::vector vars({p::density::name(), p::temperature, p::ye::name(), p::velocity::name(), "dNdlnu_max", "dNdlnu", "dN", "Ns", iv::Gcov, iv::Gye}); PackIndexMap imap; auto v = rc->PackVariables(vars, imap); - const int pye = imap[p::ye].first; + const int pye = imap[p::ye::name()].first; const int pdens = imap[p::density::name()].first; const int ptemp = imap[p::temperature].first; const int pvlo = imap[p::velocity::name()].first; @@ -456,12 +456,12 @@ TaskStatus MonteCarloTransport(MeshBlock *pmb, MeshBlockData *rc, const Real h_code = code_constants.h; const Real mp_code = code_constants.mp; - std::vector vars({p::density::name(), p::ye, p::velocity::name(), + std::vector vars({p::density::name(), p::ye::name(), p::velocity::name(), p::temperature, iv::Gcov, iv::Gye}); PackIndexMap imap; auto v = rc->PackVariables(vars, imap); const int prho = imap[p::density::name()].first; - const int iye = imap[p::ye].first; + const int iye = imap[p::ye::name()].first; const int ivlo = imap[p::velocity::name()].first; const int ivhi = imap[p::velocity::name()].second; const int itemp = imap[p::temperature].first; diff --git a/src/radiation/radiation.cpp b/src/radiation/radiation.cpp index 4632b8be..3dc6e726 100644 --- a/src/radiation/radiation.cpp +++ b/src/radiation/radiation.cpp @@ -545,14 +545,14 @@ TaskStatus ApplyRadiationFourForce(MeshBlockData *rc, const double dt) { namespace iv = internal_variables; std::vector vars( - {c::density, c::energy::name(), c::momentum, c::ye, iv::Gcov, iv::Gye}); + {c::density, c::energy::name(), c::momentum, c::ye::name(), iv::Gcov, iv::Gye}); PackIndexMap imap; auto v = rc->PackVariables(vars, imap); const int crho = imap[c::density].first; const int ceng = imap[c::energy::name()].first; const int cmom_lo = imap[c::momentum].first; const int cmom_hi = imap[c::momentum].second; - const int cye = imap[c::ye].first; + const int cye = imap[c::ye::name()].first; const int Gcov_lo = imap[iv::Gcov].first; const int Gcov_hi = imap[iv::Gcov].second; const int Gye = imap[iv::Gye].first;