Minkowski.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 
10 #include "Options/Options.hpp"
11 #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
12 #include "Utilities/TMPL.hpp"
14 
15 // IWYU pragma: no_forward_declare Tags::deriv
16 
17 /// \cond
18 namespace PUP {
19 class er;
20 } // namespace PUP
21 namespace Tags {
22 template <typename Tag>
23 struct dt;
24 } // namespace Tags
25 /// \endcond
26 
27 namespace gr {
28 namespace Solutions {
29 
30 /*!
31  * \brief The Minkowski solution for flat space in Dim spatial dimensions.
32  *
33  * \details The solution has lapse \f$N(x,t)= 1 \f$, shift \f$N^i(x,t) = 0 \f$
34  * and the identity as the spatial metric: \f$g_{ii} = 1 \f$
35  */
36 template <size_t Dim>
37 class Minkowski {
38  public:
39  using options = tmpl::list<>;
40  static constexpr OptionString help{
41  "Minkowski solution to Einstein's Equations"};
42 
43  Minkowski() = default;
44  Minkowski(const Minkowski& /*rhs*/) = delete;
45  Minkowski& operator=(const Minkowski& /*rhs*/) = delete;
46  Minkowski(Minkowski&& /*rhs*/) noexcept = default;
47  Minkowski& operator=(Minkowski&& /*rhs*/) noexcept = default;
48  ~Minkowski() = default;
49 
50  template <typename DataType>
51  using DerivLapse = ::Tags::deriv<gr::Tags::Lapse<DataType>, tmpl::size_t<Dim>,
53  template <typename DataType>
54  using DerivShift =
55  ::Tags::deriv<gr::Tags::Shift<Dim, Frame::Inertial, DataType>,
56  tmpl::size_t<Dim>, Frame::Inertial>;
57  template <typename DataType>
58  using DerivSpatialMetric =
59  ::Tags::deriv<gr::Tags::SpatialMetric<Dim, Frame::Inertial, DataType>,
60  tmpl::size_t<Dim>, Frame::Inertial>;
61  template <typename DataType>
62  using tags = tmpl::list<
66  DerivShift<DataType>,
69  DerivSpatialMetric<DataType>>;
70 
71  template <typename DataType, typename... Tags>
72  tuples::TaggedTuple<Tags...> variables(const tnsr::I<DataType, Dim>& x,
73  double t,
74  tmpl::list<Tags...> /*meta*/) const
75  noexcept {
76  static_assert(sizeof...(Tags) > 1,
77  "Unrecognized tag requested. See the function parameters "
78  "for the tag.");
79  return {get<Tags>(variables(x, t, tmpl::list<Tags>{}))...};
80  }
81 
82  template <typename DataType>
84  const tnsr::I<DataType, Dim>& x, double t,
85  tmpl::list<gr::Tags::Lapse<DataType>> /*meta*/) const noexcept;
86 
87  template <typename DataType>
89  const tnsr::I<DataType, Dim>& x, double t,
90  tmpl::list<::Tags::dt<gr::Tags::Lapse<DataType>>> /*meta*/) const
91  noexcept;
92 
93  template <typename DataType>
95  tmpl::size_t<Dim>, Frame::Inertial>>
96  variables(
97  const tnsr::I<DataType, Dim>& x, double t,
98  tmpl::list<::Tags::deriv<gr::Tags::Lapse<DataType>, tmpl::size_t<Dim>,
99  Frame::Inertial>> /*meta*/) const noexcept;
100 
101  template <typename DataType>
103  variables(
104  const tnsr::I<DataType, Dim>& x, double /*t*/,
105  tmpl::list<gr::Tags::Shift<Dim, Frame::Inertial, DataType>> /*meta*/)
106  const noexcept;
107 
108  template <typename DataType>
110  ::Tags::dt<gr::Tags::Shift<Dim, Frame::Inertial, DataType>>>
111  variables(
112  const tnsr::I<DataType, Dim>& x, double /*t*/,
113  tmpl::list<
114  ::Tags::dt<gr::Tags::Shift<Dim, Frame::Inertial, DataType>>> /*meta*/)
115  const noexcept;
116 
117  template <typename DataType>
119  ::Tags::deriv<gr::Tags::Shift<Dim, Frame::Inertial, DataType>,
120  tmpl::size_t<Dim>, Frame::Inertial>>
121  variables(
122  const tnsr::I<DataType, Dim>& x, double /*t*/,
123  tmpl::list<::Tags::deriv<gr::Tags::Shift<Dim, Frame::Inertial, DataType>,
124  tmpl::size_t<Dim>, Frame::Inertial>> /*meta*/)
125  const noexcept;
126 
127  template <typename DataType>
129  variables(const tnsr::I<DataType, Dim>& x, double /*t*/,
130  tmpl::list<gr::Tags::SpatialMetric<Dim, Frame::Inertial,
131  DataType>> /*meta*/) const
132  noexcept;
133 
134  template <typename DataType>
136  ::Tags::dt<gr::Tags::SpatialMetric<Dim, Frame::Inertial, DataType>>>
137  variables(const tnsr::I<DataType, Dim>& x, double /*t*/,
138  tmpl::list<::Tags::dt<gr::Tags::SpatialMetric<
139  Dim, Frame::Inertial, DataType>>> /*meta*/) const noexcept;
140 
141  template <typename DataType>
143  ::Tags::deriv<gr::Tags::SpatialMetric<Dim, Frame::Inertial, DataType>,
144  tmpl::size_t<Dim>, Frame::Inertial>>
145  variables(
146  const tnsr::I<DataType, Dim>& x, double /*t*/,
147  tmpl::list<
148  ::Tags::deriv<gr::Tags::SpatialMetric<Dim, Frame::Inertial, DataType>,
149  tmpl::size_t<Dim>, Frame::Inertial>> /*meta*/) const
150  noexcept;
151 
152  template <typename DataType>
155  variables(const tnsr::I<DataType, Dim>& x, double /*t*/,
156  tmpl::list<gr::Tags::InverseSpatialMetric<Dim, Frame::Inertial,
157  DataType>> /*meta*/) const
158  noexcept;
159 
160  template <typename DataType>
163  variables(const tnsr::I<DataType, Dim>& x, double /*t*/,
164  tmpl::list<gr::Tags::ExtrinsicCurvature<Dim, Frame::Inertial,
165  DataType>> /*meta*/) const
166  noexcept;
167 
168  template <typename DataType>
170  const tnsr::I<DataType, Dim>& x, double /*t*/,
171  tmpl::list<gr::Tags::SqrtDetSpatialMetric<DataType>> /*meta*/) const
172  noexcept;
173 
174  template <typename DataType>
176  variables(
177  const tnsr::I<DataType, Dim>& x, double /*t*/,
178  tmpl::list<::Tags::dt<gr::Tags::SqrtDetSpatialMetric<DataType>>> /*meta*/)
179  const noexcept;
180 
181  // clang-tidy: google-runtime-references
182  void pup(PUP::er& /*p*/) noexcept {} // NOLINT
183 };
184 
185 template <size_t Dim>
186 inline constexpr bool operator==(const Minkowski<Dim>& /*lhs*/,
187  const Minkowski<Dim>& /*rhs*/) noexcept {
188  return true;
189 }
190 
191 template <size_t Dim>
192 inline constexpr bool operator!=(const Minkowski<Dim>& /*lhs*/,
193  const Minkowski<Dim>& /*rhs*/) noexcept {
194  return false;
195 }
196 } // namespace Solutions
197 } // namespace gr
Definition: Strahlkorper.hpp:14
Defines class tuples::TaggedTuple.
The Minkowski solution for flat space in Dim spatial dimensions.
Definition: Minkowski.hpp:37
Definition: Tags.hpp:36
Defines classes and functions for making classes creatable from input files.
Definition: Tags.hpp:46
Definition: Tags.hpp:31
Prefix indicating a time derivative.
Definition: Prefixes.hpp:28
const char *const OptionString
The string used in option structs.
Definition: Options.hpp:27
Holds functions related to general relativity.
Definition: KerrHorizon.cpp:14
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:272
Definition: Tags.hpp:26
Defines functions computing partial derivatives.
Definition: Tags.hpp:41
Definition: DataBoxTag.hpp:29
Defines classes for Tensor.
Wraps the template metaprogramming library used (brigand)
Definition: IndexType.hpp:44
Definition: Tags.hpp:96