32 const std::string subsection)
34 , hyperbolic_system_(hyperbolic_system)
36 density_expression_ =
"1.4";
37 this->add_parameter(
"density expression",
39 "A function expression describing the density");
41 velocity_x_expression_ =
"3.0";
43 "velocity x expression",
44 velocity_x_expression_,
45 "A function expression describing the x-component of the velocity");
47 if constexpr (dim > 1) {
48 velocity_y_expression_ =
"0.0";
49 this->add_parameter(
"velocity y expression",
50 velocity_y_expression_,
51 "A function expression describing the "
52 "y-component of the velocity");
55 if constexpr (dim > 2) {
56 velocity_z_expression_ =
"0.0";
57 this->add_parameter(
"velocity z expression",
58 velocity_z_expression_,
59 "A function expression describing the "
60 "z-component of the velocity");
63 if constexpr (View::have_energy_equation) {
64 pressure_expression_ =
"1.0";
65 this->add_parameter(
"pressure expression",
67 "A function expression describing the pressure");
72 const auto set_up_muparser = [
this] {
73 using FP = dealii::FunctionParser<dim>;
79 density_function_ = std::make_unique<FP>(density_expression_);
80 velocity_x_function_ = std::make_unique<FP>(velocity_x_expression_);
81 if constexpr (dim > 1)
82 velocity_y_function_ = std::make_unique<FP>(velocity_y_expression_);
83 if constexpr (dim > 2)
84 velocity_z_function_ = std::make_unique<FP>(velocity_z_expression_);
85 if constexpr (View::have_energy_equation)
86 pressure_function_ = std::make_unique<FP>(pressure_expression_);
90 this->parse_parameters_call_back.connect(set_up_muparser);
95 const auto view = hyperbolic_system_.template view<dim, Number>();
98 density_function_->set_time(t);
99 full_primitive_state[0] = density_function_->value(point);
101 velocity_x_function_->set_time(t);
102 full_primitive_state[1] = velocity_x_function_->value(point);
104 if constexpr (dim > 1) {
105 velocity_y_function_->set_time(t);
106 full_primitive_state[2] = velocity_y_function_->value(point);
108 if constexpr (dim > 2) {
109 velocity_z_function_->set_time(t);
110 full_primitive_state[3] = velocity_z_function_->value(point);
113 if constexpr (View::have_energy_equation) {
114 pressure_function_->set_time(t);
115 full_primitive_state[1 + dim] = pressure_function_->value(point);
118 return view.from_initial_state(full_primitive_state);