21 const Number t_max )
const
26 constexpr ScalarNumber eps = std::numeric_limits<ScalarNumber>::epsilon();
27 const auto large = view_.vacuum_state_relaxation_large();
35 const auto &rho_U = view_.density(U);
36 const auto &rho_P = view_.density(P);
38 const auto &rho_min = std::get<0>(bounds);
39 const auto &rho_max = std::get<1>(bounds);
45 const auto test_min = view_.filter_vacuum_density(
46 std::max(Number(0.), rho_U - relax * rho_max));
47 const auto test_max = view_.filter_vacuum_density(
48 std::max(Number(0.), rho_min - relax * rho_U));
49 if (!(test_min == Number(0.) && test_max == Number(0.))) {
51 std::cout << std::fixed << std::setprecision(16);
52 std::cout <<
"Bounds violation: low-order density (critical)!"
53 <<
"\n\t\trho min: " << rho_min
54 <<
"\n\t\trho min (delta): "
56 <<
"\n\t\trho: " << rho_U
57 <<
"\n\t\trho max (delta): "
59 <<
"\n\t\trho max: " << rho_max <<
"\n"
65 const Number denominator =
68 t_r = dealii::compare_and_apply_mask<dealii::SIMDComparison::less_than>(
77 (rho_max - rho_U) * denominator,
80 t_r = dealii::compare_and_apply_mask<dealii::SIMDComparison::less_than>(
89 (rho_U - rho_min) * denominator,
99 t_r = std::min(t_r, t_max);
100 t_r = std::max(t_r, t_min);
102#ifdef DEBUG_EXPENSIVE_BOUNDS_CHECK
106 const auto rho_new = view_.density(U + t_r * P);
107 const auto test_new_min = view_.filter_vacuum_density(
108 std::max(Number(0.), rho_new - relax * rho_max));
109 const auto test_new_max = view_.filter_vacuum_density(
110 std::max(Number(0.), rho_min - relax * rho_new));
111 if (!(test_new_min == Number(0.) && test_new_max == Number(0.))) {
113 std::cout << std::fixed << std::setprecision(16);
114 std::cout <<
"Bounds violation: high-order density!"
115 <<
"\n\t\trho min: " << rho_min
116 <<
"\n\t\trho min (delta): "
118 <<
"\n\t\trho: " << rho_new
119 <<
"\n\t\trho max (delta): "
121 <<
"\n\t\trho max: " << rho_max <<
"\n"
129 return {t_r, success};