ryujin 2.1.1 revision ee5cbcbf2346c1299c942d0e1f13b46449973c18
Loading...
Searching...
No Matches
hyperbolic_system.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
11
12#include <convenience_macros.h>
13#include <discretization.h>
14#include <loop.h>
16#include <patterns_conversion.h>
17#include <simd.h>
18#include <state_vector.h>
19
20#include <deal.II/base/parameter_acceptor.h>
21#include <deal.II/base/tensor.h>
22
23#include <array>
24
25namespace ryujin
26{
27 namespace EulerBarotropic
28 {
29 /*
30 * For various divisions in the barotropic equation of state module we
31 * have a mathematical guarantee that the numerator and denominator are
32 * nonnegative and the limit (of zero numerator and denominator) must
33 * converge to zero. The following function takes care of rounding
34 * issues when computing such quotients by (a) avoiding division by
35 * zero and (b) ensuring non-negativity of the result.
36 */
37 template <typename Number>
38 DEAL_II_ALWAYS_INLINE inline Number safe_division(const Number &numerator,
39 const Number &denominator)
40 {
41 using ScalarNumber = typename get_value_type<Number>::type;
42 constexpr ScalarNumber min = std::numeric_limits<ScalarNumber>::min();
43
44 return std::max(numerator, Number(0.)) /
45 std::max(denominator, Number(min));
46 }
47
48
49 template <int dim, typename Number>
51
65 class HyperbolicSystem final : public dealii::ParameterAcceptor
66 {
67 public:
71 static inline std::string problem_name =
72 "Compressible Euler equations (barotropic EOS, optimized barotropic)";
73
77 HyperbolicSystem(const std::string &subsection = "/HyperbolicSystem");
78
83 template <int dim, typename Number = double>
85
92 template <int dim, typename Number>
93 auto view() const
94 {
95 return View<dim, Number>{*this};
96 }
97
106 template <int dim, typename ScalarNumber>
108 const OfflineData<dim, ScalarNumber> &offline_data,
110 &state_vector,
111 const bool skip_constrained_dofs = true) const;
112
113 private:
118
119 std::string barotropic_equation_of_state_;
120
121 double reference_density_;
122 double vacuum_state_relaxation_small_;
123 double vacuum_state_relaxation_large_;
124
126
130
132 barotropic_equation_of_state_list_;
133
134 using BarotropicEquationOfState =
136 std::shared_ptr<BarotropicEquationOfState>
137 selected_barotropic_equation_of_state_;
138
139 template <int dim, typename Number>
141
143 }; /* HyperbolicSystem */
144
145
164 template <int dim, typename Number>
166 {
167 public:
172
177
181 static constexpr unsigned int problem_dimension = 1 + dim;
182
186 using state_type = dealii::Tensor<1, problem_dimension, Number>;
187
191 using flux_type =
192 dealii::Tensor<1, problem_dimension, dealii::Tensor<1, dim, Number>>;
193
198
203 static inline const auto component_names =
204 []() -> std::array<std::string, problem_dimension> {
205 if constexpr (dim == 1)
206 return {"rho", "m"};
207 else if constexpr (dim == 2)
208 return {"rho", "m_1", "m_2"};
209 else if constexpr (dim == 3)
210 return {"rho", "m_1", "m_2", "m_3"};
211 __builtin_trap();
212 }();
213
218 static inline const auto primitive_component_names =
219 []() -> std::array<std::string, problem_dimension> {
220 if constexpr (dim == 1)
221 return {"rho", "v"};
222 else if constexpr (dim == 2)
223 return {"rho", "v_1", "v_2"};
224 else if constexpr (dim == 3)
225 return {"rho", "v_1", "v_2", "v_3"};
226 __builtin_trap();
227 }();
228
232 static constexpr unsigned int n_precomputed_values = 3;
233
237 using precomputed_type = std::array<Number, n_precomputed_values>;
238
242 static inline const auto precomputed_names =
243 std::array<std::string, n_precomputed_values>{{"e", "p", "a"}};
244
248 static constexpr unsigned int n_initial_precomputed_values = 0;
249
254 std::array<Number, n_initial_precomputed_values>;
255
259 static inline const auto initial_precomputed_names =
260 std::array<std::string, n_initial_precomputed_values>{};
261
265 using StateVector = Vectors::
266 StateVector<ScalarNumber, problem_dimension, n_precomputed_values>;
267
273
279
287 dealii::VectorizedArray<ScalarNumber>::size(),
288 dealii::MemorySpace::Host,
289 /*writable=*/false>;
290
298
306 dealii::VectorizedArray<ScalarNumber>::size(),
307 dealii::MemorySpace::Host,
308 /*writable=*/false>;
309
311
315
320 HyperbolicSystemView(const HyperbolicSystem &hyperbolic_system)
321 : hyperbolic_system_(hyperbolic_system)
322 {
323 }
324
326
330
331 DEAL_II_ALWAYS_INLINE inline const std::string &
333 {
334 return hyperbolic_system_.barotropic_equation_of_state_;
335 }
336
337 DEAL_II_ALWAYS_INLINE inline ScalarNumber reference_density() const
338 {
339 return hyperbolic_system_.reference_density_;
340 }
341
342 DEAL_II_ALWAYS_INLINE inline ScalarNumber
344 {
345 return hyperbolic_system_.vacuum_state_relaxation_small_;
346 }
347
348 DEAL_II_ALWAYS_INLINE inline ScalarNumber
350 {
351 return hyperbolic_system_.vacuum_state_relaxation_large_;
352 }
353
355
359
364 DEAL_II_ALWAYS_INLINE inline Number
365 beos_specific_internal_energy(const Number &rho) const
366 {
367 const auto &beos =
368 hyperbolic_system_.selected_barotropic_equation_of_state_;
369
370 if constexpr (std::is_same_v<ScalarNumber, Number>) {
371 return ScalarNumber(beos->specific_internal_energy(rho));
372 } else {
373 Number e;
374 for (unsigned int k = 0; k < Number::size(); ++k) {
375 e[k] = ScalarNumber(beos->specific_internal_energy(rho[k]));
376 }
377 return e;
378 }
379 }
380
384 DEAL_II_ALWAYS_INLINE inline Number beos_pressure(const Number &rho) const
385 {
386 const auto &beos =
387 hyperbolic_system_.selected_barotropic_equation_of_state_;
388
389 if constexpr (std::is_same_v<ScalarNumber, Number>) {
390 return ScalarNumber(beos->pressure(rho));
391 } else {
392 Number p;
393 for (unsigned int k = 0; k < Number::size(); ++k) {
394 p[k] = ScalarNumber(beos->pressure(rho[k]));
395 }
396 return p;
397 }
398 }
399
404 DEAL_II_ALWAYS_INLINE inline Number
405 beos_speed_of_sound(const Number &rho) const
406 {
407 const auto &beos =
408 hyperbolic_system_.selected_barotropic_equation_of_state_;
409
410 if constexpr (std::is_same_v<ScalarNumber, Number>) {
411 return ScalarNumber(beos->speed_of_sound(rho));
412 } else {
413 Number a;
414 for (unsigned int k = 0; k < Number::size(); ++k) {
415 a[k] = ScalarNumber(beos->speed_of_sound(rho[k]));
416 }
417 return a;
418 }
419 }
420
422
426
427 static constexpr bool have_gamma = false;
428 static constexpr bool have_covolume_constant = false;
429 static constexpr bool have_energy_equation = false;
430
432
436
441 static Number density(const state_type &U);
442
449 Number filter_vacuum_density(const Number &rho) const;
450
455 static dealii::Tensor<1, dim, Number> momentum(const state_type &U);
456
464 Number total_energy(const state_type &U,
465 const Number &specific_internal_energy) const;
466
473 const Number &specific_internal_energy,
474 const Number &pressure) const;
475
481 bool is_admissible(const state_type &U) const;
482
484
488
495 template <int component>
497 const state_type &U,
498 const Number &p,
499 const state_type &U_bar,
500 const Number &p_bar,
501 const dealii::Tensor<1, dim, Number> &normal) const;
502
521 template <typename Lambda>
523 apply_boundary_conditions(const dealii::types::boundary_id id,
524 const state_type &U,
525 const dealii::Tensor<1, dim, Number> &normal,
526 const Lambda &get_dirichlet_data) const;
527
529
533
543 flux_type f(const state_type &U, const Number &p) const;
544
567 const unsigned int i,
568 const state_type &U_i) const;
569
573 const unsigned int *js,
574 const state_type &U_j) const;
575
582 const flux_contribution_type &flux_j,
583 const dealii::Tensor<1, dim, Number> &c_ij) const;
584
588 static constexpr bool have_high_order_flux = false;
589
591 const flux_contribution_type &flux_i,
592 const flux_contribution_type &flux_j,
593 const dealii::Tensor<1, dim, Number> &c_ij) const = delete;
594
596
600
602 static constexpr bool have_source_terms = false;
603
605 const unsigned int i,
606 const state_type &U_i,
607 const ScalarNumber tau) const = delete;
608
610 const unsigned int *js,
611 const state_type &U_j,
612 const ScalarNumber tau) const = delete;
613
615
619
630 template <typename ST>
631 state_type expand_state(const ST &state) const;
632
645 template <typename ST>
646 state_type from_initial_state(const ST &initial_state) const;
647
652 state_type from_primitive_state(const state_type &primitive_state) const;
653
657 state_type to_primitive_state(const state_type &state) const;
658
664 template <typename Lambda>
666 const Lambda &lambda) const;
667
668 private:
670
674
675 const HyperbolicSystem &hyperbolic_system_;
676
678 }; /* HyperbolicSystemView */
679
680
681 /*
682 * -------------------------------------------------------------------------
683 * Inline definitions
684 * -------------------------------------------------------------------------
685 */
686
687
689 const std::string &subsection /*= "HyperbolicSystem"*/)
690 : ParameterAcceptor(subsection)
691 {
692 barotropic_equation_of_state_ = "isothermal";
693 add_parameter("barotropic equation of state",
694 barotropic_equation_of_state_,
695 "The barotropic equation of state. Valid names are given "
696 "by any of the subsections defined below");
697
698 reference_density_ = 1.;
699 add_parameter("reference density",
700 reference_density_,
701 "Problem specific density reference");
702
703 vacuum_state_relaxation_small_ = 1.e2;
704 add_parameter("vacuum state relaxation small",
705 vacuum_state_relaxation_small_,
706 "Problem specific vacuum relaxation parameter");
707
708 vacuum_state_relaxation_large_ = 1.e4;
709 add_parameter("vacuum state relaxation large",
710 vacuum_state_relaxation_large_,
711 "Problem specific vacuum relaxation parameter");
712
713 /*
714 * And finally populate the equation of state list with all equation of
715 * state configurations defined in the EquationOfState namespace:
716 */
718 barotropic_equation_of_state_list_, subsection);
719
720 const auto populate_functions = [this]() {
721 bool initialized = false;
722 for (auto &it : barotropic_equation_of_state_list_)
723
724 /* Populate EOS-specific quantities and functions */
725 if (it->name() == barotropic_equation_of_state_) {
726 selected_barotropic_equation_of_state_ = it;
727 problem_name = "Compressible Euler equations (" + it->name() +
728 " EOS, optimized barotropic)";
729 initialized = true;
730 break;
731 }
732
733 AssertThrow(initialized,
734 dealii::ExcMessage("Could not find a barotropic equation "
735 "of state description with name \"" +
736 barotropic_equation_of_state_ + "\""));
737 };
738
739 ParameterAcceptor::parse_parameters_call_back.connect(populate_functions);
740 populate_functions();
741 }
742
743
744 template <int dim, typename ScalarNumber>
746 const OfflineData<dim, ScalarNumber> &offline_data,
748 &state_vector,
749 const bool skip_constrained_dofs) const
750 {
751 const unsigned int n_internal = offline_data.n_locally_internal();
752 const unsigned int n_owned = offline_data.n_locally_owned();
753 const auto sparsity_simd_view =
754 offline_data.sparsity_pattern_simd().view();
755 using VA = dealii::VectorizedArray<ScalarNumber>;
756
757 const auto U_view = std::get<0>(state_vector).view();
758 const auto precomputed_view = std::get<1>(state_vector).view();
759
760 const auto body = [&](auto sentinel, unsigned int i) {
761 using T = decltype(sentinel);
763 using precomputed_type = typename View::precomputed_type;
764
765 const unsigned int row_length = sparsity_simd_view.row_length(i);
766 if (skip_constrained_dofs && row_length == 1)
767 return;
768
769 const auto U_i = U_view.template read_tensor<T>(i);
770 const auto view = this->view<dim, T>();
771 const auto rho_i = view.density(U_i);
772
773 const auto e_i = view.beos_specific_internal_energy(rho_i);
774 const auto p_i = view.beos_pressure(rho_i);
775 const auto a_i = view.beos_speed_of_sound(rho_i);
776
777 const precomputed_type prec_i{e_i, p_i, a_i};
778 precomputed_view.template write_tensor<T>(prec_i, i);
779 };
780
781 cpu_simd_loop<ScalarNumber>("time_step_1", body, 0, n_internal, n_owned);
782 }
783
784
785 template <int dim, typename Number>
786 DEAL_II_ALWAYS_INLINE inline Number
788 {
789 return U[0];
790 }
791
792
793 template <int dim, typename Number>
794 DEAL_II_ALWAYS_INLINE inline Number
796 const Number &rho) const
797 {
798 constexpr ScalarNumber eps = std::numeric_limits<ScalarNumber>::epsilon();
799 const Number rho_cutoff_large =
800 reference_density() * vacuum_state_relaxation_large() * eps;
801
802 return dealii::compare_and_apply_mask<dealii::SIMDComparison::less_than>(
803 std::abs(rho), rho_cutoff_large, Number(0.), rho);
804 }
805
806
807 template <int dim, typename Number>
808 DEAL_II_ALWAYS_INLINE inline dealii::Tensor<1, dim, Number>
810 {
811 dealii::Tensor<1, dim, Number> result;
812 for (unsigned int i = 0; i < dim; ++i)
813 result[i] = U[1 + i];
814 return result;
815 }
816
817
818 template <int dim, typename Number>
819 DEAL_II_ALWAYS_INLINE inline Number
821 const state_type &U, const Number &specific_internal_energy) const
822 {
823 const auto rho = density(U);
824 const auto rho_inverse = ScalarNumber(1.) / rho;
825 const auto m = momentum(U);
826
827 return rho * specific_internal_energy +
828 ScalarNumber(0.5) * rho_inverse * m.norm_square();
829 }
830
831
832 template <int dim, typename Number>
833 DEAL_II_ALWAYS_INLINE inline auto
835 const state_type &U,
836 const Number &specific_internal_energy,
837 const Number &pressure) const -> state_type
838 {
839 const auto rho = density(U);
840 const auto rho_inverse = ScalarNumber(1.) / rho;
841 const auto m = momentum(U);
842
843 state_type result;
844
845 result[0] =
846 specific_internal_energy + rho_inverse * pressure -
847 ScalarNumber(0.5) * rho_inverse * rho_inverse * m.norm_square();
848 for (unsigned int i = 0; i < dim; ++i)
849 result[1 + i] = rho_inverse * m[i];
850
851 return result;
852 }
853
854
855 template <int dim, typename Number>
856 DEAL_II_ALWAYS_INLINE inline bool
858 {
859 const auto rho = density(U);
860 constexpr auto gt = dealii::SIMDComparison::greater_than;
861 using T = Number;
862 const auto test =
863 dealii::compare_and_apply_mask<gt>(rho, T(0.), T(0.), T(-1.));
864
865#ifdef DEBUG_OUTPUT
866 if (!(test == Number(0.))) {
867 std::cout << std::fixed << std::setprecision(16);
868 std::cout << "Bounds violation: Negative state [rho, e] detected!\n";
869 std::cout << "\t\trho: " << rho << "\n";
870 }
871#endif
872
873 return (test == Number(0.));
874 }
875
876
877 template <int dim, typename Number>
878 template <int component>
879 DEAL_II_ALWAYS_INLINE inline auto
881 const state_type & /*U*/,
882 const Number & /*p*/,
883 const state_type & /*U_bar*/,
884 const Number & /*p_bar*/,
885 const dealii::Tensor<1, dim, Number> & /*normal*/) const -> state_type
886 {
887 // FIXME
888 AssertThrow(false, dealii::ExcNotImplemented());
889 __builtin_trap();
890 return state_type{};
891 }
892
893
894 template <int dim, typename Number>
895 template <typename Lambda>
896 DEAL_II_ALWAYS_INLINE inline auto
898 dealii::types::boundary_id id,
899 const state_type &U,
900 const dealii::Tensor<1, dim, Number> &normal,
901 const Lambda &get_dirichlet_data) const -> state_type
902 {
903 state_type result = U;
904
905 if (id == Boundary::dirichlet) {
906 result = get_dirichlet_data();
907
908 } else if (id == Boundary::dirichlet_momentum) {
909 /* Only enforce Dirichlet conditions on the momentum: */
910 auto m_dirichlet = momentum(get_dirichlet_data());
911 for (unsigned int k = 0; k < dim; ++k)
912 result[k + 1] = m_dirichlet[k];
913
914 } else if (id == Boundary::dirichlet_velocity) {
915 /* Only enforce Dirichlet conditions on the velocity: */
916 const auto U_dirichlet = get_dirichlet_data();
917 const auto rho_dirichlet = density(U_dirichlet);
918 const auto v_dirichlet = momentum(U_dirichlet) / rho_dirichlet;
919 const auto rho = density(result);
920 for (unsigned int k = 0; k < dim; ++k)
921 result[k + 1] = rho * v_dirichlet[k];
922
923 } else if (id == Boundary::slip) {
924 auto m = momentum(U);
925 m -= 1. * (m * normal) * normal;
926 for (unsigned int k = 0; k < dim; ++k)
927 result[k + 1] = m[k];
928
929 } else if (id == Boundary::no_slip) {
930 for (unsigned int k = 0; k < dim; ++k)
931 result[k + 1] = Number(0.);
932
933 } else if (id == Boundary::dynamic) {
934 /*
935 * On dynamic boundary conditions, we distinguish four cases:
936 *
937 * - supersonic inflow: prescribe full state
938 * - subsonic inflow:
939 * decompose into Riemann invariants and leave R_2
940 * characteristic untouched.
941 * - supersonic outflow: do nothing
942 * - subsonic outflow:
943 * decompose into Riemann invariants and prescribe incoming
944 * R_1 characteristic.
945 */
946 const auto m = momentum(U);
947 const auto rho = density(U);
948
949 /*
950 * We do not have precomputed values available. Thus, simply query
951 * the pressure and speed of sound oracle:
952 */
953 const auto p = beos_pressure(rho);
954 const auto a = beos_speed_of_sound(rho);
955 const auto vn = m * normal / rho;
956
957 /* Supersonic inflow: */
958 if (vn < -a) {
959 result = get_dirichlet_data();
960 }
961
962 /* Subsonic inflow: */
963 if (vn >= -a && vn <= 0.) {
964 const auto U_dirichlet = get_dirichlet_data();
965 const auto rho_dirichlet = density(U_dirichlet);
966 const auto p_dirichlet = beos_pressure(rho_dirichlet);
967
968 result = prescribe_riemann_characteristic<2>(
969 U_dirichlet, p_dirichlet, U, p, normal);
970 }
971
972 /* Subsonic outflow: */
973 if (vn > 0. && vn <= a) {
974 const auto U_dirichlet = get_dirichlet_data();
975 const auto rho_dirichlet = density(U_dirichlet);
976 const auto p_dirichlet = beos_pressure(rho_dirichlet);
977
978 result = prescribe_riemann_characteristic<1>(
979 U, p, U_dirichlet, p_dirichlet, normal);
980 }
981 /* Supersonic outflow: do nothing, i.e., keep U as is */
982
983 } else {
984 AssertThrow(false, dealii::ExcNotImplemented());
985 }
986
987 return result;
988 }
989
990
991 template <int dim, typename Number>
992 DEAL_II_ALWAYS_INLINE inline auto
994 const Number &p) const -> flux_type
995 {
996 const auto rho_inverse = ScalarNumber(1.) / density(U);
997 const auto m = momentum(U);
998
999 flux_type result;
1000
1001 result[0] = m;
1002 for (unsigned int i = 0; i < dim; ++i) {
1003 result[1 + i] = m * (m[i] * rho_inverse);
1004 result[1 + i][i] += p;
1005 }
1006
1007 return result;
1008 }
1009
1010
1011 template <int dim, typename Number>
1012 DEAL_II_ALWAYS_INLINE inline auto
1014 const PrecomputedVectorView &pv,
1015 const InitialPrecomputedVectorView & /*piv*/,
1016 const unsigned int i,
1017 const state_type &U_i) const -> flux_contribution_type
1018 {
1019 const auto &[e_i, p_i, a_i] =
1020 pv.template read_tensor<Number, precomputed_type>(i);
1021 return f(U_i, p_i);
1022 }
1023
1024
1025 template <int dim, typename Number>
1026 DEAL_II_ALWAYS_INLINE inline auto
1028 const PrecomputedVectorView &pv,
1029 const InitialPrecomputedVectorView & /*piv*/,
1030 const unsigned int *js,
1031 const state_type &U_j) const -> flux_contribution_type
1032 {
1033 const auto &[e_j, p_j, a_j] =
1034 pv.template read_tensor<Number, precomputed_type>(js);
1035 return f(U_j, p_j);
1036 }
1037
1038
1039 template <int dim, typename Number>
1040 DEAL_II_ALWAYS_INLINE inline auto
1042 const flux_contribution_type &flux_i,
1043 const flux_contribution_type &flux_j,
1044 const dealii::Tensor<1, dim, Number> &c_ij) const -> state_type
1045 {
1046 return -contract(add(flux_i, flux_j), c_ij);
1047 }
1048
1049
1050 template <int dim, typename Number>
1051 template <typename ST>
1053 -> state_type
1054 {
1055 using T = typename ST::value_type;
1056 static_assert(std::is_same_v<Number, T>, "template mismatch");
1057
1058 constexpr auto dim2 = ST::dimension - 1;
1059 static_assert(dim >= dim2,
1060 "the space dimension of the argument state must not be "
1061 "larger than the one of the target state");
1062
1063 state_type result;
1064 result[0] = state[0];
1065 for (unsigned int i = 1; i < dim2 + 1; ++i)
1066 result[i] = state[i];
1067
1068 return result;
1069 }
1070
1071
1072 template <int dim, typename Number>
1073 template <typename ST>
1074 DEAL_II_ALWAYS_INLINE inline auto
1076 const ST &initial_state) const -> state_type
1077 {
1078 const auto primitive_state = expand_state(initial_state);
1079 return from_primitive_state(primitive_state);
1080 }
1081
1082
1083 template <int dim, typename Number>
1084 DEAL_II_ALWAYS_INLINE inline auto
1086 const state_type &primitive_state) const -> state_type
1087 {
1088 const auto rho = density(primitive_state);
1089
1090 auto state = primitive_state;
1091 /* Fix up momentum: */
1092 for (unsigned int i = 1; i < dim + 1; ++i)
1093 state[i] *= rho;
1094
1095 return state;
1096 }
1097
1098
1099 template <int dim, typename Number>
1100 DEAL_II_ALWAYS_INLINE inline auto
1102 const state_type &state) const -> state_type
1103 {
1104 const auto rho = density(state);
1105 const auto rho_inverse = Number(1.) / rho;
1106
1107 auto primitive_state = state;
1108 /* Fix up velocity: */
1109 for (unsigned int i = 1; i < dim + 1; ++i)
1110 primitive_state[i] *= rho_inverse;
1111
1112 return primitive_state;
1113 }
1114
1115
1116 template <int dim, typename Number>
1117 template <typename Lambda>
1119 const state_type &state, const Lambda &lambda) const -> state_type
1120 {
1121 auto result = state;
1122 const auto M = lambda(momentum(state));
1123 for (unsigned int d = 0; d < dim; ++d)
1124 result[1 + d] = M[d];
1125 return result;
1126 }
1127 } // namespace EulerBarotropic
1128} // namespace ryujin
state_type from_primitive_state(const state_type &primitive_state) const
std::array< Number, n_precomputed_values > precomputed_type
DEAL_II_ALWAYS_INLINE Number beos_speed_of_sound(const Number &rho) const
dealii::Tensor< 1, problem_dimension, dealii::Tensor< 1, dim, Number > > flux_type
dealii::Tensor< 1, problem_dimension, Number > state_type
DEAL_II_ALWAYS_INLINE const std::string & barotropic_equation_of_state() const
state_type apply_galilei_transform(const state_type &state, const Lambda &lambda) const
static constexpr unsigned int problem_dimension
Vectors::StateVector< ScalarNumber, problem_dimension, n_precomputed_values > StateVector
DEAL_II_ALWAYS_INLINE Number beos_pressure(const Number &rho) const
typename get_value_type< Number >::type ScalarNumber
state_type nodal_source(const PrecomputedVectorView &pv, const unsigned int *js, const state_type &U_j, const ScalarNumber tau) const =delete
state_type prescribe_riemann_characteristic(const state_type &U, const Number &p, const state_type &U_bar, const Number &p_bar, const dealii::Tensor< 1, dim, Number > &normal) const
std::array< Number, n_initial_precomputed_values > initial_precomputed_type
DEAL_II_ALWAYS_INLINE Number beos_specific_internal_energy(const Number &rho) const
static Number density(const state_type &U)
HyperbolicSystemView(const HyperbolicSystem &hyperbolic_system)
Number filter_vacuum_density(const Number &rho) const
flux_type f(const state_type &U, const Number &p) const
state_type total_energy_derivative(const state_type &U, const Number &specific_internal_energy, const Number &pressure) const
DEAL_II_ALWAYS_INLINE ScalarNumber vacuum_state_relaxation_large() const
DEAL_II_ALWAYS_INLINE ScalarNumber vacuum_state_relaxation_small() const
DEAL_II_ALWAYS_INLINE ScalarNumber reference_density() const
state_type expand_state(const ST &state) const
static constexpr unsigned int n_initial_precomputed_values
flux_contribution_type flux_contribution(const PrecomputedVectorView &pv, const InitialPrecomputedVectorView &piv, const unsigned int i, const state_type &U_i) const
static constexpr unsigned int n_precomputed_values
state_type flux_divergence(const flux_contribution_type &flux_i, const flux_contribution_type &flux_j, const dealii::Tensor< 1, dim, Number > &c_ij) const
state_type nodal_source(const PrecomputedVectorView &pv, const unsigned int i, const state_type &U_i, const ScalarNumber tau) const =delete
state_type from_initial_state(const ST &initial_state) const
state_type high_order_flux_divergence(const flux_contribution_type &flux_i, const flux_contribution_type &flux_j, const dealii::Tensor< 1, dim, Number > &c_ij) const =delete
state_type to_primitive_state(const state_type &state) const
Number total_energy(const state_type &U, const Number &specific_internal_energy) const
state_type apply_boundary_conditions(const dealii::types::boundary_id id, const state_type &U, const dealii::Tensor< 1, dim, Number > &normal, const Lambda &get_dirichlet_data) const
bool is_admissible(const state_type &U) const
static dealii::Tensor< 1, dim, Number > momentum(const state_type &U)
void fill_precomputed_values(const OfflineData< dim, ScalarNumber > &offline_data, typename HyperbolicSystemView< dim, ScalarNumber >::StateVector &state_vector, const bool skip_constrained_dofs=true) const
HyperbolicSystem(const std::string &subsection="/HyperbolicSystem")
dealii::Tensor< 1, problem_dimension, Number > state_type
const auto & n_locally_owned() const
const auto & sparsity_pattern_simd() const
const auto & n_locally_internal() const
void populate_equation_of_state_list(equation_of_state_list_type &equation_of_state_list, const std::string &subsection)
@ dirichlet_momentum
@ dirichlet_velocity
DEAL_II_HOST_DEVICE_ALWAYS_INLINE dealii::Tensor< 1, problem_dim, T > contract(const FT &flux_ij, const TT &c_ij)
DEAL_II_HOST_DEVICE_ALWAYS_INLINE FT add(const FT &flux_left_ij, const FT &flux_right_ij)
std::set< std::shared_ptr< BarotropicEquationOfState > > equation_of_state_list_type
DEAL_II_ALWAYS_INLINE Number safe_division(const Number &numerator, const Number &denominator)