ExaDG
Loading...
Searching...
No Matches
time_int_bdf.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_BDF_H_
23#define INCLUDE_CONVECTION_DIFFUSION_TIME_INT_BDF_H_
24
25// deal.II
26#include <deal.II/lac/la_parallel_vector.h>
27
28// ExaDG
29#include <exadg/time_integration/lambda_functions_ale.h>
30#include <exadg/time_integration/time_int_bdf_base.h>
31
32namespace ExaDG
33{
34namespace ConvDiff
35{
36class Parameters;
37
38template<int dim, typename Number>
39class Operator;
40
41template<typename Number>
42class PostProcessorInterface;
43} // namespace ConvDiff
44
45
46namespace ConvDiff
47{
48template<int dim, typename Number>
50{
51public:
52 using VectorType = dealii::LinearAlgebra::distributed::Vector<Number>;
53
54 TimeIntBDF(std::shared_ptr<Operator<dim, Number>> operator_in,
55 std::shared_ptr<HelpersALE<dim, Number> const> helpers_ale_in,
56 std::shared_ptr<PostProcessorInterface<Number>> postprocessor_in,
57 Parameters const & param_in,
58 MPI_Comm const & mpi_comm_in,
59 bool const is_test_in);
60
61 void
62 set_velocities_and_times(std::vector<VectorType const *> const & velocities_in,
63 std::vector<double> const & times_in);
64
65 void
66 extrapolate_solution(VectorType & vector);
67
68 VectorType const &
69 get_solution_np() const;
70
71 void
72 ale_update();
73
74 void
75 print_iterations() const;
76
77 void
78 prepare_coarsening_and_refinement() final;
79
80 void
81 interpolate_after_coarsening_and_refinement() final;
82
83private:
84 void
85 allocate_vectors() final;
86
87 std::shared_ptr<std::vector<VectorType *>>
88 get_vectors();
89
90 void
91 initialize_current_solution() final;
92
93 void
94 initialize_former_multistep_dof_vectors() final;
95
96 void
97 initialize_vec_convective_term();
98
99 double
100 calculate_time_step_size() final;
101
102 double
103 recalculate_time_step_size() const final;
104
105 void
106 prepare_vectors_for_next_timestep() final;
107
108 void
109 do_timestep_solve() final;
110
111 void
112 setup_derived() final;
113
114 bool
115 print_solver_info() const final;
116
117 void
118 read_restart_vectors(boost::archive::binary_iarchive & ia) final;
119
120 void
121 write_restart_vectors(boost::archive::binary_oarchive & oa) const final;
122
123 void
124 postprocessing() const final;
125
126 std::shared_ptr<Operator<dim, Number>> pde_operator;
127
128 Parameters const & param;
129
130 unsigned int const refine_steps_time;
131
132 double const cfl;
133
134 // solution vectors
135 VectorType solution_np;
136 std::vector<VectorType> solution;
137 std::vector<VectorType> vec_convective_term;
138 VectorType convective_term_np;
139
140 VectorType rhs_vector;
141
142 // numerical velocity field
143 std::vector<VectorType const *> velocities;
144 std::vector<double> times;
145
146 // iteration counts
147 std::pair<unsigned int /* calls */, unsigned long long /* iteration counts */> iterations;
148
149 // postprocessor
150 std::shared_ptr<PostProcessorInterface<Number>> postprocessor;
151
152 // This object allows to access utility functions needed for ALE
153 std::shared_ptr<HelpersALE<dim, Number> const> helpers_ale;
154
155 // ALE
156 VectorType grid_velocity;
157 std::vector<VectorType> vec_grid_coordinates;
158 VectorType grid_coordinates_np;
159};
160
161} // namespace ConvDiff
162} // namespace ExaDG
163
164#endif /* INCLUDE_CONVECTION_DIFFUSION_TIME_INT_BDF_H_ */
Definition operator.h:49
Definition parameters.h:46
Definition postprocessor_base.h:44
Definition time_int_bdf.h:50
Definition lambda_functions_ale.h:40
Definition time_int_bdf_base.h:34
Definition driver.cpp:33