ryujin 2.1.1 revision 3bc2805b8013f3db96af2324837f4d07c0f9fb89
initial_state_library.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3// Copyright (C) 2020 - 2024 by the ryujin authors
4//
5
6#pragma once
7
8#include <compile_time_options.h>
9
10#include "convenience_macros.h"
11
12#include <deal.II/base/parameter_acceptor.h>
13#include <deal.II/base/tensor.h>
14
15#include <set>
16#include <string>
17
18namespace ryujin
19{
32 template <typename Description, int dim, typename Number = double>
33 class InitialState : public dealii::ParameterAcceptor
34 {
35 public:
36 using View =
37 typename Description::template HyperbolicSystemView<dim, Number>;
38
39 using state_type = typename View::state_type;
40
41 using initial_precomputed_type = typename View::initial_precomputed_type;
42
48 InitialState(const std::string &name, const std::string &subsection)
49 : ParameterAcceptor(subsection + "/" + name)
50 , name_(name)
51 {
52 }
53
61 virtual state_type compute(const dealii::Point<dim> &point, Number t) = 0;
62
73 initial_precomputations(const dealii::Point<dim> & /*point*/)
74 {
76 }
77
82
83 private:
84 const std::string name_;
85 };
86
87
97 template <typename Description, int dim, typename Number>
99 {
100 public:
105
110 std::set<std::unique_ptr<InitialState<Description, dim, Number>>>;
111
118 static void
120 const HyperbolicSystem &h,
121 const std::string &s);
122 };
123} // namespace ryujin
typename Description::HyperbolicSystem HyperbolicSystem
std::set< std::unique_ptr< InitialState< Description, dim, Number > > > initial_state_list_type
static void populate_initial_state_list(initial_state_list_type &initial_state_list, const HyperbolicSystem &h, const std::string &s)
InitialState(const std::string &name, const std::string &subsection)
typename View::initial_precomputed_type initial_precomputed_type
virtual initial_precomputed_type initial_precomputations(const dealii::Point< dim > &)
typename Description::template HyperbolicSystemView< dim, Number > View
virtual state_type compute(const dealii::Point< dim > &point, Number t)=0
typename View::state_type state_type
#define ACCESSOR_READ_ONLY(member)
Euler::HyperbolicSystem HyperbolicSystem
Definition: description.h:32