ryujin 2.1.1 revision 863a4d36dcc743d4e1a9b41cfabd03d0aea57863
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 "offline_data.h"
13#include "parabolic_module.h"
14#include "patterns_conversion.h"
15
16#include <deal.II/base/smartpointer.h>
17
18namespace ryujin
19{
30 none,
31
39 };
40
41
47 enum class TimeSteppingScheme {
75
80 erk_11,
81
93 erk_22,
94
107 erk_33,
108
121 erk_43,
122
127 erk_54,
128
134
140
146
151 imex_11,
152
176 imex_22,
177
205 imex_33,
206 };
207} // namespace ryujin
208
209#ifndef DOXYGEN
210DECLARE_ENUM(ryujin::CFLRecoveryStrategy,
213 "bang bang control"}));
214
215DECLARE_ENUM(
217 LIST({ryujin::TimeSteppingScheme::ssprk_22, "ssprk 22"},
230#endif
231
232namespace ryujin
233{
240 template <typename Description, int dim, typename Number = double>
241 class TimeIntegrator final : public dealii::ParameterAcceptor
242 {
243 public:
248
250
251 using View =
252 typename Description::template HyperbolicSystemView<dim, Number>;
253
255
257
259
263
268 const MPI_Comm &mpi_communicator,
269 const OfflineData<dim, Number> &offline_data,
270 const HyperbolicModule<Description, dim, Number> &hyperbolic_module,
271 const ParabolicModule<Description, dim, Number> &parabolic_module,
272 const std::string &subsection = "/TimeIntegrator");
273
279 void prepare();
280
282
286
300 Number step(StateVector &state_vector,
301 Number t,
302 Number t_final = std::numeric_limits<Number>::max());
303
308
316
317 protected:
325 Number step_ssprk_22(StateVector &state_vector, Number t, Number tau_max);
326
334 Number step_ssprk_33(StateVector &state_vector, Number t, Number tau_max);
335
342 Number step_erk_11(StateVector &state_vector, Number t, Number tau_max);
343
350 Number step_erk_22(StateVector &state_vector, Number t, Number tau_max);
351
358 Number step_erk_33(StateVector &state_vector, Number t, Number tau_max);
359
367 Number step_erk_43(StateVector &state_vector, Number t, Number tau_max);
368
376 Number step_erk_54(StateVector &state_vector, Number t, Number tau_max);
377
386 Number step_strang_ssprk_33_cn(StateVector &state_vector,
387 Number t,
388 Number tau_max);
389
398 Number
399 step_strang_erk_33_cn(StateVector &state_vector, Number t, Number tau_max);
400
409 Number
410 step_strang_erk_43_cn(StateVector &state_vector, Number t, Number tau_max);
411
416 Number step_imex_11(StateVector &state_vector, Number t, Number tau_max);
417
424 Number step_imex_22(StateVector &state_vector, Number t, Number tau_max);
425
432 Number step_imex_33(StateVector &state_vector, Number t, Number tau_max);
433
434 private:
436
440
441 Number cfl_min_;
442 Number cfl_max_;
443
444 CFLRecoveryStrategy cfl_recovery_strategy_;
445
446 TimeSteppingScheme time_stepping_scheme_;
447 double efficiency_;
448
450
452
456
457 const MPI_Comm &mpi_communicator_;
458
459 dealii::SmartPointer<const OfflineData<dim, Number>> offline_data_;
460 dealii::SmartPointer<const HyperbolicModule<Description, dim, Number>>
461 hyperbolic_module_;
462 dealii::SmartPointer<const ParabolicModule<Description, dim, Number>>
463 parabolic_module_;
464
465 std::vector<StateVector> temp_;
466
468 };
469
470} /* namespace ryujin */
TimeIntegrator(const MPI_Comm &mpi_communicator, 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_imex_33(StateVector &state_vector, Number t, Number tau_max)
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