ScriPlusValues.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 
9 #include "Evolution/Systems/Cce/OptionTags.hpp"
10 #include "Evolution/Systems/Cce/Tags.hpp"
11 
12 namespace Cce {
13 
14 /// The tags that are needed to be interpolated at scri+ for the available
15 /// observation tags.
17  tmpl::list<Tags::News, Tags::ScriPlus<Tags::Strain>,
18  Tags::ScriPlus<Tags::Psi3>, Tags::ScriPlus<Tags::Psi2>,
19  Tags::ScriPlus<Tags::Psi1>, Tags::ScriPlus<Tags::Psi0>,
20  Tags::Du<Tags::TimeIntegral<Tags::ScriPlus<Tags::Psi4>>>,
22 
23 template <typename Tag>
25 
26 /*!
27  * \brief Compute the Bondi news from the evolution quantities.
28  *
29  * \details In the gauge used for regularity-preserving CCE,
30  * the Bondi news takes the convenient form
31  *
32  * \f{align*}{
33  * N = e^{-2 \beta^{(0)}} \left( (\partial_u \bar J)^{(1)}
34  * + \bar \eth \bar \eth e^{2 \beta^{(0)}}\right),
35  * \f}
36  *
37  * where \f$(0)\f$ and \f$(1)\f$ in the superscripts denote the zeroth and first
38  * order in an expansion in \f$1/r\f$ near \f$\mathcal{I}^+\f$.
39  */
40 template <>
41 struct CalculateScriPlusValue<Tags::News> {
42  using return_tags = tmpl::list<Tags::News>;
43  // extra typelist for more convenient testing
44  using tensor_argument_tags =
45  tmpl::list<Tags::Dy<Tags::Du<Tags::BondiJ>>, Tags::BondiBeta,
51  using argument_tags =
52  tmpl::append<tensor_argument_tags,
53  tmpl::list<Tags::LMax, Tags::NumberOfRadialPoints>>;
54 
55  static void apply(
57  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_du_bondi_j,
60  const Scalar<SpinWeighted<ComplexDataVector, 2>>& eth_eth_beta,
61  const Scalar<SpinWeighted<ComplexDataVector, 0>>& boundary_r,
62  size_t l_max, size_t number_of_radial_points) noexcept;
63 };
64 
65 /*!
66  * \brief Compute the contribution to the leading \f$\Psi_4\f$ that corresponds
67  * to a total time derivative.
68  *
69  * \details The value \f$\Psi_4\f$ scales asymptotically as \f$r^{-1}\f$, and
70  * has the form
71  *
72  * \f{align*}{
73  * \Psi_4^{(1)} = \partial_{u_{\text{inertial}}} B,
74  * \f}
75  *
76  * where superscripts denote orders in the expansion in powers of \f$r^{-1}\f$.
77  * This mutator computes \f$B\f$:
78  *
79  * \f{align*}{
80  * B = 2 e^{-2 \beta^{(0)}} (\bar \eth \bar U^{(1)} + \partial_u \bar J^{(1)})
81  * \f}
82  *
83  * and the time derivative that appears the original equation obeys,
84  *
85  * \f[
86  * \partial_{u_{\text{inertial}}} = e^{-2 \beta} \partial_u
87  * \f]
88  */
89 template <>
90 struct CalculateScriPlusValue<Tags::TimeIntegral<Tags::ScriPlus<Tags::Psi4>>> {
91  using return_tags =
92  tmpl::list<Tags::TimeIntegral<Tags::ScriPlus<Tags::Psi4>>>;
93  // extra typelist for more convenient testing
94  using tensor_argument_tags =
95  tmpl::list<Tags::Exp2Beta, Tags::Dy<Tags::BondiU>,
101  using argument_tags =
102  tmpl::append<tensor_argument_tags,
103  tmpl::list<Tags::LMax, Tags::NumberOfRadialPoints>>;
104 
105  static void apply(
107  integral_of_psi_4,
108  const Scalar<SpinWeighted<ComplexDataVector, 0>>& exp_2_beta,
109  const Scalar<SpinWeighted<ComplexDataVector, 1>>& dy_bondi_u,
110  const Scalar<SpinWeighted<ComplexDataVector, 2>>& eth_dy_bondi_u,
111  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_du_bondi_j,
112  const Scalar<SpinWeighted<ComplexDataVector, 0>>& boundary_r,
113  const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_r_divided_by_r,
114  size_t l_max, size_t number_of_radial_points) noexcept;
115 };
116 
117 
118 /*!
119  * \brief Computes the leading part of \f$\Psi_3\f$ near \f$\mathcal I^+\f$.
120  *
121  * \details The value \f$\Psi_3\f$ scales asymptotically as \f$r^{-2}\f$, and
122  * has the form (in the coordinates used for regularity preserving CCE)
123  *
124  * \f{align*}{
125  * \Psi_3^{(2)} = 2 \bar \eth \beta^{(0)}
126  * + 4 \bar \eth \beta^{(0)} \eth \bar \eth \beta^{(0)}
127  * + \bar \eth \eth \bar \eth \beta^{(0)}
128  * + \frac{e^{-2 \beta^{(0)}}}{2} \eth \partial_u \bar J^{(1)}
129  * - e^{-2 \beta^{(0)}} \eth \beta^{(0)} \partial_u \bar J^{(1)}
130  * \f},
131  *
132  * where \f$J^{(n)}\f$ is the \f$1/r^n\f$ part of \f$J\f$ evaluated at
133  * \f$\mathcal I^+\f$, so
134  *
135  * \f{align*}{
136  * J^{(1)} = (-2 R \partial_y J)|_{y = 1},
137  * \f}
138  *
139  * where the expansion is determined by the conversion between Bondi and
140  * numerical radii \f$r = 2 R / (1 - y)\f$.
141  */
142 template <>
143 struct CalculateScriPlusValue<Tags::ScriPlus<Tags::Psi3>> {
144  using return_tags = tmpl::list<Tags::ScriPlus<Tags::Psi3>>;
145  // extra typelist for more convenient testing
146  using tensor_argument_tags = tmpl::list<
160  using argument_tags = tmpl::push_back<tensor_argument_tags, Tags::LMax,
162 
163  static void apply(
165  const Scalar<SpinWeighted<ComplexDataVector, 0>>& exp_2_beta,
167  const Scalar<SpinWeighted<ComplexDataVector, 0>>& eth_ethbar_beta,
168  const Scalar<SpinWeighted<ComplexDataVector, -1>>& ethbar_eth_ethbar_beta,
169  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_du_bondi_j,
170  const Scalar<SpinWeighted<ComplexDataVector, 1>>& ethbar_dy_du_bondi_j,
171  const Scalar<SpinWeighted<ComplexDataVector, 0>>& boundary_r,
172  const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_r_divided_by_r,
173  size_t l_max, size_t number_of_radial_points) noexcept;
174 };
175 
176 /*!
177  * \brief Computes the leading part of \f$\Psi_2\f$ near \f$\mathcal I^+\f$.
178  *
179  * \details The value \f$\Psi_2\f$ scales asymptotically as \f$r^{-3}\f$, and
180  * has the form (in the coordinates used for regularity preserving CCE)
181  *
182  * \f{align*}{
183  * \Psi_2^{(3)} = -\frac{e^{-2 \beta^{(0)}}}{4}
184  * \left(e^{2 \beta^{(0)}} \eth \bar Q^{(1)} + \eth \bar U^{(2)}
185  * + \bar \eth U^{(2)} + J^{(1)} \bar \eth \bar U^{(1)}
186  * + J^{(1)} \bar \partial_u J^{(1)} - 2 W^{(2)}\right)
187  * \f},
188  *
189  * where \f$A^{(n)}\f$ is the \f$1/r^n\f$ part of \f$A\f$ evaluated at
190  * \f$\mathcal I^+\f$, so for any quantity \f$A\f$,
191  *
192  * \f{align*}{
193  * \eth A^{(1)} &= (-2 R \eth \partial_y A
194  * - 2 \eth R \partial_y A)|_{y = 1} \notag\\
195  * \eth A^{(2)} &= (2 R^2 \eth \partial_y^2 A
196  * + 2 R \eth R \partial^2_y A)|_{y = 1}, \notag\\
197  * A^{(1)} &= (- 2 R \partial_y A)|_{y = 1}, \notag\\
198  * A^{(2)} &= (2 R^2 \partial_y^2 A)|_{y = 1},
199  * \f}
200  *
201  * where the expansion is determined by the conversion between Bondi and
202  * numerical radii \f$r = 2 R / (1 - y)\f$.
203  */
204 template <>
205 struct CalculateScriPlusValue<Tags::ScriPlus<Tags::Psi2>> {
206  using return_tags = tmpl::list<Tags::ScriPlus<Tags::Psi2>>;
207  // extra typelist for more convenient testing
208  using tensor_argument_tags = tmpl::list<
221  using argument_tags = tmpl::push_back<tensor_argument_tags, Tags::LMax,
223 
224  static void apply(
226  const Scalar<SpinWeighted<ComplexDataVector, 0>>& exp_2_beta,
227  const Scalar<SpinWeighted<ComplexDataVector, 1>>& dy_bondi_q,
228  const Scalar<SpinWeighted<ComplexDataVector, 0>>& ethbar_dy_bondi_q,
229  const Scalar<SpinWeighted<ComplexDataVector, 1>>& dy_bondi_u,
230  const Scalar<SpinWeighted<ComplexDataVector, 2>>& eth_dy_bondi_u,
231  const Scalar<SpinWeighted<ComplexDataVector, 1>>& dy_dy_bondi_u,
232  const Scalar<SpinWeighted<ComplexDataVector, 0>>& ethbar_dy_dy_bondi_u,
233  const Scalar<SpinWeighted<ComplexDataVector, 0>>& dy_dy_bondi_w,
234  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_bondi_j,
235  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_du_bondi_j,
236  const Scalar<SpinWeighted<ComplexDataVector, 0>>& boundary_r,
237  const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_r_divided_by_r,
238  size_t l_max, size_t number_of_radial_points) noexcept;
239 };
240 
241 /*!
242  * \brief Computes the leading part of \f$\Psi_1\f$ near \f$\mathcal I^+\f$.
243  *
244  * \details The value \f$\Psi_1\f$ scales asymptotically as \f$r^{-4}\f$, and
245  * has the form (in the coordinates used for regularity preserving CCE)
246  *
247  * \f{align*}{
248  * \Psi_1^{(4)} = \frac{1}{8} \left(- 12 \eth \beta^{(2)} + J^{(1)} \bar Q^{(1)}
249  * + 2 Q^{(2)}\right)
250  * \f}
251  *
252  * where \f$A^{(n)}\f$ is the \f$1/r^n\f$ part of \f$A\f$ evaluated at
253  * \f$\mathcal I^+\f$, so for any quantity \f$A\f$,
254  *
255  * \f{align*}{
256  * \eth A^{(2)} &= (2 R^2 \eth \partial_y^2 A
257  * + 2 R \eth R \partial^2_y A)|_{y = 1}, \notag\\
258  * A^{(1)} &= (- 2 R \partial_y A)|_{y = 1}, \notag\\
259  * A^{(2)} &= (2 R^2 \partial_y^2 A)|_{y = 1},
260  * \f}
261  *
262  * where the expansion is determined by the conversion between Bondi and
263  * numerical radii \f$r = 2 R / (1 - y)\f$.
264  */
265 template <>
266 struct CalculateScriPlusValue<Tags::ScriPlus<Tags::Psi1>> {
267  using return_tags = tmpl::list<Tags::ScriPlus<Tags::Psi1>>;
268  // extra typelist for more convenient testing
269  using tensor_argument_tags = tmpl::list<
276  using argument_tags = tmpl::push_back<tensor_argument_tags, Tags::LMax,
278 
279  static void apply(
281  const Scalar<SpinWeighted<ComplexDataVector, 0>>& dy_dy_bondi_beta,
282  const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_dy_dy_bondi_beta,
283  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_bondi_j,
284  const Scalar<SpinWeighted<ComplexDataVector, 1>>& dy_bondi_q,
285  const Scalar<SpinWeighted<ComplexDataVector, 1>>& dy_dy_bondi_q,
286  const Scalar<SpinWeighted<ComplexDataVector, 0>>& boundary_r,
287  const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_r_divided_by_r,
288  size_t l_max, size_t number_of_radial_points) noexcept;
289 };
290 
291 /*!
292  * \brief Computes the leading part of \f$\Psi_0\f$ near \f$\mathcal I^+\f$.
293  *
294  * \details The value \f$\Psi_0\f$ scales asymptotically as \f$r^{-5}\f$, and
295  * has the form (in the coordinates used for regularity preserving CCE)
296  *
297  * \f{align*}{
298  * \Psi_0^{(5)} = \frac{3}{2}\left(\frac{1}{4}\bar J^{(1)} J^{(1)} {}^2
299  * - J^{(3)}\right)
300  * \f}
301  *
302  * where \f$A^{(n)}\f$ is the \f$1/r^n\f$ part of \f$A\f$ evaluated at
303  * \f$\mathcal I^+\f$, so for any quantity \f$A\f$,
304  *
305  * \f{align*}{
306  * A^{(1)} &= (- 2 R \partial_y A)|_{y = 1} \notag\\
307  * A^{(3)} &= \left(-\frac{4}{3} R^3 \partial_y^3 A\right)|_{y = 1},
308  * \f}
309  *
310  * where the expansion is determined by the conversion between Bondi and
311  * numerical radii \f$r = 2 R / (1 - y)\f$.
312  */
313 template <>
314 struct CalculateScriPlusValue<Tags::ScriPlus<Tags::Psi0>> {
315  using return_tags = tmpl::list<Tags::ScriPlus<Tags::Psi0>>;
316  // extra typelist for more convenient testing
317  using tensor_argument_tags =
318  tmpl::list<Tags::Dy<Tags::BondiJ>,
321  using argument_tags = tmpl::push_back<tensor_argument_tags, Tags::LMax,
323 
324  static void apply(
326  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_bondi_j,
327  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_dy_dy_bondi_j,
328  const Scalar<SpinWeighted<ComplexDataVector, 0>>& boundary_r,
329  size_t l_max, size_t number_of_radial_points) noexcept;
330 };
331 
332 /*!
333  * \brief Computes the leading part of the strain \f$h\f$ near \f$\mathcal
334  * I^+\f$.
335  *
336  * \details The value \f$h\f$ scales asymptotically as \f$r^{-1}\f$, and
337  * has the form (in the coordinates used for regularity preserving CCE)
338  *
339  * \f{align*}{
340  * h = \bar J^{(1)} + \bar \eth \bar \eth u^{(0)},
341  * \f}
342  *
343  * where \f$u^{(0)}\f$ is the asymptotically inertial retarded time, and
344  * \f$A^{(n)}\f$ is the \f$1/r^n\f$ part of \f$A\f$ evaluated at
345  * \f$\mathcal I^+\f$, so for any quantity \f$A\f$,
346  *
347  * \f{align*}{
348  * A^{(1)} = (- 2 R \partial_y A)|_{y = 1},
349  * \f}
350  *
351  * where the expansion is determined by the conversion between Bondi and
352  * numerical radii \f$r = 2 R / (1 - y)\f$.
353  */
354 template <>
355 struct CalculateScriPlusValue<Tags::ScriPlus<Tags::Strain>> {
356  using return_tags = tmpl::list<Tags::ScriPlus<Tags::Strain>>;
357  // extra typelist for more convenient testing
358  using tensor_argument_tags = tmpl::list<
363  using argument_tags = tmpl::push_back<tensor_argument_tags, Tags::LMax,
365 
366  static void apply(
368  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_bondi_j,
369  const Scalar<SpinWeighted<ComplexDataVector, 2>>& eth_eth_retarded_time,
370  const Scalar<SpinWeighted<ComplexDataVector, 0>>& boundary_r,
371  size_t l_max, size_t number_of_radial_points) noexcept;
372 };
373 
374 /*!
375  * \brief Assign the time derivative of the asymptotically inertial time
376  * coordinate.
377  *
378  * \details The asymptotically inertial time coordinate \f$\mathring u\f$ obeys
379  * the differential equation:
380  *
381  * \f{align*}{
382  * \partial_u \mathring u = e^{2 \beta}.
383  * \f}
384  */
385 template <>
386 struct CalculateScriPlusValue<::Tags::dt<Tags::InertialRetardedTime>> {
387  using return_tags = tmpl::list<::Tags::dt<Tags::InertialRetardedTime>>;
388  using argument_tags = tmpl::list<Tags::Exp2Beta>;
389 
390  static void apply(
391  gsl::not_null<Scalar<DataVector>*> dt_inertial_time,
392  const Scalar<SpinWeighted<ComplexDataVector, 0>>& exp_2_beta) noexcept;
393 };
394 
395 /// Determines the angular derivative of the asymptotic inertial time, useful
396 /// for asymptotic coordinate transformations.
397 template <>
398 struct CalculateScriPlusValue<Tags::EthInertialRetardedTime> {
399  using return_tags = tmpl::list<Tags::EthInertialRetardedTime>;
400  using argument_tags =
401  tmpl::list<Tags::ComplexInertialRetardedTime, Tags::LMax>;
402 
403  static void apply(
405  eth_inertial_time,
406  const Scalar<SpinWeighted<ComplexDataVector, 0>>& inertial_time,
407  size_t l_max) noexcept;
408 };
409 
410 /// Initialize the \f$\mathcal I^+\f$ value `Tag` for the first hypersurface.
411 template <typename Tag>
413 
414 /// Initialize the inertial retarded time to the value provided in the mutator
415 /// arguments.
416 template <>
417 struct InitializeScriPlusValue<Tags::InertialRetardedTime> {
418  using argument_tags = tmpl::list<>;
419  using return_tags = tmpl::list<Tags::InertialRetardedTime>;
420 
421  static void apply(const gsl::not_null<Scalar<DataVector>*> inertial_time,
422  const double initial_time = 0.0) noexcept {
423  // this is arbitrary, and has to do with choosing a BMS frame.
424  get(*inertial_time) = initial_time;
425  }
426 };
427 } // namespace Cce
Cce::CalculateScriPlusValue
Definition: ScriPlusValues.hpp:24
Cce::Tags::EthRDividedByR
The value , where is Bondi radius of the worldtube.
Definition: Tags.hpp:273
get
constexpr Tag::type & get(Variables< TagList > &v) noexcept
Return Tag::type pointing into the contiguous array.
Definition: Variables.hpp:639
Cce::Tags::NumberOfRadialPoints
Definition: OptionTags.hpp:253
Spectral::Swsh::Tags::Eth
Struct for labeling the spin-weighted derivative in tags.
Definition: SwshTags.hpp:30
Cce::scri_plus_interpolation_set
tmpl::list< Tags::News, Tags::ScriPlus< Tags::Strain >, Tags::ScriPlus< Tags::Psi3 >, Tags::ScriPlus< Tags::Psi2 >, Tags::ScriPlus< Tags::Psi1 >, Tags::ScriPlus< Tags::Psi0 >, Tags::Du< Tags::TimeIntegral< Tags::ScriPlus< Tags::Psi4 > >>, Tags::EthInertialRetardedTime > scri_plus_interpolation_set
The tags that are needed to be interpolated at scri+ for the available observation tags.
Definition: ScriPlusValues.hpp:21
Spectral::Swsh::Tags::EthEthbar
Struct for labeling the spin-weighted derivative in tags.
Definition: SwshTags.hpp:45
Cce::Tags::BondiBeta
Bondi parameter .
Definition: Tags.hpp:30
Cce::InitializeScriPlusValue
Initialize the value Tag for the first hypersurface.
Definition: ScriPlusValues.hpp:412
Spectral::Swsh::Tags::Derivative
Prefix tag representing the spin-weighted derivative of a spin-weighted scalar.
Definition: SwshTags.hpp:152
SpinWeighted
Make a spin-weighted type T with spin-weight Spin. Mathematical operators are restricted to addition,...
Definition: SpinWeighted.hpp:24
domain::push_back
CoordinateMap< SourceFrame, TargetFrame, Maps..., NewMap > push_back(CoordinateMap< SourceFrame, TargetFrame, Maps... > old_map, NewMap new_map) noexcept
Creates a CoordinateMap by appending the new map to the end of the old maps.
Cce::Tags::Exp2Beta
The value .
Definition: Tags.hpp:296
db::apply
constexpr auto apply(F &&f, const DataBox< BoxTags > &box, Args &&... args) noexcept
Apply the invokable f with argument Tags TagsList from DataBox box
Definition: DataBox.hpp:1424
Spectral::Swsh::Tags::EthEth
Struct for labeling the spin-weighted derivative in tags.
Definition: SwshTags.hpp:37
cstddef
Cce::Tags::Dy
The derivative with respect to the numerical coordinate , where is Bondi radius of the worldtube.
Definition: Tags.hpp:116
Cce::Tags::EthInertialRetardedTime
Represents , which is a useful quantity for asymptotic coordinate transformations.
Definition: Tags.hpp:175
Tags::dt
Prefix indicating a time derivative.
Definition: Prefixes.hpp:29
Scalar
Tensor< T, Symmetry<>, index_list<> > Scalar
Definition: TypeAliases.hpp:21
Cce
The set of utilities for performing Cauchy characteristic evolution and Cauchy characteristic matchin...
Definition: BoundaryComputeAndSendToEvolution.hpp:28
Spectral::Swsh::Tags::Ethbar
Struct for labeling the spin-weighted derivative in tags.
Definition: SwshTags.hpp:34
Cce::Tags::LMax
Definition: OptionTags.hpp:243
Cce::Tags::ComplexInertialRetardedTime
Complex storage form for the asymptotically inertial retarded time, for taking spin-weighted derivati...
Definition: Tags.hpp:181
Cce::Tags::EvolutionGaugeBoundaryValue
A prefix tag representing the gauge-transformed boundary data for a quantity on the extraction surfac...
Definition: Tags.hpp:207
Prefixes.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: Gsl.hpp:183