36 const std::string subsection)
37 :
InitialState<Description, dim, Number>(
"contrast", subsection)
38 , hyperbolic_system_(hyperbolic_system)
40 primitive_left_[0] = 1.4;
41 primitive_left_[1] = 0.;
42 if constexpr (View::have_energy_equation)
43 primitive_left_[2] = 1.;
44 this->add_parameter(
"primitive state left",
46 "1d primitive state [rho, u, p] on the left (or "
47 "[rho, u] for the barotropic Euler module)");
49 primitive_right_[0] = 1.4;
50 primitive_right_[1] = 0.;
51 if constexpr (View::have_energy_equation)
52 primitive_right_[2] = 1.;
53 this->add_parameter(
"primitive state right",
55 "1d primitive state [rho, u, p] on the right (or "
56 "[rho, u] for the barotropic Euler module)");
58 const auto convert_states = [&]() {
59 const auto view = hyperbolic_system_.template view<dim, Number>();
60 state_left_ = view.from_initial_state(primitive_left_);
61 state_right_ = view.from_initial_state(primitive_right_);
63 this->parse_parameters_call_back.connect(convert_states);