ryujin 2.1.1 revision 0348cbb53a3e4b1da2a4c037e81f88f2d21ce219
initial_state_uniform.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0
3// [LANL Copyright Statement]
4// Copyright (C) 2022 - 2024 by the ryujin authors
5// Copyright (C) 2023 - 2024 by Triad National Security, LLC
6//
7
8#pragma once
9
11
12namespace ryujin
13{
14 namespace ShallowWaterInitialStates
15 {
25 template <typename Description, int dim, typename Number>
26 class Uniform : public InitialState<Description, dim, Number>
27 {
28 public:
30 using View =
31 typename Description::template HyperbolicSystemView<dim, Number>;
32 using state_type = typename View::state_type;
33
34 Uniform(const HyperbolicSystem &hyperbolic_system,
35 const std::string subsection)
36 : InitialState<Description, dim, Number>("uniform", subsection)
37 , hyperbolic_system_(hyperbolic_system)
38 {
39 primitive_[0] = 1.;
40 primitive_[1] = 1.;
41 this->add_parameter(
42 "primitive state", primitive_, "Initial 1d primitive state (h, u)");
43 }
44
45 state_type compute(const dealii::Point<dim> & /*point*/,
46 Number /*t*/) final
47 {
48 const auto view = hyperbolic_system_.template view<dim, Number>();
49 return view.from_initial_state(primitive_);
50 }
51
52 /* Default bathymetry of 0 */
53
54 private:
55 const HyperbolicSystem &hyperbolic_system_;
56
57 dealii::Tensor<1, 2, Number> primitive_;
58 };
59
60 } // namespace ShallowWaterInitialStates
61} // namespace ryujin
Uniform(const HyperbolicSystem &hyperbolic_system, const std::string subsection)
typename Description::HyperbolicSystem HyperbolicSystem
state_type compute(const dealii::Point< dim > &, Number) final
typename Description::template HyperbolicSystemView< dim, Number > View
Euler::HyperbolicSystem HyperbolicSystem
Definition: description.h:32