ryujin 2.5.0 revision 3a6c8d57210175dea14d8116e1fe878f349f8c1c
Loading...
Searching...
No Matches
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>
11
12#include <deal.II/base/parameter_acceptor.h>
13
14#include <cstdint>
15#include <functional>
16#include <initializer_list>
17#include <ostream>
18#include <string>
19
20namespace ryujin
21{
42 enum class IDViolationStrategy : std::uint8_t {
47 warn,
48
55 };
56
57
74 class Restart final
75 {
76 public:
78 };
79
80
91 class Correction final
92 {
93 };
94
95
96 namespace Interface
97 {
110 template <int dim, typename Number = double>
111 class Module : public dealii::ParameterAcceptor
112 {
113 public:
118
122 using StageVectors = std::initializer_list<
123 std::reference_wrapper<const StateVector<Number>>>;
124
128 using StageWeights = std::initializer_list<Number>;
129
131
135
143 virtual void prepare() = 0;
144
155 virtual void
156 reinit_state_vector(StateVector<Number> &state_vector) const = 0;
157
164 virtual void prepare_state_vector(StateVector<Number> &state_vector,
165 Number t) const = 0;
166
170 void set_id_violation_strategy(const IDViolationStrategy &strategy) const
171 {
172 id_violation_strategy_ = strategy;
173 }
174
176
180
186 virtual void print_solver_statistics(std::ostream &output) const = 0;
187
193 ACCESSOR_READ_ONLY(n_restarts)
194
195
198 ACCESSOR_READ_ONLY(n_corrections)
199
200
205 ACCESSOR_READ_ONLY(n_warnings)
206
207 //@}
208
209 protected:
213 explicit Module(const std::string &subsection)
214 : ParameterAcceptor(subsection)
215 , id_violation_strategy_(IDViolationStrategy::warn)
216 , n_restarts_(0)
217 , n_corrections_(0)
218 , n_warnings_(0)
219 {
220 }
221
222 mutable IDViolationStrategy id_violation_strategy_;
223
224 mutable unsigned int n_restarts_;
225 mutable unsigned int n_corrections_;
226 mutable unsigned int n_warnings_;
227 };
228 } // namespace Interface
229} // namespace ryujin
double suggested_tau_max
Definition module.h:77
IDViolationStrategy
Definition module.h:42
#define ACCESSOR_READ_ONLY(member)