8#include <compile_time_options.h>
14 namespace EulerInitialStates
24 template <
typename Description,
int dim,
typename Number>
34 const std::string subsection)
36 , hyperbolic_system_(hyperbolic_system)
38 primitive_initial_[0] = 1.4;
39 primitive_initial_[1] = 0.0;
40 primitive_initial_[2] = 1.;
41 this->add_parameter(
"primitive state initial",
43 "Initial 1d primitive state (rho, u, p)");
45 primitive_final_[0] = 1.4;
46 primitive_final_[1] = 3.0;
47 primitive_final_[2] = 1.;
48 this->add_parameter(
"primitive state final",
50 "Final 1d primitive state (rho, u, p)");
53 this->add_parameter(
"time initial",
55 "Time until which initial state is prescribed");
58 this->add_parameter(
"time final",
60 "Time from which on the final state is attained)");
62 const auto convert_states = [&]() {
63 const auto view = hyperbolic_system_.template view<dim, Number>();
64 state_initial_ = view.from_initial_state(primitive_initial_);
65 state_final_ = view.from_initial_state(primitive_final_);
67 this->parse_parameters_call_back.connect(convert_states);
71 auto compute(
const dealii::Point<dim> & , Number t)
76 if (t <= t_initial_) {
77 result = state_initial_;
78 }
else if (t >= t_final_) {
79 result = state_final_;
82 std::cos(0.5 * M_PI * (t - t_initial_) / (t_final_ - t_initial_));
84 const Number alpha = factor * factor;
85 const Number beta = Number(1.) - alpha;
86 result = alpha * state_initial_ + beta * state_final_;
95 dealii::Tensor<1, 3, Number> primitive_initial_;
96 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