ryujin 2.1.1 revision 0348cbb53a3e4b1da2a4c037e81f88f2d21ce219
initial_values.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
11#include "offline_data.h"
12
13#include <deal.II/base/parameter_acceptor.h>
14#include <deal.II/base/smartpointer.h>
15#include <deal.II/base/tensor.h>
16
17#include <functional>
18
19namespace ryujin
20{
37 template <typename Description, int dim, typename Number = double>
38 class InitialValues : public dealii::ParameterAcceptor
39 {
40 public:
46
47 using View =
48 typename Description::template HyperbolicSystemView<dim, Number>;
49
50 static constexpr auto problem_dimension = View::problem_dimension;
51
52 using state_type = typename View::state_type;
53
54 static constexpr auto n_initial_precomputed_values =
55 View::n_initial_precomputed_values;
56
57 using initial_precomputed_type = typename View::initial_precomputed_type;
58
59 using HyperbolicVector = typename View::HyperbolicVector;
60
61 using InitialPrecomputedVector = typename View::InitialPrecomputedVector;
62
64
68
72 InitialValues(const HyperbolicSystem &hyperbolic_system,
73 const OfflineData<dim, Number> &offline_data,
74 const std::string &subsection = "/InitialValues");
75
76
84
85
93 DEAL_II_ALWAYS_INLINE inline state_type
94 initial_state(const dealii::Point<dim> &point, Number t) const
95 {
96 return initial_state_(point, t);
97 }
98
99
107 DEAL_II_ALWAYS_INLINE inline initial_precomputed_type
108 initial_precomputed(const dealii::Point<dim> &point) const
109 {
110 return initial_precomputed_(point);
111 }
112
113
119
120
126
127 private:
129
133
134 std::string configuration_;
135
136 dealii::Point<dim> initial_position_;
137
138 dealii::Tensor<1, dim> initial_direction_;
139
140 Number perturbation_;
141
143
147
148 dealii::SmartPointer<const HyperbolicSystem> hyperbolic_system_;
149 dealii::SmartPointer<const OfflineData<dim, Number>> offline_data_;
150
152 initial_state_list_type initial_state_list_;
153
154 std::function<state_type(const dealii::Point<dim> &, Number)>
155 initial_state_;
156
157 std::function<initial_precomputed_type(const dealii::Point<dim> &)>
158 initial_precomputed_;
159
161 };
162
163} /* namespace ryujin */
InitialPrecomputedVector interpolate_initial_precomputed_vector() const
InitialValues(const HyperbolicSystem &hyperbolic_system, const OfflineData< dim, Number > &offline_data, const std::string &subsection="/InitialValues")
typename View::initial_precomputed_type initial_precomputed_type
typename View::InitialPrecomputedVector InitialPrecomputedVector
static constexpr auto problem_dimension
typename Description::HyperbolicSystem HyperbolicSystem
typename Description::template HyperbolicSystemView< dim, Number > View
static constexpr auto n_initial_precomputed_values
HyperbolicVector interpolate_hyperbolic_vector(Number t=0) const
typename View::HyperbolicVector HyperbolicVector
DEAL_II_ALWAYS_INLINE state_type initial_state(const dealii::Point< dim > &point, Number t) const
DEAL_II_ALWAYS_INLINE initial_precomputed_type initial_precomputed(const dealii::Point< dim > &point) const
typename View::state_type state_type
Euler::HyperbolicSystem HyperbolicSystem
Definition: description.h:32