ryujin 2.1.1 revision 0348cbb53a3e4b1da2a4c037e81f88f2d21ce219
riemann_solver.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0
3// [LANL Copyright Statement]
4// Copyright (C) 2023 - 2024 by the ryujin authors
5// Copyright (C) 2023 - 2024 by Triad National Security, LLC
6//
7
8#pragma once
9
10#include "hyperbolic_system.h"
11
12#include <simd.h>
13
14#include <deal.II/base/point.h>
15#include <deal.II/base/tensor.h>
16
17namespace ryujin
18{
19 namespace ShallowWater
20 {
21 template <typename ScalarNumber = double>
22 class RiemannSolverParameters : public dealii::ParameterAcceptor
23 {
24 public:
25 RiemannSolverParameters(const std::string &subsection = "/RiemannSolver")
26 : ParameterAcceptor(subsection)
27 {
28 }
29 };
30
31
40 template <int dim, typename Number = double>
42 {
43 public:
48
50
52
54
55 using state_type = typename View::state_type;
56
61 static constexpr unsigned int riemann_data_size = 3;
62
67 using primitive_type = typename std::array<Number, riemann_data_size>;
68
70
72
74
76
80
84 RiemannSolver(const HyperbolicSystem &hyperbolic_system,
85 const Parameters &parameters,
86 const PrecomputedVector &precomputed_values)
87 : hyperbolic_system(hyperbolic_system)
88 , parameters(parameters)
89 , precomputed_values(precomputed_values)
90 {
91 }
92
98 Number compute(const primitive_type &riemann_data_i,
99 const primitive_type &riemann_data_j) const;
100
105 Number compute(const state_type &U_i,
106 const state_type &U_j,
107 const unsigned int i,
108 const unsigned int *js,
109 const dealii::Tensor<1, dim, Number> &n_ij) const;
110
111 protected:
113
117
118 Number f(const primitive_type &primitive_state,
119 const Number &h_star) const;
120
121 Number phi(const primitive_type &riemann_data_i,
122 const primitive_type &riemann_data_j,
123 const Number &h) const;
124
125 Number lambda1_minus(const primitive_type &riemann_data,
126 const Number h_star) const;
127
128 Number lambda3_plus(const primitive_type &riemann_data,
129 const Number h_star) const;
130
131 Number compute_lambda(const primitive_type &riemann_data_i,
132 const primitive_type &riemann_data_j,
133 const Number h_star) const;
134
135 public:
136 Number compute_h_star(const primitive_type &riemann_data_i,
137 const primitive_type &riemann_data_j) const;
138
139 protected:
142 const dealii::Tensor<1, dim, Number> &n_ij) const;
143
144 private:
145 const HyperbolicSystem &hyperbolic_system;
146 const Parameters &parameters;
147 const PrecomputedVector &precomputed_values;
149 };
150 } // namespace ShallowWater
151} // namespace ryujin
typename get_value_type< Number >::type ScalarNumber
Vectors::MultiComponentVector< ScalarNumber, n_precomputed_values > PrecomputedVector
dealii::Tensor< 1, problem_dimension, Number > state_type
std::array< Number, n_precomputed_values > precomputed_type
static constexpr unsigned int problem_dimension
RiemannSolverParameters(const std::string &subsection="/RiemannSolver")
Number phi(const primitive_type &riemann_data_i, const primitive_type &riemann_data_j, const Number &h) const
primitive_type riemann_data_from_state(const state_type &U, const dealii::Tensor< 1, dim, Number > &n_ij) const
typename std::array< Number, riemann_data_size > primitive_type
typename View::ScalarNumber ScalarNumber
RiemannSolverParameters< ScalarNumber > Parameters
Number lambda3_plus(const primitive_type &riemann_data, const Number h_star) const
Number lambda1_minus(const primitive_type &riemann_data, const Number h_star) const
static constexpr unsigned int riemann_data_size
Number compute_lambda(const primitive_type &riemann_data_i, const primitive_type &riemann_data_j, const Number h_star) const
typename View::PrecomputedVector PrecomputedVector
RiemannSolver(const HyperbolicSystem &hyperbolic_system, const Parameters &parameters, const PrecomputedVector &precomputed_values)
Number compute_h_star(const primitive_type &riemann_data_i, const primitive_type &riemann_data_j) const
typename View::precomputed_type precomputed_type
typename View::state_type state_type
Number compute(const primitive_type &riemann_data_i, const primitive_type &riemann_data_j) const
Number f(const primitive_type &primitive_state, const Number &h_star) const
static constexpr auto problem_dimension