ryujin 2.1.1 revision e1e0c9cf84519540dcc04ed5bb49dc8a8c052779
Loading...
Searching...
No Matches
postprocessor.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3// Copyright (C) 2020 - 2026 by the ryujin authors
4//
5
6#pragma once
7
8#include <compile_time_options.h>
9
10#include <ryujin/interface/parabolic_system.h>
11
12#include "mpi_ensemble.h"
13#include "observer_pointer.h"
14#include "offline_data.h"
15
16#include <deal.II/base/parameter_acceptor.h>
17
18namespace ryujin
19{
42 template <typename HyperbolicDescription, int dim, typename Number = double>
43 class Postprocessor final : public dealii::ParameterAcceptor
44 {
45 public:
50
52
53 using View = typename HyperbolicSystem::template View<dim, Number>;
54
55 static constexpr auto problem_dimension = View::problem_dimension;
56
57 using state_type = typename View::state_type;
58
59 template <typename T>
60 using grad_type = dealii::Tensor<1, dim, T>;
61
62 template <typename T>
63 using curl_type = dealii::Tensor<1, dim == 2 ? 1 : dim, T>;
64
66
70
74 Postprocessor(const MPIEnsemble &mpi_ensemble,
75 const OfflineData<dim, Number> &offline_data,
76 const HyperbolicSystem &hyperbolic_system,
77 const Interface::ParabolicSystem &parabolic_system,
78 const std::string &subsection = "/Postprocessor");
79
87 void prepare();
88
90
94
107 void compute(const StateVector<Number> &state_vector) const;
108
114 void reset_bounds() const
115 {
116 bounds_.clear();
117 }
118
120
124
128 unsigned int n_quantities() const
129 {
130 return quantities_.size();
131 }
132
136 const std::vector<std::string> component_names() const
137 {
138 return component_names_;
139 }
140
146
147 private:
149
153
154 bool recompute_bounds_;
155 Number beta_;
156
157 std::vector<std::string> schlieren_quantities_;
158 std::vector<std::string> vorticity_quantities_;
159
161
165
166 const MPIEnsemble &mpi_ensemble_;
167
168 dealii::ObserverPointer<const OfflineData<dim, Number>> offline_data_;
169 dealii::ObserverPointer<const HyperbolicSystem> hyperbolic_system_;
170 dealii::ObserverPointer<const Interface::ParabolicSystem> parabolic_system_;
171
172 std::vector<std::string> component_names_;
173 std::vector<std::pair<bool /*primitive*/, unsigned int>> schlieren_indices_;
174 std::vector<std::pair<bool /*primitive*/, unsigned int>> vorticity_indices_;
175
176 mutable std::vector<std::pair<Number, Number>> bounds_;
177 mutable std::vector<ScalarHostVector<Number>> quantities_;
178
180 };
181
182} // namespace ryujin
typename HyperbolicDescription::HyperbolicSystem HyperbolicSystem
const std::vector< std::string > component_names() const
const auto & quantities() const
typename HyperbolicSystem::template View< dim, Number > View
dealii::Tensor< 1, dim, T > grad_type
void reset_bounds() const
dealii::Tensor< 1, dim==2 ? 1 :dim, T > curl_type
typename View::state_type state_type
static constexpr auto problem_dimension
void compute(const StateVector< Number > &state_vector) const
unsigned int n_quantities() const
#define ACCESSOR_READ_ONLY(member)