ExaDG
Loading...
Searching...
No Matches
driver_quasi_static_problems.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_DRIVER_QUASI_STATIC_PROBLEMS_H_
23#define INCLUDE_EXADG_STRUCTURE_TIME_INTEGRATION_DRIVER_QUASI_STATIC_PROBLEMS_H_
24
25// deal.II
26#include <deal.II/base/timer.h>
27#include <deal.II/lac/la_parallel_vector.h>
28
29// ExaDG
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}
47
48template<int dim, typename Number>
50{
51private:
52 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
53
54public:
55 DriverQuasiStatic(std::shared_ptr<Interface::Operator<Number>> operator_,
56 std::shared_ptr<PostProcessorBase<Number>> postprocessor_,
57 Parameters const & param_,
58 MPI_Comm const & mpi_comm_,
59 bool const is_test_);
60
61 void
62 setup();
63
64 void
65 solve();
66
67 void
68 print_iterations() const;
69
70 std::shared_ptr<TimerTree>
71 get_timings() const;
72
73private:
74 void
75 initialize_vectors();
76
77 void
78 initialize_solution();
79
80 void
81 do_solve();
82
83 void
84 output_solver_info_header(double const load_factor);
85
86 std::tuple<unsigned int, unsigned int>
87 solve_step(double const load_factor, bool const update_preconditioner);
88
89 void
90 postprocessing() const;
91
92 std::shared_ptr<Interface::Operator<Number>> pde_operator;
93
94 std::shared_ptr<PostProcessorBase<Number>> postprocessor;
95
96 Parameters const & param;
97
98 MPI_Comm const mpi_comm;
99
100 bool const is_test;
101
102 dealii::ConditionalOStream pcout;
103
104 // vectors
105 VectorType solution;
106 VectorType rhs_vector;
107
108 // We need to store a vector in order to extrapolate the solution to the next
109 // load step and obtain an accurate initial guess for the Newton solver.
110 VectorType displacement_increment;
111
112 // For the purpose of extrapolating the displacements, we also need to store the
113 // load_increment of the last load step.
114 double last_load_increment;
115
116 unsigned int step_number;
117
118 std::shared_ptr<TimerTree> timer_tree;
119
120 std::pair<
121 unsigned int /* calls */,
122 std::tuple<unsigned long long, unsigned long long> /* iteration counts {Newton, linear}*/>
123 iterations;
124};
125
126} // namespace Structure
127} // namespace ExaDG
128
129#endif
Definition driver_quasi_static_problems.h:50
Definition interface.h:36
Definition parameters.h:40
Definition postprocessor_base.h:36
Definition driver.cpp:33