11 #include "Evolution/Systems/NewtonianEuler/Sources/NoSource.hpp"
12 #include "Evolution/Systems/NewtonianEuler/Tags.hpp"
14 #include "PointwiseFunctions/AnalyticSolutions/AnalyticSolution.hpp"
15 #include "PointwiseFunctions/AnalyticSolutions/Hydro/SmoothFlow.hpp"
16 #include "PointwiseFunctions/Hydro/EquationsOfState/IdealFluid.hpp"
17 #include "PointwiseFunctions/Hydro/Tags.hpp"
20 #include "Utilities/TaggedTuple.hpp"
53 class SmoothFlow :
virtual public MarkAsAnalyticSolution,
58 using options =
typename smooth_flow::options;
61 "Smooth density wave advecting across a domain."};
63 SmoothFlow() =
default;
64 SmoothFlow(
const SmoothFlow& ) =
delete;
65 SmoothFlow& operator=(
const SmoothFlow& ) =
delete;
66 SmoothFlow(SmoothFlow&& ) noexcept = default;
67 SmoothFlow& operator=(SmoothFlow&& ) noexcept = default;
68 ~SmoothFlow() = default;
70 SmoothFlow(const std::array<
double, Dim>& mean_velocity,
71 const std::array<
double, Dim>& wavevector,
double pressure,
72 double adiabatic_index,
double perturbation_size) noexcept;
74 explicit SmoothFlow(CkMigrateMessage* msg) noexcept;
76 using smooth_flow::equation_of_state;
77 using typename smooth_flow::equation_of_state_type;
78 using source_term_type = Sources::NoSource;
81 using smooth_flow::variables;
83 template <typename DataType>
84 tuples::TaggedTuple<Tags::MassDensity<DataType>> variables(
85 const
tnsr::I<DataType, Dim>& x, const
double t,
86 tmpl::list<Tags::MassDensity<DataType>> ) const noexcept {
87 return {tuples::get<hydro::Tags::RestMassDensity<DataType>>(
91 template <
typename DataType>
93 const tnsr::I<DataType, Dim>& x,
const double t,
94 tmpl::list<Tags::Velocity<DataType, Dim>> ) const noexcept {
95 return {tuples::get<hydro::Tags::SpatialVelocity<DataType, Dim>>(variables(
99 template <
typename DataType>
101 const tnsr::I<DataType, Dim>& x,
const double t,
102 tmpl::list<Tags::Pressure<DataType>> ) const noexcept {
103 return {tuples::get<hydro::Tags::Pressure<DataType>>(
107 template <
typename DataType>
109 const tnsr::I<DataType, Dim>& x,
const double t,
110 tmpl::list<Tags::SpecificInternalEnergy<DataType>> )
113 tuples::get<hydro::Tags::SpecificInternalEnergy<DataType>>(variables(
119 template <
typename DataType,
typename... Tags>
121 const tnsr::I<DataType, Dim>& x,
const double t,
122 tmpl::list<Tags...> )
const noexcept {
123 static_assert(
sizeof...(Tags) > 1,
124 "The generic template will recurse infinitely if only one "
125 "tag is being retrieved.");
126 return {tuples::get<Tags>(variables(x, t, tmpl::list<Tags>{}))...};
130 void pup(PUP::er& ) noexcept;
133 template <
size_t SpatialDim>
140 template <
size_t Dim>
141 bool operator!=(
const SmoothFlow<Dim>& lhs,
142 const SmoothFlow<Dim>& rhs) noexcept;