ryujin 2.1.1 revision ee5cbcbf2346c1299c942d0e1f13b46449973c18
Loading...
Searching...
No Matches
time_integrator.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3// Copyright (C) 2022 - 2025 by the ryujin authors
4//
5
6#pragma once
7
8#include <compile_time_options.h>
9
10#include "convenience_macros.h"
11#include "hyperbolic_module.h"
12#include "mpi_ensemble.h"
13#include "observer_pointer.h"
14#include "offline_data.h"
15#include "parabolic_module.h"
16#include "patterns_conversion.h"
17
18#include <numbers>
19
20namespace ryujin
21{
32 none,
33
41
50 };
51
52
58 enum class TimeSteppingScheme {
86
91 erk_11,
92
104 erk_22,
105
118 erk_33,
119
132 erk_43,
133
138 erk_54,
139
145
151
157
162 imex_11,
163
187 imex_22,
188
216 imex_33,
217 };
218} // namespace ryujin
219
220#ifndef DOXYGEN
221DECLARE_ENUM(
225 {ryujin::CFLRecoveryStrategy::cruise_control, "cruise control"}, ));
226
227DECLARE_ENUM(
229 LIST({ryujin::TimeSteppingScheme::ssprk_22, "ssprk 22"},
242#endif
243
244namespace ryujin
245{
252 template <typename Description, int dim, typename Number = double>
253 class TimeIntegrator final : public dealii::ParameterAcceptor
254 {
255 public:
260
263
264 using View = typename HyperbolicSystem::template View<dim, Number>;
265
266 using StateVector = typename View::StateVector;
267
269
273
278 const MPIEnsemble &mpi_ensemble,
279 const OfflineData<dim, Number> &offline_data,
280 const HyperbolicModule<Description, dim, Number> &hyperbolic_module,
281 const ParabolicModule<Description, dim, Number> &parabolic_module,
282 const std::string &subsection = "/TimeIntegrator");
283
289 void prepare();
290
292
296
306 void prepare_state_vector(StateVector &state_vector, Number t) const;
307
325 Number step(StateVector &state_vector,
326 Number t,
327 Number t_final = std::numeric_limits<Number>::max());
328
330
334
339
347
348 private:
350
354
355 Number cfl_min_;
356 Number cfl_max_;
357
358 CFLRecoveryStrategy cfl_recovery_strategy_;
359
360 Number acceptable_tau_max_ratio_;
361 Number tau_max_;
362
363 TimeSteppingScheme time_stepping_scheme_;
364 Number efficiency_;
365
367
371
372 const MPIEnsemble &mpi_ensemble_;
373
374 dealii::ObserverPointer<const OfflineData<dim, Number>> offline_data_;
375 dealii::ObserverPointer<const HyperbolicModule<Description, dim, Number>>
376 hyperbolic_module_;
377 dealii::ObserverPointer<const ParabolicModule<Description, dim, Number>>
378 parabolic_module_;
379
380 std::vector<StateVector> temp_;
381
383
387
395 Number step_ssprk_22(StateVector &state_vector, Number t, Number tau_max);
396
404 Number step_ssprk_33(StateVector &state_vector, Number t, Number tau_max);
405
412 Number step_erk_11(StateVector &state_vector, Number t, Number tau_max);
413
420 Number step_erk_22(StateVector &state_vector, Number t, Number tau_max);
421
428 Number step_erk_33(StateVector &state_vector, Number t, Number tau_max);
429
437 Number step_erk_43(StateVector &state_vector, Number t, Number tau_max);
438
446 Number step_erk_54(StateVector &state_vector, Number t, Number tau_max);
447
456 Number step_strang_ssprk_33_cn(StateVector &state_vector,
457 Number t,
458 Number tau_max);
459
468 Number
469 step_strang_erk_33_cn(StateVector &state_vector, Number t, Number tau_max);
470
479 Number
480 step_strang_erk_43_cn(StateVector &state_vector, Number t, Number tau_max);
481
489 Number step_imex_11(StateVector &state_vector, Number t, Number tau_max);
490
497 Number step_imex_22(StateVector &state_vector, Number t, Number tau_max);
498
505 Number step_imex_33(StateVector &state_vector, Number t, Number tau_max);
506
508 };
509
510} /* namespace ryujin */
const auto & time_stepping_scheme() const
typename Description::HyperbolicSystem HyperbolicSystem
typename View::StateVector StateVector
typename Description::ParabolicSystem ParabolicSystem
typename HyperbolicSystem::template View< dim, Number > View
const auto & efficiency() const
void prepare_state_vector(StateVector &state_vector, Number t) const
Number step(StateVector &state_vector, Number t, Number t_final=std::numeric_limits< Number >::max())
#define ACCESSOR_READ_ONLY(member)
typename Description::template ParabolicModule< dim, Number > ParabolicModule
Euler::HyperbolicSystem HyperbolicSystem
Definition description.h:34
ryujin::StubParabolicSystem ParabolicSystem
Definition description.h:36