ryujin 2.1.1 revision ee5cbcbf2346c1299c942d0e1f13b46449973c18
Loading...
Searching...
No Matches
indicator.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3// Copyright (C) 2023 - 2025 by the ryujin authors
4//
5
6#pragma once
7
8#include <compile_time_options.h>
9
10#include "hyperbolic_system.h"
11
13#include <observer_pointer.h>
14#include <simd.h>
15
16#include <deal.II/base/parameter_acceptor.h>
17#include <deal.II/base/vectorization.h>
18
19
20namespace ryujin
21{
22 namespace Skeleton
23 {
24 template <int dim, typename Number = double>
25 class IndicatorView;
26
33 template <typename ScalarNumber = double>
34 class Indicator : public dealii::ParameterAcceptor
35 {
36 public:
41
46 template <int dim, typename Number = double>
48
50
54
58 Indicator(const HyperbolicSystem &hyperbolic_system,
59 const std::string &subsection = "/Indicator")
60 : ParameterAcceptor(subsection)
61 , hyperbolic_system_(&hyperbolic_system)
62 {
63 }
64
66
70
76 template <int dim, typename Number>
77 auto view() const
78 {
79 return View<dim, Number>{
80 hyperbolic_system_->template view<dim, Number>(), *this};
81 }
82
83 private:
85
89
90 dealii::ObserverPointer<const HyperbolicSystem> hyperbolic_system_;
91
93 };
94
95
104 template <int dim, typename Number>
106 {
107 public:
112
114
116
117 using state_type = typename View::state_type;
118
120
122
140
145 IndicatorView(const View &view, const Indicator<ScalarNumber> &indicator)
146 : view_(view)
147 , indicator_(indicator)
148 {
149 }
150
155 void reset(const PrecomputedVectorView & /*pv*/,
156 const unsigned int /*i*/,
157 const state_type & /*U_i*/)
158 {
159 // empty
160 }
161
167 const unsigned int * /*js*/,
168 const state_type & /*U_j*/,
169 const dealii::Tensor<1, dim, Number> & /*c_ij*/)
170 {
171 // empty
172 }
173
177 Number alpha(const Number /*h_i*/) const
178 {
179 return Number(0.);
180 }
181
182
183 private:
185
189
190 const View view_;
191 const Indicator<ScalarNumber> &indicator_;
192
194 };
195 } // namespace Skeleton
196} // namespace ryujin
Vectors::MultiComponentVectorView< ScalarNumber, n_precomputed_values, dealii::VectorizedArray< ScalarNumber >::size(), dealii::MemorySpace::Host, false > PrecomputedVectorView
dealii::Tensor< 1, problem_dimension, Number > state_type
typename get_value_type< Number >::type ScalarNumber
Number alpha(const Number) const
Definition indicator.h:177
void reset(const PrecomputedVectorView &, const unsigned int, const state_type &)
Definition indicator.h:155
typename View::PrecomputedVectorView PrecomputedVectorView
Definition indicator.h:119
typename View::state_type state_type
Definition indicator.h:117
typename View::ScalarNumber ScalarNumber
Definition indicator.h:115
void accumulate(const PrecomputedVectorView &, const unsigned int *, const state_type &, const dealii::Tensor< 1, dim, Number > &)
Definition indicator.h:166
IndicatorView(const View &view, const Indicator< ScalarNumber > &indicator)
Definition indicator.h:145
HyperbolicSystemView< dim, Number > View
Definition indicator.h:113
Indicator(const HyperbolicSystem &hyperbolic_system, const std::string &subsection="/Indicator")
Definition indicator.h:58