12 namespace EulerInitialStates
22 template <
typename Description,
int dim,
typename Number>
32 const std::string subsection)
34 , hyperbolic_system_(hyperbolic_system)
36 primitive_initial_[0] = 1.4;
37 primitive_initial_[1] = 0.0;
38 primitive_initial_[2] = 1.;
39 this->add_parameter(
"primitive state initial",
41 "Initial 1d primitive state (rho, u, p)");
43 primitive_final_[0] = 1.4;
44 primitive_final_[1] = 3.0;
45 primitive_final_[2] = 1.;
46 this->add_parameter(
"primitive state final",
48 "Final 1d primitive state (rho, u, p)");
51 this->add_parameter(
"time initial",
53 "Time until which initial state is prescribed");
56 this->add_parameter(
"time final",
58 "Time from which on the final state is attained)");
60 const auto convert_states = [&]() {
61 const auto view = hyperbolic_system_.template view<dim, Number>();
62 state_initial_ = view.from_initial_state(primitive_initial_);
63 state_final_ = view.from_initial_state(primitive_final_);
65 this->parse_parameters_call_back.connect(convert_states);
69 auto compute(
const dealii::Point<dim> & , Number t)
74 if (t <= t_initial_) {
75 result = state_initial_;
76 }
else if (t >= t_final_) {
77 result = state_final_;
80 std::cos(0.5 * M_PI * (t - t_initial_) / (t_final_ - t_initial_));
82 const Number alpha = factor * factor;
83 const Number beta = Number(1.) - alpha;
84 result = alpha * state_initial_ + beta * state_final_;
93 dealii::Tensor<1, 3, Number> primitive_initial_;
94 dealii::Tensor<1, 3, Number> primitive_final_;
RampUp(const HyperbolicSystem &hyperbolic_system, const std::string subsection)
typename Description::template HyperbolicSystemView< dim, Number > View
typename Description::HyperbolicSystem HyperbolicSystem
typename View::state_type state_type
auto compute(const dealii::Point< dim > &, Number t) -> state_type final
Euler::HyperbolicSystem HyperbolicSystem