8#include <compile_time_options.h>
14 namespace EulerInitialStates
29 template <
typename Description,
int dim,
typename Number>
39 const std::string &subsection)
42 , hyperbolic_system_(hyperbolic_system)
44 primitive_bottom_left_[0] = 1.4;
45 primitive_bottom_left_[1] = 0.;
46 primitive_bottom_left_[2] = 0.;
47 primitive_bottom_left_[3] = 1.;
49 "primitive state bottom left",
50 primitive_bottom_left_,
51 "Initial primitive state (rho, u, v, p) on bottom left");
53 primitive_bottom_right_[0] = 1.4;
54 primitive_bottom_right_[1] = 0.;
55 primitive_bottom_right_[2] = 0.;
56 primitive_bottom_right_[3] = 1.;
58 "primitive state bottom right",
59 primitive_bottom_right_,
60 "Initial primitive state (rho, u, v, p) on bottom right");
62 primitive_top_left_[0] = 1.4;
63 primitive_top_left_[1] = 0.;
64 primitive_top_left_[2] = 0.;
65 primitive_top_left_[3] = 1.;
68 "primitive state top left",
70 "Initial primitive state (rho, u, v, p) on top left");
72 primitive_top_right_[0] = 1.4;
73 primitive_top_right_[1] = 0.;
74 primitive_top_right_[2] = 0.;
75 primitive_top_right_[3] = 1.;
77 "primitive state top right",
79 "Initial primitive state (rho, u, v, p) on top right");
81 const auto convert_states = [&]() {
82 const auto view = hyperbolic_system_.template view<dim, Number>();
83 if constexpr (dim != 1) {
85 view.from_initial_state(primitive_bottom_left_);
87 view.from_initial_state(primitive_bottom_right_);
88 state_top_left_ = view.from_initial_state(primitive_top_left_);
89 state_top_right_ = view.from_initial_state(primitive_top_right_);
92 this->parse_parameters_call_back.connect(convert_states);
98 if constexpr (dim == 1) {
99 AssertThrow(
false, dealii::ExcNotImplemented());
104 const auto top = point[0] >= 0. ? state_top_right_ : state_top_left_;
106 point[0] >= 0. ? state_bottom_right_ : state_bottom_left_;
107 return (point[1] >= 0. ? top : bottom);
114 dealii::Tensor<1, 4, Number> primitive_bottom_left_;
115 dealii::Tensor<1, 4, Number> primitive_bottom_right_;
116 dealii::Tensor<1, 4, Number> primitive_top_left_;
117 dealii::Tensor<1, 4, Number> primitive_top_right_;
state_type compute(const dealii::Point< dim > &point, Number) final
typename View::state_type state_type
typename Description::HyperbolicSystem HyperbolicSystem
FourStateContrast(const HyperbolicSystem &hyperbolic_system, const std::string &subsection)
typename Description::template HyperbolicSystemView< dim, Number > View
Euler::HyperbolicSystem HyperbolicSystem