include/meltpooldg/time_integration/explicit_low_storage_runge_kutta_integrator.hpp Source File

Developer Documentation: include/meltpooldg/time_integration/explicit_low_storage_runge_kutta_integrator.hpp Source File
Developer Documentation
explicit_low_storage_runge_kutta_integrator.hpp
Go to the documentation of this file.
1
9#pragma once
10
11#include <deal.II/lac/la_parallel_vector.h>
12
16
17#include <functional>
18#include <vector>
19
21{
23 inline static constexpr std::array<TimeIntegratorSchemes, 5> explicit_lsrk_supported_schemes{{
24 TimeIntegratorSchemes::LSRK_stage_1_order_1,
25 TimeIntegratorSchemes::LSRK_stage_3_order_3,
26 TimeIntegratorSchemes::LSRK_stage_5_order_4,
27 TimeIntegratorSchemes::LSRK_stage_7_order_4,
28 TimeIntegratorSchemes::LSRK_stage_9_order_5,
29 }};
30
31 template <typename number>
33 {
34 public:
35 using VectorType = dealii::LinearAlgebra::distributed::Vector<number>;
36
37 using RhsFunctionType = std::function<void(number,
38 number,
39 VectorType &,
40 const VectorType &,
41 std::function<void(unsigned, unsigned)>)>;
42
43
44
53 const TimeIntegratorData<number> &time_integrator_data,
55
60 unsigned int
61 required_solution_history_size() const override;
62
70 void
71 reinit(const VectorType &vector_template) override;
72
77 void
78 reinit(const SolutionHistory<VectorType> &solution_history) override;
79
96 void
97 perform_time_step(const number current_time,
98 const number time_step,
99 SolutionHistory<VectorType> &solution_history,
100 const std::function<void(number, number, VectorType &, const VectorType &)>
101 &stage_pre_processing,
102 const std::function<void(number, number, VectorType &, const VectorType &)>
103 &stage_post_processing) override;
104
105 private:
107 std::vector<number> bi;
108
110 std::vector<number> ai;
111
113 std::vector<number> ci;
114
116 unsigned int n_stages;
117
119 dealii::LinearAlgebra::distributed::Vector<number> rk_register_ri;
120
122 dealii::LinearAlgebra::distributed::Vector<number> rk_register_ki;
123
149 };
150} // namespace MeltPoolDG::TimeIntegration
Definition explicit_low_storage_runge_kutta_integrator.hpp:33
std::vector< number > ai
Runge-Kutta stage weight coefficients.
Definition explicit_low_storage_runge_kutta_integrator.hpp:110
dealii::LinearAlgebra::distributed::Vector< number > rk_register_ki
Intermediate storage for the Runge-Kutta stage solutions.
Definition explicit_low_storage_runge_kutta_integrator.hpp:122
unsigned int n_stages
Number of stages of the Runge-Kutta scheme.
Definition explicit_low_storage_runge_kutta_integrator.hpp:116
std::vector< number > ci
Runge-Kutta stage time coefficients.
Definition explicit_low_storage_runge_kutta_integrator.hpp:113
unsigned int required_solution_history_size() const override
Definition explicit_low_storage_runge_kutta_integrator.cpp:107
void reinit(const VectorType &vector_template) override
Definition explicit_low_storage_runge_kutta_integrator.cpp:115
void perform_time_step(const number current_time, const number time_step, SolutionHistory< VectorType > &solution_history, const std::function< void(number, number, VectorType &, const VectorType &)> &stage_pre_processing, const std::function< void(number, number, VectorType &, const VectorType &)> &stage_post_processing) override
Definition explicit_low_storage_runge_kutta_integrator.cpp:133
dealii::LinearAlgebra::distributed::Vector< number > rk_register_ri
Intermediate storage for the Runge-Kutta stage derivatives.
Definition explicit_low_storage_runge_kutta_integrator.hpp:119
std::vector< number > bi
Runge-Kutta final update weights.
Definition explicit_low_storage_runge_kutta_integrator.hpp:107
RhsFunctionType compute_rhs
Definition explicit_low_storage_runge_kutta_integrator.hpp:148
std::function< void(number, number, VectorType &, const VectorType &, std::function< void(unsigned, unsigned)>)> RhsFunctionType
Definition explicit_low_storage_runge_kutta_integrator.hpp:41
dealii::LinearAlgebra::distributed::Vector< number > VectorType
Definition explicit_low_storage_runge_kutta_integrator.hpp:35
Definition solution_history.hpp:21
Definition time_integrator_base.hpp:17
const TimeIntegratorData< number > time_integrator_data
Definition time_integrator_base.hpp:105
Class providing different low storage explicit Runge-Kutta schemes. The schemes implemented in this c...
Definition bdf_time_integration.hpp:19
static constexpr std::array< TimeIntegratorSchemes, 5 > explicit_lsrk_supported_schemes
The time integrator schemes supported by the low storage explicit Runge-Kutta time integrator.
Definition explicit_low_storage_runge_kutta_integrator.hpp:23