395 std::array<std::reference_wrapper<const StateVector>, stages>
397 const std::array<Number, stages> stage_weights,
400 Number tau_max )
const
403 std::cout <<
"HyperbolicModule<Description, dim, Number>::step()"
407 auto &[old_U, old_precomputed, old_parabolic] = old_state_vector;
408 auto &new_U = std::get<0>(new_state_vector);
415 old_U.template copy_to_memory_space<MemorySpace>();
416 old_precomputed.template copy_to_memory_space<MemorySpace>();
417 for (
int s = 0; s < stages; ++s) {
418 const auto &[U_s, prec_s, V_s] = stage_state_vectors[s].get();
419 U_s.template copy_to_memory_space<MemorySpace>();
420 prec_s.template copy_to_memory_space<MemorySpace>();
422 new_U.template move_to_memory_space<MemorySpace>();
446 constexpr bool shallow_water =
447 std::is_same_v<Description, ShallowWater::Description>;
451 const unsigned int n_internal = offline_data_->n_locally_internal();
452 const unsigned int n_owned = offline_data_->n_locally_owned();
456 const auto sparsity_simd_view =
457 offline_data_->sparsity_pattern_simd().template view<MemorySpace>();
459 const auto mass_matrix_view =
460 offline_data_->mass_matrix().template view<MemorySpace>();
461 const auto lumped_mass_matrix_view =
462 offline_data_->lumped_mass_matrix().template view<MemorySpace>();
463 const auto lumped_mass_matrix_inverse_view =
464 offline_data_->lumped_mass_matrix_inverse()
465 .template view<MemorySpace>();
467 const auto cij_matrix_view =
468 offline_data_->cij_matrix().template view<MemorySpace>();
474 const bool have_discontinuous_ansatz =
475 offline_data_->discretization().have_discontinuous_ansatz();
476 using MatrixReadView =
477 decltype(offline_data_->mass_matrix().template view<MemorySpace>());
478 const auto mass_matrix_inverse_view =
479 have_discontinuous_ansatz
480 ? offline_data_->mass_matrix_inverse().template view<MemorySpace>()
482 const auto incidence_matrix_view =
483 have_discontinuous_ansatz
484 ? offline_data_->incidence_matrix().template view<MemorySpace>()
487 const auto *coupling_boundary_pairs =
488 offline_data_->coupling_boundary_pairs().template view<MemorySpace>();
489 const auto n_coupling_boundary_pairs =
490 offline_data_->coupling_boundary_pairs().size();
492 const Number measure_of_omega_inverse =
493 Number(1.) / offline_data_->measure_of_omega();
497 const auto dij_matrix_view = dij_matrix_.template view<MemorySpace>();
498 const auto lij_matrix_view = lij_matrix_.template view<MemorySpace>();
499 const auto lij_matrix_next_view =
500 lij_matrix_next_.template view<MemorySpace>();
501 const auto pij_matrix_view = pij_matrix_.template view<MemorySpace>();
505 const auto initial_precomputed_view =
506 initial_precomputed_.template view<MemorySpace>();
508 const auto old_U_view = old_U.template view<MemorySpace>();
509 const auto old_precomputed_view =
510 old_precomputed.template view<MemorySpace>();
517 using HyperbolicVectorView = std::remove_const_t<
decltype(old_U_view)>;
518 using PrecomputedVectorView =
519 std::remove_const_t<
decltype(old_precomputed_view)>;
521 Kokkos::Array<HyperbolicVectorView, stages> stage_U_view;
522 Kokkos::Array<PrecomputedVectorView, stages> stage_precomputed_view;
523 Kokkos::Array<Number, stages> stage_weight;
524 for (
int s = 0; s < stages; ++s) {
525 const auto &[U_s, prec_s, V_s] = stage_state_vectors[s].get();
526 stage_U_view[s] = U_s.template view<MemorySpace>();
527 stage_precomputed_view[s] = prec_s.template view<MemorySpace>();
528 stage_weight[s] = stage_weights[s];
531 const auto new_U_view = new_U.template view<MemorySpace>();
533 const auto alpha_view = alpha_.template view<MemorySpace>();
534 const auto bounds_view = bounds_.template view<MemorySpace>();
535 const auto r_view = r_.template view<MemorySpace>();
544 const Number cfl = cfl_;
546 const auto hyperbolic_system_views =
547 make_select_view<dim, Number, MemorySpace>(*hyperbolic_system_);
549 const auto indicator_views =
550 make_select_view<dim, Number, MemorySpace>(indicator_);
552 const auto limiter_views =
553 make_select_view<dim, Number, MemorySpace>(limiter_);
554 const auto n_limiter_iterations =
555 limiter_.template view<dim, Number>().iterations();
557 const auto wave_speed_estimator_views =
558 make_select_view<dim, Number, MemorySpace>(wave_speed_estimator_);
566 const auto scoped_name = [&step_no](
const auto &name,
567 const bool advance =
true) {
568 advance || step_no--;
569 return "time step [H] " + std::to_string(++step_no) +
" - " + name;
572 const auto loop_name = [&step_no]() {
573 return "hyperbolic_kernel_" + std::format(
"{:02}", step_no);
577 Mirrored<int> restart_needed(
"hyperbolic_module_restart_needed",
579 *restart_needed.
view() = 0;
609 const auto body = [=](
auto sentinel,
unsigned int i) {
610 using T =
decltype(sentinel);
612 const unsigned int stride_size = sparsity_simd_view.stride_of_row(i);
614 const auto wave_speed_estimator_view =
615 wave_speed_estimator_views.template view<T>();
617 auto indicator_view = indicator_views.template view<T>();
620 const unsigned int row_length = sparsity_simd_view.row_length(i);
624 const auto U_i = old_U_view.template read_tensor<T>(i);
626 indicator_view.reset(old_precomputed_view, i, U_i);
628 const unsigned int *js = sparsity_simd_view.columns(i);
629 for (
unsigned int col_idx = 0; col_idx < row_length;
630 ++col_idx, js += stride_size) {
632 const auto U_j = old_U_view.template read_tensor<T>(js);
634 const auto c_ij = cij_matrix_view.template read_tensor<T>(i, col_idx);
636 indicator_view.accumulate(old_precomputed_view, js, U_j, c_ij);
643 if (all_below_diagonal<T>(i, js))
646 const auto norm = c_ij.norm();
647 const auto n_ij = c_ij / norm;
648 const auto lambda_max = wave_speed_estimator_view.compute(
649 old_precomputed_view, U_i, U_j, i, js, n_ij);
650 const auto d_ij = norm * lambda_max;
652 dij_matrix_view.write_entry(d_ij, i, col_idx,
true);
655 const auto mass = lumped_mass_matrix_view.template read_entry<T>(i);
656 const auto hd_i = mass * measure_of_omega_inverse;
657 alpha_view.template write_entry<T>(indicator_view.alpha(hd_i), i);
660 loop<MemorySpace, Number>(loop_name(), body, 0, n_internal, n_owned);
662 alpha_view.update_ghost_values();
673 scoped_name(
"compute bdry d_ij, diag d_ii, and tau_max"));
689 const auto body_boundary = [=](
auto,
const unsigned int k) {
690 const auto &[i, col_idx, j] = coupling_boundary_pairs[k];
692 const auto wave_speed_estimator_view =
693 wave_speed_estimator_views.template view<Number>();
706 const auto U_i = old_U_view.read_tensor(i);
707 const auto U_j = old_U_view.read_tensor(j);
709 const auto c_ji = cij_matrix_view.read_transposed_tensor(i, col_idx);
710 Assert(c_ji.norm() > 1.e-12, ExcInternalError());
711 const auto norm_ji = c_ji.norm();
712 const auto n_ji = c_ji / norm_ji;
714 const auto d_ij = dij_matrix_view.read_entry(i, col_idx);
716 const auto lambda_max = wave_speed_estimator_view.compute(
717 old_precomputed_view, U_j, U_i, j, &i, n_ji);
718 const auto d_ji = norm_ji * lambda_max;
720 dij_matrix_view.write_entry(std::max(d_ij, d_ji), i, col_idx);
723 loop<MemorySpace, Number>(loop_name() +
'a',
727 n_coupling_boundary_pairs);
730 const auto body = [=](
auto,
unsigned int i) -> Number {
732#ifdef DEBUG_SYMMETRY_CHECK
733 const auto wave_speed_estimator_view =
734 wave_speed_estimator_views.template view<Number>();
738 const unsigned int row_length = sparsity_simd_view.row_length(i);
740 return std::numeric_limits<Number>::max();
742 Number d_sum = Number(0.);
745 const unsigned int stride_size = sparsity_simd_view.stride_of_row(i);
746 const unsigned int *js = sparsity_simd_view.columns(i);
747 for (
unsigned int col_idx = 1; col_idx < row_length; ++col_idx) {
748 const auto j = *(js + col_idx * stride_size);
752 const auto d_ji = dij_matrix_view.read_transposed_entry(i, col_idx);
754#ifdef DEBUG_SYMMETRY_CHECK
757 const auto U_i = old_U_view.read_tensor(i);
758 const auto U_j = old_U_view.read_tensor(j);
760 const auto c_ij = cij_matrix_view.read_tensor(i, col_idx);
761 Assert(c_ij.norm() > 1.e-12, ExcInternalError());
762 const auto norm_ij = c_ij.norm();
763 const auto n_ij = c_ij / norm_ij;
765 const auto lambda_max = wave_speed_estimator_view.compute(
766 old_precomputed_view, U_i, U_j, i, &j, n_ij);
767 const auto d_ij = norm_ij * lambda_max;
769 Assert(d_ij <= d_ji + 1.0e-12,
770 dealii::ExcMessage(
"d_ij not symmetrized correctly on "
771 "boundary degrees of freedom."));
774 dij_matrix_view.write_entry(d_ji, i, col_idx);
777 d_sum -= dij_matrix_view.read_entry(i, col_idx);
786 std::min(d_sum, Number(-1.e6) * std::numeric_limits<Number>::min());
789 dij_matrix_view.write_entry(d_sum, i, 0);
791 const Number mass = lumped_mass_matrix_view.read_entry(i);
792 return cfl * mass / (Number(-2.) * d_sum);
795 reduction_loop<MemorySpace>(
796 loop_name() +
'b', body, Kokkos::Min<Number>(tau_max), 0, n_owned);
806 tau_max = Utilities::MPI::min(
807 tau_max, mpi_ensemble_.synchronization_communicator());
810 !std::isnan(tau_max) && !std::isinf(tau_max) && tau_max > 0.,
812 "I'm sorry, Dave. I'm afraid I can't do that.\nWe crashed."));
814 tau = (tau == Number(0.) ? tau_max : tau);
817 std::cout <<
" computed tau_max = " << tau_max <<
" (CFL = " << cfl
819 std::cout <<
" step with tau = " << tau << std::endl;
823 *restart_needed.
view() = (tau > acceptable_tau_max_ratio_ * tau_max);
826 if (*restart_needed.
view() &&
831 std::cout <<
" signalling restart (suggested_tau_max = "
832 << tau_max <<
")" << std::endl;
840 int *restart_needed_view = restart_needed.
view<MemorySpace>();
844 dij_matrix_view.update_ghost_rows();
855 scoped_name(
"l.-o. update, compute bounds, r_i, and p_ij"));
857 const Number weight =
858 -std::accumulate(stage_weights.begin(), stage_weights.end(), -1.);
860 const auto body = [=](
auto sentinel,
861 auto have_discontinuous_ansatz,
862 const unsigned int i) {
863 using T =
decltype(sentinel);
865 const auto view = hyperbolic_system_views.template view<T>();
867 using View =
decltype(view);
868 using flux_contribution_type =
typename View::flux_contribution_type;
871 const unsigned int stride_size = sparsity_simd_view.stride_of_row(i);
873 auto limiter_view = limiter_views.template view<T>();
876 const unsigned int row_length = sparsity_simd_view.row_length(i);
880 const auto U_i = old_U_view.template read_tensor<T>(i);
883 const auto alpha_i = alpha_view.template read_entry<T>(i);
884 const auto m_i = lumped_mass_matrix_view.template read_entry<T>(i);
886 lumped_mass_matrix_inverse_view.template read_entry<T>(i);
888 const auto flux_i = view.flux_contribution(
889 old_precomputed_view, initial_precomputed_view, i, U_i);
891 Kokkos::Array<flux_contribution_type, stages> flux_iHs;
894 for (
int s = 0; s < stages; ++s) {
895 const auto U_iHs = stage_U_view[s].template read_tensor<T>(i);
896 flux_iHs[s] = view.flux_contribution(
897 stage_precomputed_view[s], initial_precomputed_view, i, U_iHs);
899 if constexpr (View::have_source_terms) {
900 S_iH += stage_weight[s] *
901 view.nodal_source(stage_precomputed_view[s], i, U_iHs, tau);
908 if constexpr (View::have_source_terms) {
909 S_i = view.nodal_source(old_precomputed_view, i, U_i, tau);
910 S_iH += weight * S_i;
911 U_i_new += tau * S_i;
915 limiter_view.reset(old_precomputed_view, i, U_i, flux_i);
925 const unsigned int *js = sparsity_simd_view.columns(i);
926 if constexpr (shallow_water) {
927 for (
unsigned int col_idx = 0; col_idx < row_length;
928 ++col_idx, js += stride_size) {
930 const auto U_j = old_U_view.template read_tensor<T>(js);
931 const auto flux_j = view.flux_contribution(
932 old_precomputed_view, initial_precomputed_view, js, U_j);
935 dij_matrix_view.template read_entry<T>(i, col_idx);
937 cij_matrix_view.template read_tensor<T>(i, col_idx);
939 const auto B_ij = view.affine_shift(flux_i, flux_j, c_ij, d_ij);
940 affine_shift += B_ij;
943 affine_shift *= tau * m_i_inv;
946 if constexpr (View::have_source_terms) {
947 affine_shift += tau * S_i;
950 js = sparsity_simd_view.columns(i);
951 for (
unsigned int col_idx = 0; col_idx < row_length;
952 ++col_idx, js += stride_size) {
954 const auto U_j = old_U_view.template read_tensor<T>(js);
956 const auto alpha_j = alpha_view.template read_entry<T>(js);
958 const auto d_ij = dij_matrix_view.template read_entry<T>(i, col_idx);
959 auto factor = (alpha_i + alpha_j) * Number(.5);
961 if constexpr (have_discontinuous_ansatz) {
962 const auto incidence_ij =
963 incidence_matrix_view.template read_entry<T>(i, col_idx);
964 factor = std::max(factor, incidence_ij);
967 const auto d_ijH = d_ij * factor;
969#ifdef DEBUG_SYMMETRY_CHECK
977 dij_matrix_view.template read_transposed_entry<T>(i, col_idx);
978 Assert(std::max(std::abs(d_ij - d_ji), T(1.0e-12)) == T(1.0e-12),
980 "d_ij not symmetrized correctly over MPI ranks"));
983 const auto c_ij = cij_matrix_view.template read_tensor<T>(i, col_idx);
984 constexpr auto eps = std::numeric_limits<Number>::epsilon();
987 ryujin::compare_and_apply_mask<dealii::SIMDComparison::less_than>(
988 std::abs(d_ij), T(eps * eps), T(0.), T(1.) / d_ij);
990 const auto scaled_c_ij = c_ij * scale;
992 const auto flux_j = view.flux_contribution(
993 old_precomputed_view, initial_precomputed_view, js, U_j);
995 const auto m_ij = mass_matrix_view.template read_entry<T>(i, col_idx);
1001 const auto flux_ij = view.flux_divergence(flux_i, flux_j, c_ij);
1002 U_i_new += tau * m_i_inv * flux_ij;
1003 auto P_ij = -flux_ij;
1005 if constexpr (shallow_water) {
1010 const auto &[U_star_ij, U_star_ji] =
1011 view.equilibrated_states(flux_i, flux_j);
1013 U_i_new += tau * m_i_inv * d_ij * (U_star_ji - U_star_ij);
1014 F_iH += d_ijH * (U_star_ji - U_star_ij);
1015 P_ij += (d_ijH - d_ij) * (U_star_ji - U_star_ij);
1017 limiter_view.accumulate(old_precomputed_view,
1026 U_i_new += tau * m_i_inv * d_ij * (U_j - U_i);
1027 F_iH += d_ijH * (U_j - U_i);
1028 P_ij += (d_ijH - d_ij) * (U_j - U_i);
1030 limiter_view.accumulate(old_precomputed_view,
1038 if constexpr (View::have_source_terms) {
1039 F_iH -= m_ij * S_iH;
1047 if constexpr (View::have_high_order_flux) {
1048 const auto high_order_flux_ij =
1049 view.high_order_flux_divergence(flux_i, flux_j, c_ij);
1050 F_iH += weight * high_order_flux_ij;
1051 P_ij += weight * high_order_flux_ij;
1053 F_iH += weight * flux_ij;
1054 P_ij += weight * flux_ij;
1057 if constexpr (View::have_source_terms) {
1059 view.nodal_source(old_precomputed_view, js, U_j, tau);
1060 F_iH += weight * m_ij * S_j;
1061 P_ij += weight * m_ij * S_j;
1064 for (
int s = 0; s < stages; ++s) {
1065 const auto U_jHs = stage_U_view[s].template read_tensor<T>(js);
1066 const auto flux_jHs = view.flux_contribution(
1067 stage_precomputed_view[s], initial_precomputed_view, js, U_jHs);
1069 if constexpr (View::have_high_order_flux) {
1070 const auto high_order_flux_ij =
1071 view.high_order_flux_divergence(flux_iHs[s], flux_jHs, c_ij);
1072 F_iH += stage_weight[s] * high_order_flux_ij;
1073 P_ij += stage_weight[s] * high_order_flux_ij;
1075 const auto flux_ij =
1076 view.flux_divergence(flux_iHs[s], flux_jHs, c_ij);
1077 F_iH += stage_weight[s] * flux_ij;
1078 P_ij += stage_weight[s] * flux_ij;
1081 if constexpr (View::have_source_terms) {
1083 view.nodal_source(stage_precomputed_view[s], js, U_jHs, tau);
1084 F_iH += stage_weight[s] * m_ij * S_js;
1085 P_ij += stage_weight[s] * m_ij * S_js;
1089 pij_matrix_view.template write_tensor<T>(P_ij, i, col_idx,
true);
1092#ifdef DEBUG_EXPENSIVE_BOUNDS_CHECK
1093 if (!view.is_admissible(U_i_new)) {
1094 atomic_store(restart_needed_view, 1);
1098 new_U_view.template write_tensor<T>(U_i_new, i);
1099 r_view.template write_tensor<T>(F_iH, i);
1101 const auto hd_i = m_i * measure_of_omega_inverse;
1102 const auto relaxed_bounds = limiter_view.bounds(hd_i);
1103 bounds_view.template write_tensor<T>(relaxed_bounds, i);
1112 if (have_discontinuous_ansatz) {
1113 loop<MemorySpace, Number>(
1114 loop_name(), body, 0, n_internal, n_owned, std::true_type{});
1116 loop<MemorySpace, Number>(
1117 loop_name(), body, 0, n_internal, n_owned, std::false_type{});
1120 r_view.update_ghost_values();
1121 if (have_discontinuous_ansatz) {
1127 bounds_view.update_ghost_values();
1137 if (n_limiter_iterations != 0) {
1140 const auto body = [=](
auto sentinel,
1141 auto have_discontinuous_ansatz,
1142 const unsigned int i) {
1143 using T =
decltype(sentinel);
1145 const unsigned int stride_size = sparsity_simd_view.stride_of_row(i);
1147 auto limiter_view = limiter_views.template view<T>();
1150 const unsigned int row_length = sparsity_simd_view.row_length(i);
1151 if (row_length == 1)
1155 bounds_view.template read_tensor<T, std::array<T, n_bounds>>(i);
1162 if constexpr (have_discontinuous_ansatz) {
1164 const unsigned int *js = sparsity_simd_view.columns(i) + stride_size;
1165 for (
unsigned int col_idx = 1; col_idx < row_length;
1166 ++col_idx, js += stride_size) {
1167 local_bounds = limiter_view.combine_bounds(
1169 bounds_view.template read_tensor<T, std::array<T, n_bounds>>(
1172 bounds_view.template write_tensor<T>(local_bounds, i);
1175 [[maybe_unused]] T m_i;
1176 if constexpr (have_discontinuous_ansatz)
1177 m_i = lumped_mass_matrix_view.template read_entry<T>(i);
1179 const auto m_i_inv =
1180 lumped_mass_matrix_inverse_view.template read_entry<T>(i);
1182 const auto U_i_new = new_U_view.template read_tensor<T>(i);
1184 const auto F_iH = r_view.template read_tensor<T>(i);
1186 const auto lambda_inv = Number(row_length - 1);
1187 const auto factor = tau * m_i_inv * lambda_inv;
1197 auto P_ij = pij_matrix_view.template read_tensor<T>(i, 1);
1200 const unsigned int *js = sparsity_simd_view.columns(i) + stride_size;
1201 for (
unsigned int col_idx = 1; col_idx < row_length;
1202 ++col_idx, js += stride_size) {
1204 const auto P_ij_next = pij_matrix_view.template read_tensor<T>(
1205 i, col_idx + 1 < row_length ? col_idx + 1 : col_idx);
1206 const auto F_jH = r_view.template read_tensor<T>(js);
1212 const auto kronecker_ij = col_idx == 0 ? T(1.) : T(0.);
1214 if constexpr (have_discontinuous_ansatz) {
1217 const auto m_j = lumped_mass_matrix_view.template read_entry<T>(js);
1218 const auto m_ij_inv =
1219 mass_matrix_inverse_view.template read_entry<T>(i, col_idx);
1220 const auto b_ij = m_i * m_ij_inv - kronecker_ij;
1221 const auto b_ji = m_j * m_ij_inv - kronecker_ij;
1223 P_ij += b_ij * F_jH - b_ji * F_iH;
1228 const auto m_j_inv =
1229 lumped_mass_matrix_inverse_view.template read_entry<T>(js);
1231 mass_matrix_view.template read_entry<T>(i, col_idx);
1232 const auto b_ij = kronecker_ij - m_ij * m_j_inv;
1233 const auto b_ji = kronecker_ij - m_ij * m_i_inv;
1235 P_ij += b_ij * F_jH - b_ji * F_iH;
1239 pij_matrix_view.template write_tensor<T>(P_ij, i, col_idx);
1245 const auto &[l_ij, success] =
1246 limiter_view.limit(local_bounds, U_i_new, P_ij);
1247 lij_matrix_view.template write_entry<T>(l_ij, i, col_idx,
true);
1258 atomic_store(restart_needed_view, 1);
1270 if (have_discontinuous_ansatz) {
1271 loop<MemorySpace, Number>(
1272 loop_name(), body, 0, n_internal, n_owned, std::true_type{});
1274 loop<MemorySpace, Number>(
1275 loop_name(), body, 0, n_internal, n_owned, std::false_type{});
1278 lij_matrix_view.update_ghost_rows();
1291 for (
unsigned int pass = 0; pass < n_limiter_iterations; ++pass) {
1292 bool last_round = (pass + 1 == n_limiter_iterations);
1294 std::string additional_step = (last_round ?
"" :
", next l_ij");
1296 scoped_name(
"symmetrize l_ij, h.-o. update" + additional_step));
1298 const auto lij_view = (n_limiter_iterations == 2 && last_round)
1299 ? lij_matrix_next_view
1302 const auto body = [=](
auto sentinel,
const unsigned int i) {
1303 using T =
decltype(sentinel);
1305 auto limiter_view = limiter_views.template view<T>();
1308 const unsigned int row_length = sparsity_simd_view.row_length(i);
1309 if (row_length == 1)
1312 auto U_i_new = new_U_view.template read_tensor<T>(i);
1314 const Number lambda = Number(1.) / Number(row_length - 1);
1317 for (
unsigned int col_idx = 1; col_idx < row_length; ++col_idx) {
1320 std::min(lij_view.template read_entry<T>(i, col_idx),
1321 lij_view.template read_transposed_entry<T>(i, col_idx));
1323 const auto p_ij = pij_matrix_view.template read_tensor<T>(i, col_idx);
1325 U_i_new += l_ij * lambda * p_ij;
1328#ifdef DEBUG_EXPENSIVE_BOUNDS_CHECK
1329 const auto view = hyperbolic_system_views.template view<T>();
1330 if (!view.is_admissible(U_i_new)) {
1331 atomic_store(restart_needed_view, 1);
1335 new_U_view.template write_tensor<T>(U_i_new, i);
1341 const auto local_bounds =
1342 bounds_view.template read_tensor<T, std::array<T, n_bounds>>(i);
1344 for (
unsigned int col_idx = 1; col_idx < row_length; ++col_idx) {
1346 const auto old_l_ij =
1347 std::min(lij_view.template read_entry<T>(i, col_idx),
1348 lij_view.template read_transposed_entry<T>(i, col_idx));
1350 const auto new_p_ij =
1351 (T(1.) - old_l_ij) *
1352 pij_matrix_view.template read_tensor<T>(i, col_idx);
1354 const auto &[new_l_ij, success] =
1355 limiter_view.limit(local_bounds, U_i_new, new_p_ij);
1367#ifdef DEBUG_EXPENSIVE_BOUNDS_CHECK
1369 atomic_store(restart_needed_view, 1);
1378 const auto entry = (T(1.) - old_l_ij) * new_l_ij;
1379 lij_matrix_next_view.write_entry(entry, i, col_idx,
true);
1383 loop<MemorySpace, Number>(loop_name(), body, 0, n_internal, n_owned);
1386 lij_matrix_next_view.update_ghost_rows();
1393 const auto &old_V = std::get<2>(old_state_vector);
1394 auto &new_V = std::get<2>(new_state_vector);
1413 int &restart_flag = *restart_needed.
view();
1414 restart_flag = Utilities::MPI::logical_or(
1415 restart_flag != 0, mpi_ensemble_.synchronization_communicator());
1418 if (*restart_needed.
view()) {
1419 switch (id_violation_strategy_) {
1423 std::cout <<
" raised warning, CFL/IDP violation encountered "
1431 std::cout <<
" signalling restart (suggested_tau_max = "
1432 << tau_max <<
")" << std::endl;