ExaDG
Loading...
Searching...
No Matches
driver_steady_problems.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_INCOMPRESSIBLE_NAVIER_STOKES_TIME_INTEGRATION_DRIVER_STEADY_PROBLEMS_H_
23#define INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_TIME_INTEGRATION_DRIVER_STEADY_PROBLEMS_H_
24
25// deal.II
26#include <deal.II/base/timer.h>
27#include <deal.II/lac/la_parallel_block_vector.h>
28#include <deal.II/lac/la_parallel_vector.h>
29
30// ExaDG
31#include <exadg/utilities/timer_tree.h>
32
33namespace ExaDG
34{
35namespace IncNS
36{
37// forward declarations
38class Parameters;
39
40template<int dim, typename Number>
41class OperatorCoupled;
42
43template<typename Number>
44class PostProcessorInterface;
45
46template<int dim, typename Number>
48{
49public:
50 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
51 typedef dealii::LinearAlgebra::distributed::BlockVector<Number> BlockVectorType;
52
53 DriverSteadyProblems(std::shared_ptr<OperatorCoupled<dim, Number>> operator_,
54 std::shared_ptr<PostProcessorInterface<Number>> postprocessor_,
55 Parameters const & param_,
56 MPI_Comm const & mpi_comm_,
57 bool const is_test_);
58
59 void
60 setup();
61
62 void
63 solve(double const time = 0.0, bool unsteady_problem = false);
64
65 VectorType const &
66 get_velocity() const;
67
68 std::shared_ptr<TimerTree>
69 get_timings() const;
70
71 void
72 print_iterations() const;
73
74private:
75 void
76 initialize_vectors();
77
78 void
79 initialize_solution();
80
81 void
82 do_solve(double const time = 0.0, bool unsteady_problem = false);
83
84 bool
85 print_solver_info(double const time, bool unsteady_problem = false) const;
86
87 void
88 postprocessing(double const time = 0.0, bool unsteady_problem = false) const;
89
90 std::shared_ptr<OperatorCoupled<dim, Number>> pde_operator;
91
92 Parameters const & param;
93
94 MPI_Comm const mpi_comm;
95
96 bool is_test;
97
98 dealii::Timer global_timer;
99 std::shared_ptr<TimerTree> timer_tree;
100
101 dealii::ConditionalOStream pcout;
102
103 BlockVectorType solution;
104 BlockVectorType rhs_vector;
105
106 std::shared_ptr<PostProcessorInterface<Number>> postprocessor;
107
108 // iteration counts
109 std::pair<
110 unsigned int /* calls */,
111 std::tuple<unsigned long long, unsigned long long> /* iteration counts {Newton, linear} */>
112 iterations;
113};
114
115} // namespace IncNS
116} // namespace ExaDG
117
118#endif /* INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_TIME_INTEGRATION_DRIVER_STEADY_PROBLEMS_H_ */
Definition driver_steady_problems.h:48
Definition operator_coupled.h:189
Definition parameters.h:46
Definition postprocessor_interface.h:34
Definition driver.cpp:33