Skip to content

Commit

Permalink
only compute hydro version of shock variable for hybrid Riemann
Browse files Browse the repository at this point in the history
in the CTU solver, we compute a local version of the shock flag
used just for the Riemann solver.  This removes the SHOCK_VAR
check, since we only need this local version if we are doing the
hybrid Riemann solve.  This local shk array is never used for the
StateData USHK flag.
  • Loading branch information
zingale committed Jun 5, 2024
1 parent 3e61f15 commit 8531b81
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions Source/hydro/Castro_ctu_hydro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,13 @@ Castro::construct_ctu_hydro_source(Real time, Real dt) // NOLINT(readability-co
shk.resize(obx, 1);
fab_size += shk.nBytes();

Array4<Real> const shk_arr = shk.array();

// Multidimensional shock detection
// Used for the hybrid Riemann solver

#ifdef SHOCK_VAR
bool compute_shock = true;
#else
bool compute_shock = false;
#endif
// this is a local shock variable used only for the Riemann
// solver -- this will never be used to update the value in the
// conserved state.

Array4<Real> const shk_arr = shk.array();

// get the primitive variable hydro sources

Expand All @@ -285,7 +282,7 @@ Castro::construct_ctu_hydro_source(Real time, Real dt) // NOLINT(readability-co
hydro::src_to_prim(i, j, k, dt, U_old_arr, q_arr, old_src_arr, src_corr_arr, src_q_arr);
});

if (hybrid_riemann == 1 || compute_shock) {
if (hybrid_riemann == 1) {
shock(obx, q_arr, old_src_arr, shk_arr);
}
else {
Expand Down

0 comments on commit 8531b81

Please sign in to comment.