9#include <initial_state.h>
13 namespace ShallowWater
21 template <
int dim,
typename Number,
typename state_type>
28 , hyperbolic_system(hyperbolic_system)
30 well_balancing_validation =
false;
32 "well balancing validation",
33 well_balancing_validation,
34 "If set to true then the initial profile is returned for all "
36 "(t>0); otherwise a constant inflow is computed for t>0 suitable "
37 "for prescribing Dirichlet conditions at the inflow boundary.");
41 this->add_parameter(
"left water depth",
43 "Depth of water to the left of pseudo-dam");
45 this->add_parameter(
"right water depth",
47 "Depth of water to the right of pseudo-dam");
50 this->add_parameter(
"cone magnitude",
52 "To modify magnitude of cone heights");
57 const Number x = point[0];
61 if (t <= 1.e-10 || well_balancing_validation) {
62 Number h = x < 0 ? left_depth : right_depth;
63 h = std::max(h - compute_bathymetry(point), Number(0.));
64 return hyperbolic_system.template expand_state<dim>(
70 const auto &h = left_depth;
72 HyperbolicSystem ::state_type<1, Number>{{h, Number(0.)}});
73 return hyperbolic_system.template expand_state<dim>(
82 return {compute_bathymetry(point)};
88 DEAL_II_ALWAYS_INLINE
inline Number
89 compute_bathymetry(
const dealii::Point<dim> &point)
const
91 if constexpr (dim == 1) {
93 const Number &x = point[0];
95 Number z3 = 3. - 3. / 10. * std::sqrt(
std::pow(x - 47.5, 2));
96 return cone_magnitude * std::max({z3, Number(0.)});
99 const Number &x = point[0];
100 const Number &y = point[1];
114 return cone_magnitude * std::max({z1, z2, z3, Number(0.)});
117 bool well_balancing_validation;
120 Number cone_magnitude;
typename HyperbolicSystemView::state_type state_type
Number speed_of_sound(const dealii::Tensor< 1, problem_dim, Number > &U) const
dealii::Tensor< 1, problem_dimension< dim >, Number > state_type
state_type compute(const dealii::Point< dim > &point, Number t) final
ThreeBumpsDamBreak(const HyperbolicSystem &hyperbolic_system, const std::string s)
auto initial_precomputations(const dealii::Point< dim > &point) -> typename InitialState< dim, Number, state_type, 1 >::precomputed_type final
T pow(const T x, const T b)