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_COMPRESSIBLE_NAVIER_STOKES_DRIVER_H_
23#define INCLUDE_EXADG_COMPRESSIBLE_NAVIER_STOKES_DRIVER_H_
24
25#include <exadg/compressible_navier_stokes/spatial_discretization/operator.h>
26#include <exadg/compressible_navier_stokes/time_integration/time_int_explicit_runge_kutta.h>
27#include <exadg/compressible_navier_stokes/user_interface/analytical_solution.h>
28#include <exadg/compressible_navier_stokes/user_interface/application_base.h>
29#include <exadg/compressible_navier_stokes/user_interface/boundary_descriptor.h>
30#include <exadg/compressible_navier_stokes/user_interface/field_functions.h>
31#include <exadg/compressible_navier_stokes/user_interface/parameters.h>
32#include <exadg/functions_and_boundary_conditions/verify_boundary_conditions.h>
33#include <exadg/grid/mapping_dof_vector.h>
34#include <exadg/matrix_free/matrix_free_data.h>
35#include <exadg/utilities/print_general_infos.h>
36
37namespace ExaDG
38{
39namespace CompNS
40{
41// Select the operator to be applied
42enum class OperatorType
43{
44 ConvectiveTerm,
45 ViscousTerm,
46 ViscousAndConvectiveTerms,
47 InverseMassOperator,
48 InverseMassOperatorDstDst,
49 VectorUpdate,
50 EvaluateOperatorExplicit
51};
52
53template<int dim, typename Number = double>
54class Driver
55{
56public:
57 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
58
59 Driver(MPI_Comm const & comm,
60 std::shared_ptr<ApplicationBase<dim, Number>> application,
61 bool const is_test,
62 bool const is_throughput_study);
63
64 void
65 setup();
66
67 void
68 solve();
69
70 void
71 print_performance_results(double const total_time) const;
72
73 /*
74 * Throughput study
75 */
76 std::tuple<unsigned int, dealii::types::global_dof_index, double>
77 apply_operator(OperatorType const & operator_type,
78 unsigned int const n_repetitions_inner,
79 unsigned int const n_repetitions_outer) const;
80
81private:
82 MPI_Comm const mpi_comm;
83
84 dealii::ConditionalOStream pcout;
85
86 // do not print wall times if is_test
87 bool const is_test;
88
89 // do not set up certain data structures (solver, postprocessor) in case of throughput study
90 bool const is_throughput_study;
91
92 std::shared_ptr<ApplicationBase<dim, Number>> application;
93
94 // Grid and mapping
95 std::shared_ptr<Grid<dim>> grid;
96
97 std::shared_ptr<dealii::Mapping<dim>> mapping;
98
99 std::shared_ptr<Operator<dim, Number>> pde_operator;
100
101 std::shared_ptr<PostProcessorBase<dim, Number>> postprocessor;
102
103 std::shared_ptr<TimeIntExplRK<Number>> time_integrator;
104
105 // Computation time (wall clock time)
106 mutable TimerTree timer_tree;
107};
108
109} // namespace CompNS
110} // namespace ExaDG
111
112#endif /* INCLUDE_EXADG_COMPRESSIBLE_NAVIER_STOKES_DRIVER_H_ */
Definition application_base.h:48
Definition driver.h:55
Definition timer_tree.h:36
Definition driver.cpp:33