ryujin 2.1.1 revision b04fb4aba7bd97ddfa5994a6b4b6e8586eb15db2
Loading...
Searching...
No Matches
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 - 2026 by the ryujin authors
4//
5
6#pragma once
7
8#include <compile_time_options.h>
9
10#include <ryujin/interface/parabolic_system.h>
11
12#include "convenience_macros.h"
13
14#include <deal.II/base/parameter_acceptor.h>
15#include <deal.II/base/tensor.h>
16
17#include <set>
18#include <string>
19
20namespace ryujin
21{
34 template <typename HyperbolicDescription, int dim, typename Number = double>
35 class InitialState : public dealii::ParameterAcceptor
36 {
37 public:
39 using View = typename HyperbolicSystem::template View<dim, Number>;
40
41 using state_type = typename View::state_type;
42
43 using initial_precomputed_type = typename View::initial_precomputed_type;
44
50 InitialState(const std::string &name, const std::string &subsection)
51 : ParameterAcceptor(subsection + "/" + name)
52 , name_(name)
53 {
54 }
55
63 virtual state_type compute(const dealii::Point<dim> &point, Number t) = 0;
64
75 initial_precomputations(const dealii::Point<dim> & /*point*/)
76 {
78 }
79
84
85 private:
86 const std::string name_;
87 };
88
89
99 template <typename HyperbolicDescription, int dim, typename Number>
101 {
102 public:
107
111 using initial_state_list_type = std::set<
112 std::unique_ptr<InitialState<HyperbolicDescription, dim, Number>>>;
113
120 static void
122 const HyperbolicSystem &h,
123 const Interface::ParabolicSystem &p,
124 const std::string &s);
125 };
126} // namespace ryujin
typename HyperbolicDescription::HyperbolicSystem HyperbolicSystem
std::set< std::unique_ptr< InitialState< HyperbolicDescription, dim, Number > > > initial_state_list_type
const auto & name() const
typename HyperbolicSystem::template View< dim, Number > View
typename View::initial_precomputed_type initial_precomputed_type
typename View::state_type state_type
virtual initial_precomputed_type initial_precomputations(const dealii::Point< dim > &)
virtual state_type compute(const dealii::Point< dim > &point, Number t)=0
InitialState(const std::string &name, const std::string &subsection)
typename HyperbolicDescription::HyperbolicSystem HyperbolicSystem
static void populate_initial_state_list(initial_state_list_type &initial_state_list, const HyperbolicSystem &h, const Interface::ParabolicSystem &p, const std::string &s)
#define ACCESSOR_READ_ONLY(member)