ExaDG
Loading...
Searching...
No Matches
time_int_gen_alpha.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_STRUCTURE_TIME_INTEGRATION_TIME_INT_GEN_ALPHA_H_
23#define INCLUDE_EXADG_STRUCTURE_TIME_INTEGRATION_TIME_INT_GEN_ALPHA_H_
24
25// deal.II
26#include <deal.II/lac/la_parallel_vector.h>
27
28// ExaDG
29#include <exadg/time_integration/time_int_gen_alpha_base.h>
30#include <exadg/utilities/timer_tree.h>
31
32namespace ExaDG
33{
34namespace Structure
35{
36// forward declarations
37class Parameters;
38
39template<typename Number>
40class PostProcessorBase;
41
42namespace Interface
43{
44template<typename Number>
45class Operator;
46
47class Parameters;
48} // namespace Interface
49
50template<int dim, typename Number>
52{
53private:
54 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
55
56public:
57 TimeIntGenAlpha(std::shared_ptr<Interface::Operator<Number>> operator_,
58 std::shared_ptr<PostProcessorBase<Number>> postprocessor_,
59 Parameters const & param_,
60 MPI_Comm const & mpi_comm_,
61 bool const is_test_);
62
63 void
64 setup(bool const do_restart) final;
65
66 /*
67 * This function needs to be called before the first time step is performed. In case of a restart,
68 * the vector acceleration_n is read from restart files and nothing has to be done here.
69 */
70 void
71 compute_initial_acceleration(bool const do_restart);
72
73 void
74 print_iterations() const;
75
76 void
77 extrapolate_displacement_to_np(VectorType & displacement);
78
79 VectorType const &
80 get_displacement_np();
81
82 void
83 extrapolate_velocity_to_np(VectorType & velocity);
84
85 VectorType const &
86 get_velocity_n();
87
88 VectorType const &
89 get_velocity_np();
90
91 void
92 set_displacement(VectorType const & displacement);
93
99 void
100 advance_one_timestep_partitioned_solve(bool const use_extrapolation);
101
102private:
103 void
104 do_timestep_solve() final;
105
106 void
107 prepare_vectors_for_next_timestep() final;
108
109 void
110 do_write_restart(std::string const & filename) const final;
111
112 void
113 do_read_restart(std::ifstream & in) final;
114
115 void
116 postprocessing() const final;
117
118 bool
119 print_solver_info() const final;
120
121 std::shared_ptr<Interface::Operator<Number>> pde_operator;
122
123 std::shared_ptr<PostProcessorBase<Number>> postprocessor;
124
125 // number of refinement steps, where the time step size is reduced in
126 // factors of 2 with each refinement
127 unsigned int const refine_steps_time;
128
129 Parameters const & param;
130
131 MPI_Comm const mpi_comm;
132
133 dealii::ConditionalOStream pcout;
134
135 // DoF vectors
136 VectorType displacement_n, displacement_np;
137 VectorType velocity_n, velocity_np;
138 VectorType acceleration_n, acceleration_np;
139
140 // required for strongly-coupled partitioned FSI
141 bool use_extrapolation;
142 bool store_solution;
143 VectorType displacement_last_iter;
144
145 std::pair<
146 unsigned int /* number of calls */,
147 std::tuple<unsigned long long, unsigned long long> /* iteration counts {Newton, linear}*/>
148 iterations;
149};
150
151} // namespace Structure
152} // namespace ExaDG
153
154
155#endif /* INCLUDE_EXADG_STRUCTURE_TIME_INTEGRATION_TIME_INT_GEN_ALPHA_H_ */
Definition interface.h:36
Definition parameters.h:40
Definition postprocessor_base.h:36
Definition time_int_gen_alpha.h:52
void advance_one_timestep_partitioned_solve(bool const use_extrapolation)
Definition time_int_gen_alpha.cpp:106
Definition time_int_gen_alpha_base.h:36
Definition driver.cpp:33