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
109 template <int dim, IsPrimitiveStateCompatible<dim> StateType>
111 : public DofPrimitiveValueMixin<dim,
112 typename StateType::value_type,
113 DofPrimitiveValueView<dim, StateType>>
114 {
115 using state_type = std::remove_cvref_t<StateType>;
116
117 DofPrimitiveValueView(StateType &state)
118 : flow_state(&state)
119 {}
120
125
126 StateType &
127 value() const
128 {
129 return *flow_state;
130 }
131
132 private:
133 mutable StateType *flow_state;
134 };
135
146 template <int dim, IsConservedGradientCompatible<dim> StateType>
148 typename StateType::value_type::value_type,
149 DofGradientView<dim, StateType>>
150 {
151 DofGradientView(StateType &state)
152 : flow_state(&state)
153 {}
154
159
160 StateType &
162 {
163 return *flow_state;
164 }
165
166 private:
167 mutable StateType *flow_state;
168 };
169
181 template <int dim, typename number, IsConservedStateCompatible<dim> Value>
183 : public Flow::EOSValueMixin<dim, typename Value::value_type, DofStateView<dim, number, Value>>,
184 public DofValueMixin<dim, typename Value::value_type, DofStateView<dim, number, Value>>,
185 public MaterialMixin<DofStateView<dim, number, Value>>
186 {
187 using state_type = std::remove_cvref_t<Value>;
188
190 : flow_state(&value_state)
192 {}
193
198
199 EquationOfState
200 eos_type() const
201 {
202 return material_data.eos_type;
203 }
204
205 Value &
206 value() const
207 {
208 return *flow_state;
209 }
210
212 material() const
213 {
214 return material_data;
215 }
216
217 private:
218 mutable Value *flow_state;
220 };
221
233 template <int dim, typename number, IsPrimitiveStateCompatible<dim> Value>
235 : public DofPrimitiveValueMixin<dim,
236 typename Value::value_type,
237 DofPrimitiveStateView<dim, number, Value>>,
238 public MaterialMixin<DofPrimitiveStateView<dim, number, Value>>
239 {
240 using state_type = std::remove_cvref_t<Value>;
241
243 : flow_state(&value_state)
245 {}
246
251
252 EquationOfState
253 eos_type() const
254 {
255 return material_data.eos_type;
256 }
257
258 Value &
259 value() const
260 {
261 return *flow_state;
262 }
263
265 material() const
266 {
267 return material_data;
268 }
269
270 private:
271 mutable Value *flow_state;
273 };
274
290 template <int dim,
291 typename number,
295 : public DofValueMixin<dim,
296 typename Value::value_type,
297 DofValueAndGradientStateView<dim, number, Value, Gradient>>,
298 public DofGradientMixin<dim,
299 typename Gradient::value_type::value_type,
300 DofValueAndGradientStateView<dim, number, Value, Gradient>>,
301 public Flow::EOSValueMixin<dim,
302 typename Value::value_type,
303 DofValueAndGradientStateView<dim, number, Value, Gradient>>,
304 public Flow::EOSGradientMixin<dim,
305 DofValueAndGradientStateView<dim, number, Value, Gradient>>,
306 public MaterialMixin<DofValueAndGradientStateView<dim, number, Value, Gradient>>
307 {
308 using state_type = std::remove_cvref_t<Value>;
309 using gradient_type = std::remove_cvref_t<Gradient>;
310
312 Gradient &gradient_state,
314 : flow_state(&value_state)
315 , flow_gradient_state(&gradient_state)
317 {}
318
324
325 Value &
326 value() const
327 {
328 return *flow_state;
329 }
330
331 Gradient &
333 {
334 return *flow_gradient_state;
335 }
336
337 EquationOfState
338 eos_type() const
339 {
340 return material_data.eos_type;
341 }
342
344 material() const
345 {
346 return material_data;
347 }
348
349 private:
350 mutable Value *flow_state;
351 mutable Gradient *flow_gradient_state;
353 };
354
364 template <int dim, typename FluxType>
365 struct FluxView : public FluxMixin<dim, FluxView<dim, FluxType>>
366 {
367 explicit FluxView(FluxType &flux_in)
368 : flux(&flux_in)
369 {}
370
375
376 FluxType &
377 value() const
378 {
379 return *flux;
380 }
381
382 private:
383 mutable FluxType *flux;
384 };
385} // 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:61
Definition state_views_mixins.hpp:186
Definition state_views.hpp:150
StateType & gradient_value() const
Definition state_views.hpp:161
StateType * flow_state
Definition state_views.hpp:167
DofGradientView(StateType &state)
Definition state_views.hpp:151
const MaterialPhaseData< number > & material_data
Definition state_views.hpp:272
std::remove_cvref_t< Value > state_type
Definition state_views.hpp:240
EquationOfState eos_type() const
Definition state_views.hpp:253
Value & value() const
Definition state_views.hpp:259
const MaterialPhaseData< number > & material() const
Definition state_views.hpp:265
Value * flow_state
Definition state_views.hpp:271
DofPrimitiveStateView(Value &value_state, const MaterialPhaseData< number > &material_data)
Definition state_views.hpp:242
Definition state_views_mixins.hpp:114
DofPrimitiveValueView(StateType &state)
Definition state_views.hpp:117
StateType * flow_state
Definition state_views.hpp:133
std::remove_cvref_t< StateType > state_type
Definition state_views.hpp:115
StateType & value() const
Definition state_views.hpp:127
Definition state_views.hpp:186
DofStateView(Value &value_state, const MaterialPhaseData< number > &material_data)
Definition state_views.hpp:189
const MaterialPhaseData< number > & material_data
Definition state_views.hpp:219
Value * flow_state
Definition state_views.hpp:218
const MaterialPhaseData< number > & material() const
Definition state_views.hpp:212
Value & value() const
Definition state_views.hpp:206
EquationOfState eos_type() const
Definition state_views.hpp:200
std::remove_cvref_t< Value > state_type
Definition state_views.hpp:187
Value & value() const
Definition state_views.hpp:326
EquationOfState eos_type() const
Definition state_views.hpp:338
const MaterialPhaseData< number > & material() const
Definition state_views.hpp:344
std::remove_cvref_t< Gradient > gradient_type
Definition state_views.hpp:309
Gradient * flow_gradient_state
Definition state_views.hpp:351
Value * flow_state
Definition state_views.hpp:350
Gradient & gradient_value() const
Definition state_views.hpp:332
std::remove_cvref_t< Value > state_type
Definition state_views.hpp:308
DofValueAndGradientStateView(Value &value_state, Gradient &gradient_state, const MaterialPhaseData< number > &material_data)
Definition state_views.hpp:311
const MaterialPhaseData< number > & material_data
Definition state_views.hpp:352
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:285
Definition state_views.hpp:366
FluxType * flux
Definition state_views.hpp:383
FluxType & value() const
Definition state_views.hpp:377
FluxView(FluxType &flux_in)
Definition state_views.hpp:367
Definition material_views_mixins.hpp:13
Collection of material parameters for a specific fluid phase.
Definition material.hpp:140
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:1044
Definition equation_of_state.hpp:979