ExaDG
Loading...
Searching...
No Matches
postprocessor.h
1/* ______________________________________________________________________
2 *
3 * ExaDG - High-Order Discontinuous Galerkin for the Exa-Scale
4 *
5 * Copyright (C) 2023 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_ACOUSTIC_CONSERVATION_EQUATIONS_POSTPROCESSOR_POSTPROCESSOR_H_
23#define EXADG_ACOUSTIC_CONSERVATION_EQUATIONS_POSTPROCESSOR_POSTPROCESSOR_H_
24
25#include <exadg/acoustic_conservation_equations/postprocessor/output_generator.h>
26#include <exadg/acoustic_conservation_equations/postprocessor/pointwise_output_generator.h>
27#include <exadg/acoustic_conservation_equations/postprocessor/postprocessor_base.h>
28#include <exadg/acoustic_conservation_equations/postprocessor/sound_energy_calculator.h>
29#include <exadg/postprocessor/error_calculation.h>
30
31
32namespace ExaDG
33{
34namespace Acoustics
35{
36template<int dim>
38{
39 PostProcessorData() = default;
40
41 OutputData output_data;
42 PointwiseOutputData<dim> pointwise_output_data;
43 ErrorCalculationData<dim> error_data_p;
44 ErrorCalculationData<dim> error_data_u;
45 SoundEnergyCalculatorData sound_energy_data;
46};
47
48template<int dim, typename Number>
49class PostProcessor : public PostProcessorBase<dim, Number>
50{
51public:
53
54 using BlockVectorType = typename Base::BlockVectorType;
55
56 using AcousticsOperator = typename Base::AcousticsOperator;
57
58 static unsigned int const block_index_pressure = AcousticsOperator::block_index_pressure;
59 static unsigned int const block_index_velocity = AcousticsOperator::block_index_velocity;
60
61 PostProcessor(PostProcessorData<dim> const & postprocessor_data, MPI_Comm const & mpi_comm);
62
63 void
64 setup(AcousticsOperator const & pde_operator) final;
65
66 void
67 do_postprocessing(BlockVectorType const & solution,
68 double const time = 0.0,
69 types::time_step const time_step_number = numbers::steady_timestep) final;
70
71protected:
72 MPI_Comm const mpi_comm;
73
74private:
76
77 // write output for visualization of results (e.g., using paraview)
78 OutputGenerator<dim, Number> output_generator;
79
80 // writes output at certain points in space
81 PointwiseOutputGenerator<dim, Number> pointwise_output_generator;
82
83 // calculate errors for verification purposes for problems with known analytical solution
84 ErrorCalculator<dim, Number> error_calculator_p;
85 ErrorCalculator<dim, Number> error_calculator_u;
86
87 // calculates the sound energy in the computational domain
88 SoundEnergyCalculator<dim, Number> sound_energy_calculator;
89};
90
91
92
93} // namespace Acoustics
94} // namespace ExaDG
95
96
97#endif /*EXADG_ACOUSTIC_CONSERVATION_EQUATIONS_POSTPROCESSOR_POSTPROCESSOR_H_*/
Definition output_generator.h:54
Definition pointwise_output_generator.h:47
Definition postprocessor_base.h:40
Definition postprocessor.h:50
Definition sound_energy_calculator.h:77
Definition spatial_operator.h:57
Definition error_calculation.h:95
Definition driver.cpp:33
Definition output_generator.h:34
Definition pointwise_output_generator.h:35
Definition postprocessor.h:38
Definition sound_energy_calculator.h:39
Definition error_calculation.h:39