ryujin 2.5.0 revision 3a6c8d57210175dea14d8116e1fe878f349f8c1c
Loading...
Searching...
No Matches
hyperbolic_module.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>
12
13#include <deal.II/base/exceptions.h>
14
15#include <limits>
16#include <string>
17
18namespace ryujin
19{
20 namespace Interface
21 {
32 template <int dim, typename Number = double>
33 class HyperbolicModule : public Module<dim, Number>
34 {
35 public:
40
41 using typename Module<dim, Number>::StageVectors;
42
43 using typename Module<dim, Number>::StageWeights;
44
46
50
59 virtual void
61
82 virtual Number
83 step(const StateVector<Number> &old_state_vector,
84 StageVectors stage_state_vectors,
85 StageWeights stage_weights,
86 StateVector<Number> &new_state_vector,
87 Number tau = Number(0.),
88 Number tau_max = std::numeric_limits<Number>::max()) const = 0;
89
97 void set_cfl(Number new_cfl) const
98 {
99 Assert(new_cfl > Number(0.), dealii::ExcInternalError());
100 cfl_ = new_cfl;
101 }
102
109 void
110 set_acceptable_tau_max_ratio(Number new_acceptable_tau_max_ratio) const
111 {
112 Assert(new_acceptable_tau_max_ratio >= Number(1.),
113 dealii::ExcInternalError());
114 acceptable_tau_max_ratio_ = new_acceptable_tau_max_ratio;
115 }
116
118
122
128
129
132 ACCESSOR_READ_ONLY(acceptable_tau_max_ratio)
133
134
138 ACCESSOR_READ_ONLY(problem_dimension)
139
140
144 ACCESSOR_READ_ONLY(n_precomputed_values)
145
146 //@}
147
148 protected:
152 HyperbolicModule(const unsigned int problem_dimension,
153 const unsigned int n_precomputed_values,
154 const std::string &subsection)
155 : Module<dim, Number>(subsection)
156 , cfl_(Number(0.2))
157 , acceptable_tau_max_ratio_(Number(1.e6))
158 , problem_dimension_(problem_dimension)
159 , n_precomputed_values_(n_precomputed_values)
160 {
161 }
162
163 mutable Number cfl_;
165
166 private:
167 const unsigned int problem_dimension_;
168 const unsigned int n_precomputed_values_;
169 };
170 } // namespace Interface
171} // namespace ryujin
void set_acceptable_tau_max_ratio(Number new_acceptable_tau_max_ratio) const
virtual Number step(const StateVector< Number > &old_state_vector, StageVectors stage_state_vectors, StageWeights stage_weights, StateVector< Number > &new_state_vector, Number tau=Number(0.), Number tau_max=std::numeric_limits< Number >::max()) const =0
void set_cfl(Number new_cfl) const
HyperbolicModule(const unsigned int problem_dimension, const unsigned int n_precomputed_values, const std::string &subsection)
virtual void fill_precomputed_values(StateVector< Number > &state_vector) const =0
#define ACCESSOR_READ_ONLY(member)