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