55 using Tscal = shambase::VecComponent<Tvec>;
56 static constexpr u32 dim = shambase::VectorProperties<Tvec>::dimension;
66 Tscal
tol = Tscal{1.0e-6};
78 Tscal
tol = Tscal{1.0e-8};
101 using Variant = std::variant<Iterative, Exact, HLLC, Roe>;
103 Variant config = Iterative{};
105 void set(Variant v) { config = v; }
107 void set_iterative(Tscal tol = Tscal{1.0e-6},
u32 max_iter = 20) {
111 void set_exact(Tscal tol = Tscal{1.0e-8}) { set(
Exact{tol}); }
113 void set_hllc() { set(
HLLC{}); }
115 void set_roe(Tscal entropy_fix = Tscal{0.1}) { set(
Roe{entropy_fix}); }
117 inline bool is_iterative()
const {
return std::holds_alternative<Iterative>(config); }
118 inline bool is_exact()
const {
return std::holds_alternative<Exact>(config); }
119 inline bool is_hllc()
const {
return std::holds_alternative<HLLC>(config); }
120 inline bool is_roe()
const {
return std::holds_alternative<Roe>(config); }
122 inline void print_status()
const {
123 logger::raw_ln(
"--- Riemann solver config");
125 if (
const Iterative *v = std::get_if<Iterative>(&config)) {
126 logger::raw_ln(
" Type : Iterative (van Leer 1997)");
127 logger::raw_ln(
" tol =", v->tol);
128 logger::raw_ln(
" max_iter =", v->max_iter);
129 }
else if (
const Exact *v = std::get_if<Exact>(&config)) {
130 logger::raw_ln(
" Type : Exact (Toro)");
131 logger::raw_ln(
" tol =", v->tol);
132 }
else if (std::get_if<HLLC>(&config)) {
133 logger::raw_ln(
" Type : HLLC");
134 }
else if (
const Roe *v = std::get_if<Roe>(&config)) {
135 logger::raw_ln(
" Type : Roe");
136 logger::raw_ln(
" entropy_fix =", v->entropy_fix);
141 logger::raw_ln(
"-------------");