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>
41
42namespace Interface
43{
44template<typename Number>
45class Operator;
46
47class Parameters;
48} // namespace Interface
49
50template<int dim, typename Number>
51class TimeIntGenAlpha : public TimeIntGenAlphaBase<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 VectorType const &
83 get_displacement_n();
84
85 void
86 extrapolate_velocity_to_np(VectorType & velocity);
87
88 VectorType const &
89 get_velocity_n();
90
91 VectorType const &
92 get_velocity_np();
93
94 void
95 set_displacement(VectorType const & displacement);
96
102 void
103 advance_one_timestep_partitioned_solve(bool const use_extrapolation);
104
105private:
106 void
107 do_timestep_solve() final;
108
109 void
110 prepare_vectors_for_next_timestep() final;
111
112 void
113 do_write_restart(std::string const & filename) const final;
114
115 void
116 do_read_restart(std::ifstream & in) final;
117
118 void
119 postprocessing() const final;
120
121 bool
122 print_solver_info() const final;
123
124 std::shared_ptr<Interface::Operator<Number>> pde_operator;
125
126 std::shared_ptr<PostProcessorBase<Number>> postprocessor;
127
128 // number of refinement steps, where the time step size is reduced in
129 // factors of 2 with each refinement
130 unsigned int const refine_steps_time;
131
132 Parameters const & param;
133
134 MPI_Comm const mpi_comm;
135
136 dealii::ConditionalOStream pcout;
137
138 // DoF vectors
139 VectorType displacement_n, displacement_np;
140 VectorType velocity_n, velocity_np;
141 VectorType acceleration_n, acceleration_np;
142
143 // required for strongly-coupled partitioned FSI
144 bool use_extrapolation;
145 bool store_solution;
146 VectorType displacement_last_iter;
147
148 std::pair<
149 unsigned int /* number of calls */,
150 std::tuple<unsigned long long, unsigned long long> /* iteration counts {Newton, linear}*/>
151 iterations;
152};
153
154} // namespace Structure
155} // namespace ExaDG
156
157
158#endif /* INCLUDE_EXADG_STRUCTURE_TIME_INTEGRATION_TIME_INT_GEN_ALPHA_H_ */
Definition interface.h:36
Definition parameters.h:41
Definition postprocessor_base.h:36
void advance_one_timestep_partitioned_solve(bool const use_extrapolation)
Definition time_int_gen_alpha.cpp:106
Definition driver.cpp:33