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