35 const std::string subsection)
37 , hyperbolic_system_(hyperbolic_system)
40 this->add_parameter(
"time initial",
42 "Time until which initial state is prescribed");
45 this->add_parameter(
"time final",
47 "Time from which on the final state is attained)");
49 primitive_initial_[0] = 1.4;
50 primitive_initial_[1] = 0.0;
51 if constexpr (View::have_energy_equation)
52 primitive_initial_[2] = 1.;
53 this->add_parameter(
"primitive state initial",
55 "Initial 1d primitive state [rho, u, p] (or [rho, "
56 "u] for the barotropic Euler module)");
58 primitive_final_[0] = 1.4;
59 primitive_final_[1] = 3.0;
60 if constexpr (View::have_energy_equation)
61 primitive_final_[2] = 1.;
62 this->add_parameter(
"primitive state final",
64 "Final 1d primitive state [rho, u, p] (or [rho, u] "
65 "for the barotropic Euler module)");
67 const auto convert_states = [&]() {
68 const auto view = hyperbolic_system_.template view<dim, Number>();
69 state_initial_ = view.from_initial_state(primitive_initial_);
70 state_final_ = view.from_initial_state(primitive_final_);
72 this->parse_parameters_call_back.connect(convert_states);
76 auto compute(
const dealii::Point<dim> & , Number t)
81 if (t <= t_initial_) {
82 result = state_initial_;
83 }
else if (t >= t_final_) {
84 result = state_final_;
87 std::cos(0.5 * M_PI * (t - t_initial_) / (t_final_ - t_initial_));
89 const Number alpha = factor * factor;
90 const Number beta = Number(1.) - alpha;
91 result = alpha * state_initial_ + beta * state_final_;