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_EXADG_COMPRESSIBLE_NAVIER_STOKES_TIME_INTEGRATION_TIME_INT_EXPLICIT_RUNGE_KUTTA_H_
23#define INCLUDE_EXADG_COMPRESSIBLE_NAVIER_STOKES_TIME_INTEGRATION_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/ssp_runge_kutta.h>
32#include <exadg/time_integration/time_int_explicit_runge_kutta_base.h>
33
34namespace ExaDG
35{
36namespace CompNS
37{
38// forward declarations
39class Parameters;
40
41template<typename Number>
42class PostProcessorInterface;
43
44namespace Interface
45{
46template<typename Number>
47class Operator;
48}
49
50template<typename Number>
51class TimeIntExplRK : public TimeIntExplRKBase<Number>
52{
53public:
54 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
55
57
58 TimeIntExplRK(std::shared_ptr<Operator> operator_in,
59 Parameters const & param_in,
60 MPI_Comm const & mpi_comm_in,
61 bool const print_wall_times_in,
62 std::shared_ptr<PostProcessorInterface<Number>> postprocessor_in);
63
64 void
65 get_wall_times(std::vector<std::string> & name, std::vector<double> & wall_time) const;
66
67private:
68 void
69 initialize_time_integrator() final;
70
71 void
72 initialize_vectors() final;
73
74 void
75 initialize_solution() final;
76
77 void
78 detect_instabilities() const;
79
80 void
81 postprocessing() const final;
82
83 void
84 do_timestep_solve() final;
85
86 bool
87 print_solver_info() const final;
88
89 void
90 calculate_time_step_size() final;
91
92 double
93 recalculate_time_step_size() const final;
94
95 void
96 calculate_pressure();
97
98 void
99 calculate_velocity();
100
101 void
102 calculate_temperature();
103
104 void
105 calculate_vorticity();
106
107 void
108 calculate_divergence();
109
110 std::shared_ptr<Operator> pde_operator;
111
112 std::shared_ptr<ExplicitTimeIntegrator<Operator, VectorType>> rk_time_integrator;
113
114 Parameters const & param;
115
116 unsigned int const refine_steps_time;
117
118 std::shared_ptr<PostProcessorInterface<Number>> postprocessor;
119
120 // monitor the L2-norm of the solution vector in order to detect instabilities
121 mutable double l2_norm;
122
123 // time step calculation
124 double const cfl_number;
125 double const diffusion_number;
126};
127
128} // namespace CompNS
129} // namespace ExaDG
130
131#endif /* INCLUDE_EXADG_COMPRESSIBLE_NAVIER_STOKES_TIME_INTEGRATION_TIME_INT_EXPLICIT_RUNGE_KUTTA_H_ \
132 */
Definition interface.h:35
Definition parameters.h:36
Definition postprocessor_base.h:40
Definition time_int_explicit_runge_kutta.h:52
Definition time_int_explicit_runge_kutta_base.h:35
Definition driver.cpp:33