ryujin 2.1.1 revision 0348cbb53a3e4b1da2a4c037e81f88f2d21ce219
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 - 2024 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 "offline_data.h"
14#include "parabolic_module.h"
15#include "patterns_conversion.h"
16
17#include <deal.II/base/smartpointer.h>
18
19namespace ryujin
20{
31 none,
32
40 };
41
42
48 enum class TimeSteppingScheme {
76
81 erk_11,
82
94 erk_22,
95
108 erk_33,
109
122 erk_43,
123
128 erk_54,
129
135
141
147
152 imex_11,
153
177 imex_22,
178
206 imex_33,
207 };
208} // namespace ryujin
209
210#ifndef DOXYGEN
211DECLARE_ENUM(ryujin::CFLRecoveryStrategy,
214 "bang bang control"}));
215
216DECLARE_ENUM(
218 LIST({ryujin::TimeSteppingScheme::ssprk_22, "ssprk 22"},
231#endif
232
233namespace ryujin
234{
241 template <typename Description, int dim, typename Number = double>
242 class TimeIntegrator final : public dealii::ParameterAcceptor
243 {
244 public:
249
251
252 using View =
253 typename Description::template HyperbolicSystemView<dim, Number>;
254
256
258
260
264
269 const MPIEnsemble &mpi_ensemble,
270 const OfflineData<dim, Number> &offline_data,
271 const HyperbolicModule<Description, dim, Number> &hyperbolic_module,
272 const ParabolicModule<Description, dim, Number> &parabolic_module,
273 const std::string &subsection = "/TimeIntegrator");
274
280 void prepare();
281
283
287
301 Number step(StateVector &state_vector,
302 Number t,
303 Number t_final = std::numeric_limits<Number>::max());
304
309
317
318 protected:
326 Number step_ssprk_22(StateVector &state_vector, Number t, Number tau_max);
327
335 Number step_ssprk_33(StateVector &state_vector, Number t, Number tau_max);
336
343 Number step_erk_11(StateVector &state_vector, Number t, Number tau_max);
344
351 Number step_erk_22(StateVector &state_vector, Number t, Number tau_max);
352
359 Number step_erk_33(StateVector &state_vector, Number t, Number tau_max);
360
368 Number step_erk_43(StateVector &state_vector, Number t, Number tau_max);
369
377 Number step_erk_54(StateVector &state_vector, Number t, Number tau_max);
378
387 Number step_strang_ssprk_33_cn(StateVector &state_vector,
388 Number t,
389 Number tau_max);
390
399 Number
400 step_strang_erk_33_cn(StateVector &state_vector, Number t, Number tau_max);
401
410 Number
411 step_strang_erk_43_cn(StateVector &state_vector, Number t, Number tau_max);
412
417 Number step_imex_11(StateVector &state_vector, Number t, Number tau_max);
418
425 Number step_imex_22(StateVector &state_vector, Number t, Number tau_max);
426
433 Number step_imex_33(StateVector &state_vector, Number t, Number tau_max);
434
435 private:
437
441
442 Number cfl_min_;
443 Number cfl_max_;
444
445 CFLRecoveryStrategy cfl_recovery_strategy_;
446
447 TimeSteppingScheme time_stepping_scheme_;
448 double efficiency_;
449
451
453
457
458 const MPIEnsemble &mpi_ensemble_;
459
460 dealii::SmartPointer<const OfflineData<dim, Number>> offline_data_;
461 dealii::SmartPointer<const HyperbolicModule<Description, dim, Number>>
462 hyperbolic_module_;
463 dealii::SmartPointer<const ParabolicModule<Description, dim, Number>>
464 parabolic_module_;
465
466 std::vector<StateVector> temp_;
467
469 };
470
471} /* namespace ryujin */
Number step_imex_33(StateVector &state_vector, Number t, Number tau_max)
TimeIntegrator(const MPIEnsemble &mpi_ensemble, const OfflineData< dim, Number > &offline_data, const HyperbolicModule< Description, dim, Number > &hyperbolic_module, const ParabolicModule< Description, dim, Number > &parabolic_module, const std::string &subsection="/TimeIntegrator")
Number step_strang_ssprk_33_cn(StateVector &state_vector, Number t, Number tau_max)
Number step_erk_22(StateVector &state_vector, Number t, Number tau_max)
Number step_imex_11(StateVector &state_vector, Number t, Number tau_max)
Number step_strang_erk_43_cn(StateVector &state_vector, Number t, Number tau_max)
Number step_erk_54(StateVector &state_vector, Number t, Number tau_max)
Number step_erk_33(StateVector &state_vector, Number t, Number tau_max)
typename Description::HyperbolicSystem HyperbolicSystem
Number step_erk_43(StateVector &state_vector, Number t, Number tau_max)
Number step_imex_22(StateVector &state_vector, Number t, Number tau_max)
typename View::StateVector StateVector
typename Description::ParabolicSystem ParabolicSystem
auto & efficiency() const
Number step_erk_11(StateVector &state_vector, Number t, Number tau_max)
Number step_ssprk_22(StateVector &state_vector, Number t, Number tau_max)
auto & time_stepping_scheme() const
Number step_ssprk_33(StateVector &state_vector, Number t, Number tau_max)
typename Description::template HyperbolicSystemView< dim, Number > View
Number step(StateVector &state_vector, Number t, Number t_final=std::numeric_limits< Number >::max())
Number step_strang_erk_33_cn(StateVector &state_vector, Number t, Number tau_max)
#define ACCESSOR_READ_ONLY(member)
std::tuple< MultiComponentVector< Number, problem_dim >, MultiComponentVector< Number, prec_dim >, BlockVector< Number > > StateVector
Definition: state_vector.h:51
Euler::ParabolicSystem ParabolicSystem
Definition: description.h:37
Euler::HyperbolicSystem HyperbolicSystem
Definition: description.h:32