TestHelpers.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <random>
7 
9 
10 /// \cond
11 namespace gsl {
12 template <typename T>
13 class not_null;
14 } // namespace gsl
15 /// \endcond
16 
17 namespace TestHelpers {
18 /// \ingroup TestingFrameworkGroup
19 /// \brief Make random hydro variables which correct physical behavior,
20 /// e.g. Lorentz factor will be greater or equal than one.
21 namespace hydro {
22 template <typename DataType>
23 Scalar<DataType> random_density(gsl::not_null<std::mt19937*> generator,
24  const DataType& used_for_size) noexcept;
25 
26 template <typename DataType>
27 Scalar<DataType> random_lorentz_factor(gsl::not_null<std::mt19937*> generator,
28  const DataType& used_for_size) noexcept;
29 
30 template <typename DataType, size_t Dim>
31 tnsr::I<DataType, Dim> random_velocity(
33  const Scalar<DataType>& lorentz_factor,
34  const tnsr::ii<DataType, Dim>& spatial_metric) noexcept;
35 
36 template <typename DataType>
37 Scalar<DataType> random_temperature(gsl::not_null<std::mt19937*> generator,
38  const DataType& used_for_size) noexcept;
39 
40 template <typename DataType>
41 Scalar<DataType> random_specific_internal_energy(
43  const DataType& used_for_size) noexcept;
44 
45 template <typename DataType>
46 tnsr::I<DataType, 3> random_magnetic_field(
47  gsl::not_null<std::mt19937*> generator, const Scalar<DataType>& pressure,
48  const tnsr::ii<DataType, 3>& spatial_metric) noexcept;
49 
50 template <typename DataType>
51 Scalar<DataType> random_divergence_cleaning_field(
53  const DataType& used_for_size) noexcept;
54 } // namespace hydro
55 } // namespace TestHelpers
Definition: TestCreation.hpp:14
Implementations from the Guideline Support Library.
Definition: Gsl.hpp:79
tnsr::ii< DataType, SpatialDim, Frame > spatial_metric(const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric) noexcept
Compute spatial metric from spacetime metric.
Defines a list of useful type aliases for tensors.
Items related to hydrodynamic systems.
Definition: LorentzFactor.hpp:20
Tensor< T, Symmetry<>, index_list<> > Scalar
Scalar type.
Definition: TypeAliases.hpp:21
Require a pointer to not be a nullptr
Definition: Gsl.hpp:182