40 const std::string &subsection)
43 , hyperbolic_system_(hyperbolic_system)
45 primitive_bottom_left_[0] = 1.4;
46 primitive_bottom_left_[1] = 0.;
47 primitive_bottom_left_[2] = 0.;
48 if constexpr (View::have_energy_equation)
49 primitive_bottom_left_[3] = 1.;
50 this->add_parameter(
"primitive state bottom left",
51 primitive_bottom_left_,
52 "Primitive state [rho, u, v, p] on bottom left (or "
53 "[rho, u] for the barotropic Euler module)");
55 primitive_bottom_right_[0] = 1.4;
56 primitive_bottom_right_[1] = 0.;
57 primitive_bottom_right_[2] = 0.;
58 if constexpr (View::have_energy_equation)
59 primitive_bottom_right_[3] = 1.;
60 this->add_parameter(
"primitive state bottom right",
61 primitive_bottom_right_,
62 "Primitive state [rho, u, v, p] on bottom right "
63 "(or [rho, u] for the barotropic Euler module)");
65 primitive_top_left_[0] = 1.4;
66 primitive_top_left_[1] = 0.;
67 primitive_top_left_[2] = 0.;
68 if constexpr (View::have_energy_equation)
69 primitive_top_left_[3] = 1.;
70 this->add_parameter(
"primitive state top left",
72 "Primitive state [rho, u, v, p] on top left (or "
73 "[rho, u] for the barotropic Euler module)");
75 primitive_top_right_[0] = 1.4;
76 primitive_top_right_[1] = 0.;
77 primitive_top_right_[2] = 0.;
78 if constexpr (View::have_energy_equation)
79 primitive_top_right_[3] = 1.;
80 this->add_parameter(
"primitive state top right",
82 "Primitive state [rho, u, v, p] on top right (or "
83 "[rho, u] for the barotropic Euler module)");
85 const auto convert_states = [&]() {
86 const auto view = hyperbolic_system_.template view<dim, Number>();
87 if constexpr (dim != 1) {
89 view.from_initial_state(primitive_bottom_left_);
91 view.from_initial_state(primitive_bottom_right_);
92 state_top_left_ = view.from_initial_state(primitive_top_left_);
93 state_top_right_ = view.from_initial_state(primitive_top_right_);
96 this->parse_parameters_call_back.connect(convert_states);
102 if constexpr (dim == 1) {
103 AssertThrow(
false, dealii::ExcNotImplemented());
108 const auto top = point[0] >= 0. ? state_top_right_ : state_top_left_;
110 point[0] >= 0. ? state_bottom_right_ : state_bottom_left_;
111 return (point[1] >= 0. ? top : bottom);