TestHelpers.hpp
Go to the documentation of this file.
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 /// \file
5 /// Defines functions useful for testing general relativity
6 
7 #pragma once
8 
9 #include <cstddef>
10 #include <random>
11 
13 
14 /// \cond
15 namespace gsl {
16 template <typename T>
17 class not_null;
18 } // namespace gsl
19 /// \endcond
20 
21 namespace TestHelpers {
22 /// \ingroup TestingFrameworkGroup
23 /// \brief Make random GR variables which correct physical behavior,
24 /// e.g. spatial metric will be positive definite
25 namespace gr {
26 template <typename DataType>
27 Scalar<DataType> random_lapse(gsl::not_null<std::mt19937*> generator,
28  const DataType& used_for_size) noexcept;
29 
30 template <size_t Dim, typename DataType>
31 tnsr::I<DataType, Dim> random_shift(gsl::not_null<std::mt19937*> generator,
32  const DataType& used_for_size) noexcept;
33 
34 template <size_t Dim, typename DataType>
35 tnsr::ii<DataType, Dim> random_spatial_metric(
37  const DataType& used_for_size) noexcept;
38 } // namespace gr
39 } // namespace TestHelpers
Definition: TestCreation.hpp:14
Implementations from the Guideline Support Library.
Definition: Gsl.hpp:79
Holds functions related to general relativity.
Definition: GaugeWave.hpp:27
Defines a list of useful type aliases for tensors.
Tensor< T, Symmetry<>, index_list<> > Scalar
Scalar type.
Definition: TypeAliases.hpp:21
Require a pointer to not be a nullptr
Definition: Gsl.hpp:182