Skip to content

Commit

Permalink
add enum
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Jul 10, 2024
1 parent 19b2713 commit b2b9592
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Source/hydro/riemann.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ Castro::cmpflx_plus_godunov(const Box& bx,
{


if (riemann_solver == 0 || riemann_solver == 1) {
if (riemann_solver == riemann_constants::TWO_SHOCK_CGF ||
riemann_solver == riemann_constants::TWO_SHOCK_CG) {
// approximate state Riemann solvers

// first find the interface state on the current interface
Expand Down Expand Up @@ -120,7 +121,7 @@ Castro::cmpflx_plus_godunov(const Box& bx,
}
}

} else if (riemann_solver == 2) {
} else if (riemann_solver == riemann_constants::HLLC) {
// HLLC
HLL::HLLC(i, j, k, idir,
qm, qp,
Expand Down
8 changes: 8 additions & 0 deletions Source/hydro/riemann_constants.H
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
using namespace amrex::literals;

namespace riemann_constants {

enum RiemannSolver : std::uint8_t {
TWO_SHOCK_CGF=0,
TWO_SHOCK_CG,
HLLC,
EXACT
};

constexpr amrex::Real smlp1 = 1.e-10_rt;
constexpr amrex::Real small = 1.e-8_rt;
constexpr amrex::Real smallu = 1.e-12_rt;
Expand Down
4 changes: 2 additions & 2 deletions Source/hydro/riemann_solvers.H
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,12 @@ riemann_state(const int i, const int j, const int k, const int idir,


// Solve Riemann problem
if (riemann_solver == 0) {
if (riemann_solver == riemann_constants::TWO_SHOCK_CGF) {
// Colella, Glaz, & Ferguson solver

TwoShock::riemannus(ql, qr, raux, qint);

} else if (riemann_solver == 1) {
} else if (riemann_solver == riemann_constants::TWO_SHOCK_CG) {
// Colella & Glaz solver

#ifndef RADIATION
Expand Down

0 comments on commit b2b9592

Please sign in to comment.