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};
102 using Variant = std::variant<Iterative, Exact, HLLC, Roe>;
104 Variant config = Iterative{};
106 void set(Variant v) { config = v; }
108 void set_iterative(Tscal tol = Tscal{1.0e-6},
u32 max_iter = 20) {
112 void set_exact(Tscal tol = Tscal{1.0e-8},
u32 max_iter = 100) { set(
Exact{tol, max_iter}); }
114 void set_hllc() { set(
HLLC{}); }
116 void set_roe(Tscal entropy_fix = Tscal{0.1}) { set(
Roe{entropy_fix}); }
118 inline bool is_iterative()
const {
return std::holds_alternative<Iterative>(config); }
119 inline bool is_exact()
const {
return std::holds_alternative<Exact>(config); }
120 inline bool is_hllc()
const {
return std::holds_alternative<HLLC>(config); }
121 inline bool is_roe()
const {
return std::holds_alternative<Roe>(config); }
123 inline void print_status()
const {
124 logger::raw_ln(
"--- Riemann solver config");
126 if (
const Iterative *v = std::get_if<Iterative>(&config)) {
127 logger::raw_ln(
" Type : Iterative (van Leer 1997)");
128 logger::raw_ln(
" tol =", v->tol);
129 logger::raw_ln(
" max_iter =", v->max_iter);
130 }
else if (
const Exact *v = std::get_if<Exact>(&config)) {
131 logger::raw_ln(
" Type : Exact (Toro)");
132 logger::raw_ln(
" tol =", v->tol);
133 logger::raw_ln(
" max_iter =", v->max_iter);
134 }
else if (std::get_if<HLLC>(&config)) {
135 logger::raw_ln(
" Type : HLLC");
136 }
else if (
const Roe *v = std::get_if<Roe>(&config)) {
137 logger::raw_ln(
" Type : Roe");
138 logger::raw_ln(
" entropy_fix =", v->entropy_fix);
143 logger::raw_ln(
"-------------");