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