ExaDG
Loading...
Searching...
No Matches
driver.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_FLOW_WITH_TRANSPORT_DRIVER_H_
23#define INCLUDE_EXADG_INCOMPRESSIBLE_FLOW_WITH_TRANSPORT_DRIVER_H_
24
25// application
26#include <exadg/incompressible_flow_with_transport/user_interface/application_base.h>
27
28// utilities
29#include <exadg/functions_and_boundary_conditions/verify_boundary_conditions.h>
30#include <exadg/matrix_free/matrix_free_data.h>
31#include <exadg/utilities/print_functions.h>
32#include <exadg/utilities/print_general_infos.h>
33#include <exadg/utilities/timer_tree.h>
34
35// ConvDiff
36#include <exadg/convection_diffusion/time_integration/time_int_bdf.h>
37#include <exadg/convection_diffusion/time_integration/time_int_explicit_runge_kutta.h>
38
39// IncNS
40#include <exadg/convection_diffusion/spatial_discretization/operator.h>
41#include <exadg/grid/mapping_deformation_function.h>
42#include <exadg/incompressible_navier_stokes/spatial_discretization/operator_coupled.h>
43#include <exadg/incompressible_navier_stokes/spatial_discretization/operator_dual_splitting.h>
44#include <exadg/incompressible_navier_stokes/spatial_discretization/operator_pressure_correction.h>
45#include <exadg/incompressible_navier_stokes/time_integration/driver_steady_problems.h>
46#include <exadg/incompressible_navier_stokes/time_integration/time_int_bdf_coupled_solver.h>
47#include <exadg/incompressible_navier_stokes/time_integration/time_int_bdf_dual_splitting.h>
48#include <exadg/incompressible_navier_stokes/time_integration/time_int_bdf_pressure_correction.h>
49
50namespace ExaDG
51{
52namespace FTI
53{
54template<int dim, typename Number = double>
55class Driver
56{
57public:
58 Driver(MPI_Comm const & mpi_comm,
59 std::shared_ptr<ApplicationBase<dim, Number>> application,
60 bool const is_test);
61
62 void
63 setup();
64
65 void
66 solve() const;
67
68 void
69 print_performance_results(double const total_time) const;
70
71private:
72 using VectorType = dealii::LinearAlgebra::distributed::Vector<Number>;
73
74 void
75 ale_update() const;
76
77 void
78 communicate_scalar_to_fluid() const;
79
80 void
81 communicate_fluid_to_all_scalars() const;
82
83 void
84 set_start_time() const;
85
86 void
87 synchronize_time_step_size() const;
88
89 // MPI communicator
90 MPI_Comm const mpi_comm;
91
92 // output to std::cout
93 dealii::ConditionalOStream pcout;
94
95 // do not print wall times if is_test
96 bool const is_test;
97
98 // application
99 std::shared_ptr<ApplicationBase<dim, Number>> application;
100
101 std::shared_ptr<Grid<dim>> grid;
102
103 std::shared_ptr<dealii::Mapping<dim>> mapping;
104
105 std::shared_ptr<MultigridMappings<dim, Number>> multigrid_mappings;
106
107 // grid motion (ALE)
108 std::shared_ptr<DeformedMappingBase<dim, Number>> ale_mapping;
109
110 std::shared_ptr<MultigridMappings<dim, Number>> ale_multigrid_mappings;
111
112 // ALE helper functions required by time integrator
113 std::shared_ptr<HelpersALE<dim, Number>> helpers_ale;
114
115 bool use_adaptive_time_stepping;
116
117 // MatrixFree (only a single object for both flow and transport problems)
118 std::shared_ptr<MatrixFreeData<dim, Number>> matrix_free_data;
119 std::shared_ptr<dealii::MatrixFree<dim, Number>> matrix_free;
120
121 // INCOMPRESSIBLE NAVIER-STOKES
122
123 std::shared_ptr<IncNS::SpatialOperatorBase<dim, Number>> fluid_operator;
124
126
127 std::shared_ptr<Postprocessor> fluid_postprocessor;
128
129 std::shared_ptr<IncNS::TimeIntBDF<dim, Number>> fluid_time_integrator;
130
131 // steady solver
133
134 std::shared_ptr<DriverSteady> fluid_driver_steady;
135
136 // SCALAR TRANSPORT
137
138 std::vector<std::shared_ptr<ConvDiff::Operator<dim, Number>>> scalar_operator;
139
140 std::vector<std::shared_ptr<ConvDiff::PostProcessorBase<dim, Number>>> scalar_postprocessor;
141
142 std::vector<std::shared_ptr<TimeIntBase>> scalar_time_integrator;
143
144 mutable dealii::LinearAlgebra::distributed::Vector<Number> temperature;
145
146 /*
147 * Computation time (wall clock time).
148 */
149 mutable TimerTree timer_tree;
150
151 mutable unsigned int N_time_steps;
152};
153
154} // namespace FTI
155} // namespace ExaDG
156
157
158#endif /* INCLUDE_EXADG_INCOMPRESSIBLE_FLOW_WITH_TRANSPORT_DRIVER_H_ */
Definition application_base.h:310
Definition driver.h:56
Definition driver_steady_problems.h:48
Definition postprocessor_base.h:39
Definition timer_tree.h:36
Definition driver.cpp:33