ryujin 2.5.0 revision 3a6c8d57210175dea14d8116e1fe878f349f8c1c
Loading...
Searching...
No Matches
limiter.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3// Copyright (C) 2026 by the ryujin authors
4//
5
6#pragma once
7
8#include <ryujin/base/compile_time_options.h>
10
11#include <deal.II/base/tensor.h>
12
13#include <array>
14#include <concepts>
15#include <string>
16#include <tuple>
17
18namespace ryujin
19{
20 namespace Concept
21 {
28 template <typename V, int dim, typename Number>
30 requires(V view,
31 const typename V::PrecomputedVectorView &precomputed,
32 const typename V::state_type &U,
33 const typename V::flux_contribution_type &flux,
34 const dealii::Tensor<1, dim, Number> &scaled_c_ij,
35 const unsigned int *js) {
36 view.accumulate(precomputed, js, U, flux, scaled_c_ij, U);
37 };
38
39
46 template <typename V, int dim, typename Number>
48 requires(V view,
49 const typename V::PrecomputedVectorView &precomputed,
50 const typename V::state_type &U,
51 const dealii::Tensor<1, dim, Number> &scaled_c_ij) {
52 view.accumulate(precomputed, U, U, U, scaled_c_ij, U);
53 };
54
55
61 template <typename V, int dim, typename Number>
62 concept LimiterView =
63 std::same_as<typename V::Bounds, std::array<Number, V::n_bounds>> &&
66 V,
67 dim,
68 Number>)&&requires(V view,
69 const V &const_view,
70 const typename V::PrecomputedVectorView
72 const typename V::state_type &U,
73 const typename V::flux_contribution_type &flux,
74 const typename V::Bounds &bounds,
75 const unsigned int i,
76 const Number hd_i) {
77 {
78 const_view.iterations()
79 } -> std::convertible_to<unsigned int>;
80
81 /* Used by HyperbolicModule::step(): */
82 view.reset(precomputed, i, U, flux);
83 {
84 const_view.bounds(hd_i)
85 } -> std::same_as<typename V::Bounds>;
86 {
87 const_view.limit(bounds, U, U)
88 } -> std::same_as<std::tuple<Number, bool>>;
89
90 /* Used by SolutionTransfer: */
91 {
92 const_view.projection_bounds_from_state(precomputed, i, U)
93 } -> std::same_as<typename V::Bounds>;
94 {
95 const_view.combine_bounds(bounds, bounds)
96 } -> std::same_as<typename V::Bounds>;
97 {
98 const_view.fully_relax_bounds(bounds, hd_i)
99 } -> std::same_as<typename V::Bounds>;
100 };
101
102
109 template <typename T, typename System, int dim, typename Number>
110 concept Limiter =
111 std::constructible_from<T, const System &, const std::string &> &&
113 } // namespace Concept
114} // namespace ryujin