13#include <deal.II/base/parameter_acceptor.h>
14#include <deal.II/base/vectorization.h>
19 namespace ScalarConservation
21 template <
typename ScalarNumber =
double>
26 : ParameterAcceptor(subsection)
28 evc_factor_ = ScalarNumber(1.);
29 add_parameter(
"evc factor",
31 "Factor for scaling the entropy viscocity commuator");
37 ScalarNumber evc_factor_;
47 template <
int dim,
typename Number =
double>
98 : hyperbolic_system(hyperbolic_system)
99 , parameters(parameters)
100 , precomputed_values(precomputed_values)
116 const dealii::Tensor<1, dim, Number> &c_ij);
121 Number
alpha(
const Number h_i)
const;
137 dealii::Tensor<1, dim, Number> f_i;
151 template <
int dim,
typename Number>
152 DEAL_II_ALWAYS_INLINE
inline void
157 const auto view = hyperbolic_system.view<dim, Number>();
160 precomputed_values.template get_tensor<Number, precomputed_type>(i);
162 u_i = view.state(U_i);
163 u_abs_max = std::abs(u_i);
164 f_i = view.construct_flux_tensor(prec_i);
170 template <
int dim,
typename Number>
172 const unsigned int *js,
174 const dealii::Tensor<1, dim, Number> &c_ij)
178 const auto view = hyperbolic_system.view<dim, Number>();
181 precomputed_values.template get_tensor<Number, precomputed_type>(js);
183 const auto u_j = view.state(U_j);
184 u_abs_max = std::max(u_abs_max, std::abs(u_j));
185 const auto d_eta_j = view.kruzkov_entropy_derivative(u_i, u_j);
186 const auto f_j = view.construct_flux_tensor(prec_j);
188 left += d_eta_j * (f_j * c_ij);
189 right += d_eta_j * (f_i * c_ij);
193 template <
int dim,
typename Number>
194 DEAL_II_ALWAYS_INLINE
inline Number
197 Number numerator = left - right;
198 Number denominator = std::abs(left) + std::abs(right);
200 const auto regularization =
201 Number(100. * std::numeric_limits<ScalarNumber>::min());
203 const auto quotient =
204 std::abs(numerator) /
205 (denominator + std::max(hd_i * std::abs(u_abs_max), regularization));
207 return std::min(Number(1.), parameters.evc_factor() * quotient);
static constexpr unsigned int problem_dimension
dealii::Tensor< 1, problem_dimension, dealii::Tensor< 1, dim, Number > > flux_type
std::array< Number, n_precomputed_values > precomputed_type
Vectors::MultiComponentVector< ScalarNumber, n_precomputed_values > PrecomputedVector
typename get_value_type< Number >::type ScalarNumber
dealii::Tensor< 1, problem_dimension, Number > state_type
ACCESSOR_READ_ONLY(evc_factor)
IndicatorParameters(const std::string &subsection="/Indicator")
void reset(const unsigned int i, const state_type &U_i)
typename View::state_type state_type
typename View::PrecomputedVector PrecomputedVector
typename View::ScalarNumber ScalarNumber
void accumulate(const unsigned int *js, const state_type &U_j, const dealii::Tensor< 1, dim, Number > &c_ij)
static constexpr auto problem_dimension
typename View::flux_type flux_type
Indicator(const HyperbolicSystem &hyperbolic_system, const Parameters ¶meters, const PrecomputedVector &precomputed_values)
Number alpha(const Number h_i) const
typename View::precomputed_type precomputed_type