ExaDG
Loading...
Searching...
No Matches
output_generator.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_POSTPROCESSOR_OUTPUT_GENERATOR_H_
23#define EXADG_STRUCTURE_POSTPROCESSOR_OUTPUT_GENERATOR_H_
24
25// deal.II
26#include <deal.II/lac/la_parallel_vector.h>
27
28// ExaDG
29#include <exadg/postprocessor/output_data_base.h>
30#include <exadg/postprocessor/solution_field.h>
31#include <exadg/postprocessor/time_control.h>
32
33namespace ExaDG
34{
35namespace Structure
36{
37struct OutputData : public OutputDataBase
38{
39 OutputData()
40 : write_displacement_magnitude(false),
41 write_displacement_jacobian(false),
42 write_max_principal_stress(false)
43 {
44 }
45
46 void
47 print(dealii::ConditionalOStream & pcout, bool unsteady)
48 {
49 OutputDataBase::print(pcout, unsteady);
50
51 print_parameter(pcout, "Write displacement magnitude", write_displacement_magnitude);
52 print_parameter(pcout, "Write displacement Jacobian", write_displacement_jacobian);
53 print_parameter(pcout, "Write maximum principal stress", write_max_principal_stress);
54 }
55
56 // write displacement magnitude
57 bool write_displacement_magnitude;
58
59 // write Jacobian of the displacement field
60 bool write_displacement_jacobian;
61
62 // write maximum principal stress
63 bool write_max_principal_stress;
64};
65
66template<int dim, typename Number>
67class OutputGenerator
68{
69public:
70 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
71
72 OutputGenerator(MPI_Comm const & comm);
73
74 void
75 setup(dealii::DoFHandler<dim> const & dof_handler,
76 dealii::Mapping<dim> const & mapping,
77 OutputData const & output_data);
78
79 void
80 evaluate(
81 VectorType const & solution,
82 std::vector<dealii::ObserverPointer<SolutionField<dim, Number>>> const & additional_fields,
83 double const time,
84 bool const unsteady);
85
86 TimeControl time_control;
87
88private:
89 MPI_Comm const mpi_comm;
90
91 OutputData output_data;
92
93 dealii::ObserverPointer<dealii::DoFHandler<dim> const> dof_handler;
94 dealii::ObserverPointer<dealii::Mapping<dim> const> mapping;
95};
96
97} // namespace Structure
98} // namespace ExaDG
99
100#endif /* EXADG_STRUCTURE_POSTPROCESSOR_OUTPUT_GENERATOR_H_ */
Definition solution_field.h:40
Definition time_control.h:64
Definition driver.cpp:33
Definition output_generator.h:38