10#include <compile_time_options.h>
16 namespace ShallowWaterInitialStates
24 template <
typename Description,
int dim,
typename Number>
34 const std::string subsection)
37 , hyperbolic_system_(hyperbolic_system)
39 well_balancing_validation =
false;
41 "well balancing validation",
42 well_balancing_validation,
43 "If set to true then the initial profile is returned for all "
45 "(t>0); otherwise a constant inflow is computed for t>0 suitable "
46 "for prescribing Dirichlet conditions at the inflow boundary.");
50 this->add_parameter(
"left water depth",
52 "Depth of water to the left of pseudo-dam");
54 this->add_parameter(
"right water depth",
56 "Depth of water to the right of pseudo-dam");
59 this->add_parameter(
"cone magnitude",
61 "To modify magnitude of cone heights");
66 const auto view = hyperbolic_system_.template view<dim, Number>();
68 const Number x = point[0];
72 if (t <= 1.e-10 || well_balancing_validation) {
73 Number h = x < 16. ? left_depth : right_depth;
74 h = std::max(h - compute_bathymetry(point), Number(0.));
80 const auto &h = left_depth;
81 const auto a = view.speed_of_sound(
state_type{{h, Number(0.)}});
87 initial_precomputed_type
final
90 return {compute_bathymetry(point)};
96 DEAL_II_ALWAYS_INLINE
inline Number
97 compute_bathymetry(
const dealii::Point<dim> &point)
const
99 if constexpr (dim == 1) {
101 const Number &x = point[0];
103 Number z3 = 3. - 3. / 10. * std::sqrt(
std::pow(x - 47.5, 2));
104 return cone_magnitude * std::max({z3, Number(0.)});
107 const Number &x = point[0];
108 const Number &y = point[1];
122 return cone_magnitude * std::max({z1, z2, z3, Number(0.)});
125 bool well_balancing_validation;
128 Number cone_magnitude;
typename Description::HyperbolicSystem HyperbolicSystem
auto initial_precomputations(const dealii::Point< dim > &point) -> typename InitialState< Description, dim, Number >::initial_precomputed_type final
state_type compute(const dealii::Point< dim > &point, Number t) final
ThreeBumpsDamBreak(const HyperbolicSystem &hyperbolic_system, const std::string subsection)
typename View::state_type state_type
typename Description::template HyperbolicSystemView< dim, Number > View
T pow(const T x, const T b)
Euler::HyperbolicSystem HyperbolicSystem