ryujin 2.1.1 revision ee5cbcbf2346c1299c942d0e1f13b46449973c18
Loading...
Searching...
No Matches
wave_speed_estimator.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3// Copyright (C) 2023 - 2026 by the ryujin authors
4//
5
6#pragma once
7
8#include <compile_time_options.h>
9
10#include "hyperbolic_system.h"
11
12#include <observer_pointer.h>
13#include <simd.h>
14
15#include <deal.II/base/point.h>
16#include <deal.II/base/tensor.h>
17
18namespace ryujin
19{
20 namespace Skeleton
21 {
22 template <int dim, typename Number = double>
23 class WaveSpeedEstimatorView;
24
33 template <typename ScalarNumber = double>
34 class WaveSpeedEstimator : public dealii::ParameterAcceptor
35 {
36 public:
41
46 template <int dim, typename Number = double>
48
50
54
58 WaveSpeedEstimator(const HyperbolicSystem &hyperbolic_system,
59 const std::string &subsection = "/WaveSpeedEstimator")
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
126
132 const View &view,
133 const WaveSpeedEstimator<ScalarNumber> &wave_speed_estimator)
134 : view_(view)
135 , wave_speed_estimator_(wave_speed_estimator)
136 {
137 }
138
143 Number compute(const PrecomputedVectorView & /*pv*/,
144 const state_type & /*U_i*/,
145 const state_type & /*U_j*/,
146 const unsigned int /*i*/,
147 const unsigned int * /*js*/,
148 const dealii::Tensor<1, dim, Number> & /*n_ij*/) const
149 {
150 return Number(std::numeric_limits<ScalarNumber>::epsilon());
151 }
152
153 private:
155
159
160 const View view_;
161 const WaveSpeedEstimator<ScalarNumber> &wave_speed_estimator_;
162
164 };
165 } // namespace Skeleton
166} // 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
HyperbolicSystemView< dim, Number > View
Number compute(const PrecomputedVectorView &, const state_type &, const state_type &, const unsigned int, const unsigned int *, const dealii::Tensor< 1, dim, Number > &) const
WaveSpeedEstimatorView(const View &view, const WaveSpeedEstimator< ScalarNumber > &wave_speed_estimator)
typename View::PrecomputedVectorView PrecomputedVectorView
WaveSpeedEstimator(const HyperbolicSystem &hyperbolic_system, const std::string &subsection="/WaveSpeedEstimator")