include/meltpooldg/compressible_flow/state_views.hpp Source File

Developer Documentation: include/meltpooldg/compressible_flow/state_views.hpp Source File
Developer Documentation
state_views.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <deal.II/base/tensor.h>
4#include <deal.II/base/vectorization.h>
5
12
13#include <type_traits>
14
42{
47 template <int dim, typename number>
48 struct MaterialView : public MaterialMixin<MaterialView<dim, number>>
49 {
50 using state_type = std::any;
51
55
57 material() const
58 {
59 return material_data;
60 }
61
62 private:
64 };
65
76 template <int dim, IsConservedStateCompatible<dim> StateType>
78 : public DofValueMixin<dim, typename StateType::value_type, DofValueView<dim, StateType>>
79 {
80 using state_type = std::remove_cvref_t<StateType>;
81
82 DofValueView(StateType &state)
83 : flow_state(&state)
84 {}
85
90
91 StateType &
92 value() const
93 {
94 return *flow_state;
95 }
96
97 private:
98 mutable StateType *flow_state;
99 };
100
111 template <int dim, IsConservedGradientCompatible<dim> StateType>
113 typename StateType::value_type::value_type,
114 DofGradientView<dim, StateType>>
115 {
116 DofGradientView(StateType &state)
117 : flow_state(&state)
118 {}
119
124
125 StateType &
127 {
128 return *flow_state;
129 }
130
131 private:
132 mutable StateType *flow_state;
133 };
134
146 template <int dim, typename number, IsConservedStateCompatible<dim> Value>
148 : public Flow::EOSValueMixin<dim, typename Value::value_type, DofStateView<dim, number, Value>>,
149 public DofValueMixin<dim, typename Value::value_type, DofStateView<dim, number, Value>>,
150 public MaterialMixin<DofStateView<dim, number, Value>>
151 {
152 using state_type = std::remove_cvref_t<Value>;
153
155 : flow_state(&value_state)
157 {}
158
163
164 EquationOfState
165 eos_type() const
166 {
167 return material_data.eos_type;
168 }
169
170 Value &
171 value() const
172 {
173 return *flow_state;
174 }
175
177 material() const
178 {
179 return material_data;
180 }
181
182 private:
183 mutable Value *flow_state;
185 };
186
202 template <int dim,
203 typename number,
207 : public DofValueMixin<dim,
208 typename Value::value_type,
209 DofValueAndGradientStateView<dim, number, Value, Gradient>>,
210 public DofGradientMixin<dim,
211 typename Gradient::value_type::value_type,
212 DofValueAndGradientStateView<dim, number, Value, Gradient>>,
213 public Flow::EOSValueMixin<dim,
214 typename Value::value_type,
215 DofValueAndGradientStateView<dim, number, Value, Gradient>>,
216 public Flow::EOSGradientMixin<dim,
217 DofValueAndGradientStateView<dim, number, Value, Gradient>>,
218 public MaterialMixin<DofValueAndGradientStateView<dim, number, Value, Gradient>>
219 {
220 using state_type = std::remove_cvref_t<Value>;
221 using gradient_type = std::remove_cvref_t<Gradient>;
222
224 Gradient &gradient_state,
226 : flow_state(&value_state)
227 , flow_gradient_state(&gradient_state)
229 {}
230
236
237 Value &
238 value() const
239 {
240 return *flow_state;
241 }
242
243 Gradient &
245 {
246 return *flow_gradient_state;
247 }
248
249 EquationOfState
250 eos_type() const
251 {
252 return material_data.eos_type;
253 }
254
256 material() const
257 {
258 return material_data;
259 }
260
261 private:
262 mutable Value *flow_state;
263 mutable Gradient *flow_gradient_state;
265 };
266
276 template <int dim, typename FluxType>
277 struct FluxView : public FluxMixin<dim, FluxView<dim, FluxType>>
278 {
279 explicit FluxView(FluxType &flux_in)
280 : flux(&flux_in)
281 {}
282
287
288 FluxType &
289 value() const
290 {
291 return *flux;
292 }
293
294 private:
295 mutable FluxType *flux;
296 };
297} // namespace MeltPoolDG::CompressibleFlow
This file contains various functions that can be used to set and evaluate boundary conditions for the...
Definition boundary_condition_functions.hpp:17
dealii::Tensor< 1, n_conserved_variables< dim, n_species >, dealii::Tensor< 1, dim, dealii::VectorizedArray< number > > > FluxType
Definition data_types.hpp:51
Definition state_views_mixins.hpp:127
Definition state_views.hpp:115
StateType & gradient_value() const
Definition state_views.hpp:126
StateType * flow_state
Definition state_views.hpp:132
DofGradientView(StateType &state)
Definition state_views.hpp:116
Definition state_views.hpp:151
DofStateView(Value &value_state, const MaterialPhaseData< number > &material_data)
Definition state_views.hpp:154
const MaterialPhaseData< number > & material_data
Definition state_views.hpp:184
Value * flow_state
Definition state_views.hpp:183
const MaterialPhaseData< number > & material() const
Definition state_views.hpp:177
Value & value() const
Definition state_views.hpp:171
EquationOfState eos_type() const
Definition state_views.hpp:165
std::remove_cvref_t< Value > state_type
Definition state_views.hpp:152
Value & value() const
Definition state_views.hpp:238
EquationOfState eos_type() const
Definition state_views.hpp:250
const MaterialPhaseData< number > & material() const
Definition state_views.hpp:256
std::remove_cvref_t< Gradient > gradient_type
Definition state_views.hpp:221
Gradient * flow_gradient_state
Definition state_views.hpp:263
Value * flow_state
Definition state_views.hpp:262
Gradient & gradient_value() const
Definition state_views.hpp:244
std::remove_cvref_t< Value > state_type
Definition state_views.hpp:220
DofValueAndGradientStateView(Value &value_state, Gradient &gradient_state, const MaterialPhaseData< number > &material_data)
Definition state_views.hpp:223
const MaterialPhaseData< number > & material_data
Definition state_views.hpp:264
Definition state_views_mixins.hpp:34
Definition state_views.hpp:79
StateType * flow_state
Definition state_views.hpp:98
StateType & value() const
Definition state_views.hpp:92
DofValueView(StateType &state)
Definition state_views.hpp:82
std::remove_cvref_t< StateType > state_type
Definition state_views.hpp:80
Definition state_views_mixins.hpp:226
Definition state_views.hpp:278
FluxType * flux
Definition state_views.hpp:295
FluxType & value() const
Definition state_views.hpp:289
FluxView(FluxType &flux_in)
Definition state_views.hpp:279
Definition material_views_mixins.hpp:13
Collection of material parameters for a specific fluid phase.
Definition material.hpp:119
Definition state_views.hpp:49
MaterialView(const MaterialPhaseData< number > &material_data)
Definition state_views.hpp:52
std::any state_type
Definition state_views.hpp:50
const MaterialPhaseData< number > & material_data
Definition state_views.hpp:63
const MaterialPhaseData< number > & material() const
Definition state_views.hpp:57
Definition equation_of_state.hpp:665
Definition equation_of_state.hpp:600