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_FLUID_STRUCTURE_INTERACTION_DRIVER_H_
23#define INCLUDE_EXADG_FLUID_STRUCTURE_INTERACTION_DRIVER_H_
24
25// application
26#include <exadg/fluid_structure_interaction/user_interface/application_base.h>
27
28// FSI
29#include <exadg/fluid_structure_interaction/acceleration_schemes/parameters.h>
30#include <exadg/fluid_structure_interaction/acceleration_schemes/partitioned_solver.h>
31#include <exadg/fluid_structure_interaction/single_field_solvers/fluid.h>
32#include <exadg/fluid_structure_interaction/single_field_solvers/structure.h>
33
34// utilities
35#include <exadg/functions_and_boundary_conditions/interface_coupling.h>
36#include <exadg/utilities/timer_tree.h>
37
38namespace ExaDG
39{
40namespace FSI
41{
42template<int dim, typename Number>
43class Driver
44{
45private:
46 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
47
48public:
49 Driver(std::string const & input_file,
50 MPI_Comm const & comm,
51 std::shared_ptr<ApplicationBase<dim, Number>> application,
52 bool const is_test);
53
54 void
55 setup();
56
57 void
58 solve() const;
59
60 void
61 print_performance_results(double const total_time) const;
62
63private:
64 void
65 setup_interface_coupling();
66
67 void
68 set_start_time() const;
69
70 void
71 synchronize_time_step_size() const;
72
73 void
74 coupling_structure_to_ale(VectorType const & displacement_structure) const;
75
76 void
77 coupling_structure_to_fluid(bool const extrapolate) const;
78
79 void
80 coupling_fluid_to_structure(bool const end_of_time_step) const;
81
82 void
83 apply_dirichlet_neumann_scheme(VectorType & d_tilde,
84 VectorType const & d,
85 unsigned int iteration) const;
86
87 // MPI communicator
88 MPI_Comm const mpi_comm;
89
90 // output to std::cout
91 dealii::ConditionalOStream pcout;
92
93 // do not print wall times if is_test
94 bool const is_test;
95
96 // application
97 std::shared_ptr<ApplicationBase<dim, Number>> application;
98
99 std::shared_ptr<SolverStructure<dim, Number>> structure;
100
101 std::shared_ptr<SolverFluid<dim, Number>> fluid;
102
103 // interface coupling
104 std::shared_ptr<InterfaceCoupling<1, dim, Number>> structure_to_fluid;
105 std::shared_ptr<InterfaceCoupling<1, dim, Number>> structure_to_ale;
106 std::shared_ptr<InterfaceCoupling<1, dim, Number>> fluid_to_structure;
107
108 // Parameters for partitioned FSI schemes
109 Parameters parameters;
110
111 // Computation time
112 mutable TimerTree timer_tree;
113
114 // Partitioned FSI solver
115 std::shared_ptr<PartitionedSolver<dim, Number>> partitioned_solver;
116};
117
118} // namespace FSI
119} // namespace ExaDG
120
121
122#endif /* INCLUDE_EXADG_FLUID_STRUCTURE_INTERACTION_DRIVER_H_ */
Definition application_base.h:472
Definition driver.h:44
Definition timer_tree.h:36
Definition driver.cpp:33
Definition parameters.h:38