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
51 const TimeIntegratorData<number> &time_integrator_data);
52
57 unsigned int
58 required_solution_history_size() const override;
59
60
70 void
71 configure_rhs(const RhsFunctionType &compute_rhs_in);
72
80 void
81 reinit(const VectorType &vector_template) override;
82
87 void
88 reinit(const SolutionHistory<VectorType> &solution_history) override;
89
106 void
107 perform_time_step(const number current_time,
108 const number time_step,
109 SolutionHistory<VectorType> &solution_history,
110 const std::function<void(number, number, VectorType &, const VectorType &)>
111 &stage_pre_processing,
112 const std::function<void(number, number, VectorType &, const VectorType &)>
113 &stage_post_processing) override;
114
115 private:
117 std::vector<number> bi;
118
120 std::vector<number> ai;
121
123 std::vector<number> ci;
124
126 unsigned int n_stages;
127
129 dealii::LinearAlgebra::distributed::Vector<number> rk_register_ri;
130
132 dealii::LinearAlgebra::distributed::Vector<number> rk_register_ki;
133
159 };
160} // 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:120
dealii::LinearAlgebra::distributed::Vector< number > rk_register_ki
Intermediate storage for the Runge-Kutta stage solutions.
Definition explicit_low_storage_runge_kutta_integrator.hpp:132
unsigned int n_stages
Number of stages of the Runge-Kutta scheme.
Definition explicit_low_storage_runge_kutta_integrator.hpp:126
std::vector< number > ci
Runge-Kutta stage time coefficients.
Definition explicit_low_storage_runge_kutta_integrator.hpp:123
void configure_rhs(const RhsFunctionType &compute_rhs_in)
Configure the function used to compute the right-hand side of the ODE.
Definition explicit_low_storage_runge_kutta_integrator.cpp:112
unsigned int required_solution_history_size() const override
Definition explicit_low_storage_runge_kutta_integrator.cpp:105
void reinit(const VectorType &vector_template) override
Definition explicit_low_storage_runge_kutta_integrator.cpp:121
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:139
dealii::LinearAlgebra::distributed::Vector< number > rk_register_ri
Intermediate storage for the Runge-Kutta stage derivatives.
Definition explicit_low_storage_runge_kutta_integrator.hpp:129
std::vector< number > bi
Runge-Kutta final update weights.
Definition explicit_low_storage_runge_kutta_integrator.hpp:117
RhsFunctionType compute_rhs
Definition explicit_low_storage_runge_kutta_integrator.hpp:158
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:18
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