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 WITH LLVM-exception
3// Copyright (C) 2022 - 2024 by the ryujin authors
4//
5
6#pragma once
7
8#include "hyperbolic_system.h"
10
11namespace ryujin
12{
13 namespace ScalarConservation
14 {
15 struct Description;
16
22 template <int dim, typename Number>
23 class Uniform : public InitialState<Description, dim, Number>
24 {
25 public:
27 using state_type = typename View::state_type;
28
29 Uniform(const HyperbolicSystem &hyperbolic_system,
30 const std::string subsection)
31 : InitialState<Description, dim, Number>("uniform", subsection)
32 , hyperbolic_system(hyperbolic_system)
33 {
34 primitive_[0] = 1.0;
35 this->add_parameter(
36 "primitive state", primitive_, "Initial 1d primitive state");
37 }
38
39 state_type compute(const dealii::Point<dim> & /*point*/,
40 Number /*t*/) final
41 {
42 const auto view = hyperbolic_system.view<dim, Number>();
43 return view.from_primitive_state(view.expand_state(primitive_));
44 }
45
46 private:
47 const HyperbolicSystem &hyperbolic_system;
48
49 state_type primitive_;
50 };
51 } // namespace ScalarConservation
52} // namespace ryujin
dealii::Tensor< 1, problem_dimension, Number > state_type
state_type compute(const dealii::Point< dim > &, Number) final
Uniform(const HyperbolicSystem &hyperbolic_system, const std::string subsection)
Euler::Description Description