34 const std::string subsection)
35 :
InitialState<Description, dim, Number>(
"ramp up", subsection)
36 , hyperbolic_system_(hyperbolic_system)
39 this->add_parameter(
"time initial",
41 "Time until which initial state is prescribed");
44 this->add_parameter(
"time final",
46 "Time from which on the final state is attained)");
48 primitive_initial_[0] = 1.4;
49 primitive_initial_[1] = 0.0;
50 if constexpr (View::have_energy_equation)
51 primitive_initial_[2] = 1.;
52 this->add_parameter(
"primitive state initial",
54 "Initial 1d primitive state [rho, u, p] (or [rho, "
55 "u] for the barotropic Euler module)");
57 primitive_final_[0] = 1.4;
58 primitive_final_[1] = 3.0;
59 if constexpr (View::have_energy_equation)
60 primitive_final_[2] = 1.;
61 this->add_parameter(
"primitive state final",
63 "Final 1d primitive state [rho, u, p] (or [rho, u] "
64 "for the barotropic Euler module)");
66 const auto convert_states = [&]() {
67 const auto view = hyperbolic_system_.template view<dim, Number>();
68 state_initial_ = view.from_initial_state(primitive_initial_);
69 state_final_ = view.from_initial_state(primitive_final_);
71 this->parse_parameters_call_back.connect(convert_states);
75 auto compute(
const dealii::Point<dim> & , Number t)
80 if (t <= t_initial_) {
81 result = state_initial_;
82 }
else if (t >= t_final_) {
83 result = state_final_;
86 std::cos(0.5 * M_PI * (t - t_initial_) / (t_final_ - t_initial_));
88 const Number alpha = factor * factor;
89 const Number beta = Number(1.) - alpha;
90 result = alpha * state_initial_ + beta * state_final_;