12 namespace EulerInitialStates
27 template <
typename Description,
int dim,
typename Number>
37 const std::string &subsection)
40 , hyperbolic_system_(hyperbolic_system)
43 primitive_left_[0] = 1.;
44 primitive_left_[1] = 0.;
45 primitive_left_[2] = 1.e3;
47 "primitive state left",
49 "Initial 1d primitive state (rho, u, p) on the left");
52 this->add_parameter(
"left region length",
54 "The length of the left region");
56 primitive_middle_[0] = 1.;
57 primitive_middle_[1] = 0.;
58 primitive_middle_[2] = 1.e-2;
60 "primitive state middle",
62 "Initial 1d primitive state (rho, u, p) in the middle");
65 this->add_parameter(
"middle region length",
67 "The length of the middle region");
69 primitive_right_[0] = 1.;
70 primitive_right_[1] = 0.;
71 primitive_right_[2] = 1.e2;
73 "primitive state right",
75 "Initial 1d primitive state (rho, u, p) on the right");
77 const auto convert_states = [&]() {
78 const auto view = hyperbolic_system_.template view<dim, Number>();
79 state_left_ = view.from_initial_state(primitive_left_);
80 state_middle_ = view.from_initial_state(primitive_middle_);
81 state_right_ = view.from_initial_state(primitive_right_);
83 this->parse_parameters_call_back.connect(convert_states);
89 return point[0] >= left_length_ + middle_length_ ? state_right_
90 : point[0] >= left_length_ ? state_middle_
98 Number middle_length_;
100 dealii::Tensor<1, 3, Number> primitive_left_;
101 dealii::Tensor<1, 3, Number> primitive_middle_;
102 dealii::Tensor<1, 3, Number> primitive_right_;
state_type compute(const dealii::Point< dim > &point, Number) final
ThreeStateContrast(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
Euler::HyperbolicSystem HyperbolicSystem