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 INCLUDE_EXADG_COMPRESSIBLE_NAVIER_STOKES_POSTPROCESSOR_OUTPUT_GENERATOR_H_
23#define INCLUDE_EXADG_COMPRESSIBLE_NAVIER_STOKES_POSTPROCESSOR_OUTPUT_GENERATOR_H_
24
25// C/C++
26#include <fstream>
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 CompNS
36{
38{
40 : write_velocity(false),
41 write_pressure(false),
42 write_temperature(false),
43 write_vorticity(false),
44 write_divergence(false),
45 write_shear_rate(false),
46 write_processor_id(false)
47 {
48 }
49
50 void
51 print(dealii::ConditionalOStream & pcout, bool unsteady)
52 {
53 OutputDataBase::print(pcout, unsteady);
54
55 print_parameter(pcout, "Write velocity", write_velocity);
56 print_parameter(pcout, "Write pressure", write_pressure);
57 print_parameter(pcout, "Write temperature", write_temperature);
58 print_parameter(pcout, "Write vorticity", write_vorticity);
59 print_parameter(pcout, "Write divergence", write_divergence);
60 print_parameter(pcout, "Write shear rate", write_shear_rate);
61 print_parameter(pcout, "Write processor ID", write_processor_id);
62 }
63
64 // write velocity
65 bool write_velocity;
66
67 // write pressure
68 bool write_pressure;
69
70 // write temperature
71 bool write_temperature;
72
73 // write vorticity of velocity field
74 bool write_vorticity;
75
76 // write divergence of velocity field
77 bool write_divergence;
78
79 // write shear rate of velocity field
80 bool write_shear_rate;
81
82 // write processor ID to scalar field in order to visualize the
83 // distribution of cells to processors
84 bool write_processor_id;
85};
86
87template<int dim, typename Number>
89{
90public:
91 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
92
93 OutputGenerator(MPI_Comm const & comm);
94
95 void
96 setup(dealii::DoFHandler<dim> const & dof_handler_in,
97 dealii::Mapping<dim> const & mapping_in,
98 OutputData const & output_data_in);
99
100 void
101 evaluate(VectorType const & solution_conserved,
102 std::vector<dealii::SmartPointer<SolutionField<dim, Number>>> const & additional_fields,
103 double const time,
104 bool const unsteady);
105
106 TimeControl time_control;
107
108private:
109 MPI_Comm const mpi_comm;
110
111 dealii::SmartPointer<dealii::DoFHandler<dim> const> dof_handler;
112 dealii::SmartPointer<dealii::Mapping<dim> const> mapping;
113 OutputData output_data;
114};
115
116} // namespace CompNS
117} // namespace ExaDG
118
119
120#endif /* INCLUDE_EXADG_COMPRESSIBLE_NAVIER_STOKES_POSTPROCESSOR_OUTPUT_GENERATOR_H_ */
Definition output_generator.h:89
Definition solution_field.h:39
Definition time_control.h:64
Definition driver.cpp:33
Definition output_generator.h:38
Definition output_data_base.h:31