12 namespace EulerInitialStates
27 template <
typename Description,
int dim,
typename Number>
37 const std::string &subsection)
40 , hyperbolic_system_(hyperbolic_system)
42 primitive_bottom_left_[0] = 1.4;
43 primitive_bottom_left_[1] = 0.;
44 primitive_bottom_left_[2] = 0.;
45 primitive_bottom_left_[3] = 1.;
47 "primitive state bottom left",
48 primitive_bottom_left_,
49 "Initial primitive state (rho, u, v, p) on bottom left");
51 primitive_bottom_right_[0] = 1.4;
52 primitive_bottom_right_[1] = 0.;
53 primitive_bottom_right_[2] = 0.;
54 primitive_bottom_right_[3] = 1.;
56 "primitive state bottom right",
57 primitive_bottom_right_,
58 "Initial primitive state (rho, u, v, p) on bottom right");
60 primitive_top_left_[0] = 1.4;
61 primitive_top_left_[1] = 0.;
62 primitive_top_left_[2] = 0.;
63 primitive_top_left_[3] = 1.;
66 "primitive state top left",
68 "Initial primitive state (rho, u, v, p) on top left");
70 primitive_top_right_[0] = 1.4;
71 primitive_top_right_[1] = 0.;
72 primitive_top_right_[2] = 0.;
73 primitive_top_right_[3] = 1.;
75 "primitive state top right",
77 "Initial primitive state (rho, u, v, p) on top right");
79 const auto convert_states = [&]() {
80 const auto view = hyperbolic_system_.template view<dim, Number>();
81 if constexpr (dim != 1) {
83 view.from_initial_state(primitive_bottom_left_);
85 view.from_initial_state(primitive_bottom_right_);
86 state_top_left_ = view.from_initial_state(primitive_top_left_);
87 state_top_right_ = view.from_initial_state(primitive_top_right_);
90 this->parse_parameters_call_back.connect(convert_states);
96 if constexpr (dim == 1) {
97 AssertThrow(
false, dealii::ExcNotImplemented());
102 const auto top = point[0] >= 0. ? state_top_right_ : state_top_left_;
104 point[0] >= 0. ? state_bottom_right_ : state_bottom_left_;
105 return (point[1] >= 0. ? top : bottom);
112 dealii::Tensor<1, 4, Number> primitive_bottom_left_;
113 dealii::Tensor<1, 4, Number> primitive_bottom_right_;
114 dealii::Tensor<1, 4, Number> primitive_top_left_;
115 dealii::Tensor<1, 4, Number> primitive_top_right_;
state_type compute(const dealii::Point< dim > &point, Number) final
typename View::state_type state_type
typename Description::HyperbolicSystem HyperbolicSystem
FourStateContrast(const HyperbolicSystem &hyperbolic_system, const std::string &subsection)
typename Description::template HyperbolicSystemView< dim, Number > View
Euler::HyperbolicSystem HyperbolicSystem