ExaDG
Toggle main menu visibility
Loading...
Searching...
No Matches
include
exadg
fluid_structure_interaction
precice
driver.h
1
/* ______________________________________________________________________
2
*
3
* ExaDG - High-Order Discontinuous Galerkin for the Exa-Scale
4
*
5
* Copyright (C) 2022 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_PRECICE_DRIVER_H_
23
#define EXADG_FLUID_STRUCTURE_INTERACTION_PRECICE_DRIVER_H_
24
25
// deal.II
26
#include <deal.II/lac/la_parallel_vector.h>
27
28
// ExaDG
29
#include <exadg/fluid_structure_interaction/precice/precice_adapter.h>
30
#include <exadg/fluid_structure_interaction/precice/precice_parameters.h>
31
#include <exadg/fluid_structure_interaction/single_field_solvers/fluid.h>
32
#include <exadg/fluid_structure_interaction/single_field_solvers/structure.h>
33
#include <exadg/fluid_structure_interaction/user_interface/application_base.h>
34
#include <exadg/utilities/print_general_infos.h>
35
36
namespace
ExaDG
37
{
38
namespace
FSI
39
{
40
namespace
preCICE
41
{
42
template
<
int
dim,
typename
Number>
43
class
Driver
44
{
45
private
:
46
using
VectorType = dealii::LinearAlgebra::distributed::Vector<Number>;
47
48
public
:
49
Driver(std::string
const
& input_file,
50
MPI_Comm
const
& comm,
51
std::shared_ptr<
ApplicationBase<dim, Number>
> app,
52
bool
const
is_test)
53
: mpi_comm(comm),
54
pcout(std::cout, dealii::Utilities::MPI::this_mpi_process(comm) == 0),
55
application(app),
56
precice_parameters(
ExaDG::preCICE::ConfigurationParameters
(input_file)),
57
is_test(is_test)
58
{
59
print_general_info<Number>(pcout, mpi_comm, is_test);
60
}
61
62
virtual
void
63
setup() = 0;
64
65
virtual
void
66
solve()
const
= 0;
67
68
virtual
void
69
print_performance_results(
double
const
total_time)
const
= 0;
70
71
virtual
~Driver() =
default
;
72
73
protected
:
74
// MPI communicator
75
MPI_Comm
const
mpi_comm;
76
77
// output to std::cout
78
dealii::ConditionalOStream pcout;
79
80
// application
81
std::shared_ptr<ApplicationBase<dim, Number>> application;
82
std::shared_ptr<ExaDG::preCICE::Adapter<dim, dim, VectorType>> precice;
83
ExaDG::preCICE::ConfigurationParameters
precice_parameters;
84
85
// do not print wall times if is_test
86
bool
const
is_test;
87
88
/*
89
* Computation time (wall clock time).
90
*/
91
mutable
TimerTree
timer_tree;
92
};
93
94
}
// namespace preCICE
95
}
// namespace FSI
96
}
// namespace ExaDG
97
98
#endif
/* EXADG_FLUID_STRUCTURE_INTERACTION_PRECICE_DRIVER_H_ */
ExaDG::FSI::ApplicationBase
Definition
application_base.h:466
ExaDG::TimerTree
Definition
timer_tree.h:36
ExaDG
Definition
driver.cpp:33
ExaDG::preCICE::ConfigurationParameters
Definition
precice_parameters.h:42
Generated by
1.17.0