ExaDG
Loading...
Searching...
No Matches
time_int_explicit_runge_kutta.h
1/* ______________________________________________________________________
2 *
3 * ExaDG - High-Order Discontinuous Galerkin for the Exa-Scale
4 *
5 * Copyright (C) 2021 by the ExaDG authors
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 * ______________________________________________________________________
20 */
21
22#ifndef INCLUDE_CONVECTION_DIFFUSION_TIME_INT_EXPLICIT_RUNGE_KUTTA_H_
23#define INCLUDE_CONVECTION_DIFFUSION_TIME_INT_EXPLICIT_RUNGE_KUTTA_H_
24
25// deal.II
26#include <deal.II/base/timer.h>
27#include <deal.II/lac/la_parallel_vector.h>
28
29// ExaDG
30#include <exadg/time_integration/explicit_runge_kutta.h>
31#include <exadg/time_integration/time_int_explicit_runge_kutta_base.h>
32
33namespace ExaDG
34{
35namespace ConvDiff
36{
37// forward declarations
38class Parameters;
39
40template<typename Number>
41class PostProcessorInterface;
42
43namespace Interface
44{
45template<typename Number>
46class Operator;
47}
48
49template<typename Number>
50class OperatorExplRK;
51
52template<typename Number>
53class TimeIntExplRK : public TimeIntExplRKBase<Number>
54{
55public:
56 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
57
58 TimeIntExplRK(std::shared_ptr<Interface::Operator<Number>> operator_in,
59 std::shared_ptr<PostProcessorInterface<Number>> postprocessor_in,
60 Parameters const & param_in,
61 MPI_Comm const & mpi_comm_in,
62 bool const is_test_in);
63
64 void
65 set_velocities_and_times(std::vector<VectorType const *> const & velocities_in,
66 std::vector<double> const & times_in);
67
68 void
69 extrapolate_solution(VectorType & vector);
70
71private:
72 void
73 initialize_vectors() final;
74
75 void
76 initialize_solution() final;
77
78 void
79 postprocessing() const final;
80
81 bool
82 print_solver_info() const final;
83
84 void
85 do_timestep_solve() final;
86
87 void
88 calculate_time_step_size() final;
89
90 double
91 recalculate_time_step_size() const final;
92
93 void
94 initialize_time_integrator() final;
95
96 std::shared_ptr<Interface::Operator<Number>> pde_operator;
97
98 std::shared_ptr<OperatorExplRK<Number>> expl_rk_operator;
99
100 std::shared_ptr<ExplicitTimeIntegrator<OperatorExplRK<Number>, VectorType>> rk_time_integrator;
101
102 Parameters const & param;
103
104 unsigned int const refine_steps_time;
105
106 std::vector<VectorType const *> velocities;
107 std::vector<double> times;
108
109 // store time step size according to diffusion condition so that it does not have to be
110 // recomputed in case of adaptive time stepping
111 double time_step_diff;
112
113 double const cfl;
114 double const diffusion_number;
115
116 std::shared_ptr<PostProcessorInterface<Number>> postprocessor;
117};
118
119} // namespace ConvDiff
120} // namespace ExaDG
121
122#endif /* INCLUDE_CONVECTION_DIFFUSION_TIME_INT_EXPLICIT_RUNGE_KUTTA_H_ */
Definition interface.h:39
Definition parameters.h:46
Definition postprocessor_base.h:44
Definition time_int_explicit_runge_kutta.h:54
Definition time_int_explicit_runge_kutta_base.h:35
Definition driver.cpp:33