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/Tags.hpp"
10 
11 namespace Cce {
12 
13 template <typename Tag>
15 
16 /*!
17  * \brief Compute the Bondi news from the evolution quantities.
18  *
19  * \details In the gauge used for regularity-preserving CCE,
20  * the Bondi news takes the convenient form
21  *
22  * \f{align*}{
23  * N = e^{-2 \beta^{(0)}} \left( (\partial_u \bar J)^{(1)}
24  * + \bar \eth \bar \eth e^{2 \beta^{(0)}}\right),
25  * \f}
26  *
27  * where \f$(0)\f$ and \f$(1)\f$ in the superscripts denote the zeroth and first
28  * order in an expansion in \f$1/r\f$ near \f$\mathcal{I}^+\f$.
29  */
30 template <>
32  using return_tags = tmpl::list<Tags::News>;
33  // extra typelist for more convenient testing
34  using tensor_argument_tags =
35  tmpl::list<Tags::Dy<Tags::Du<Tags::BondiJ>>, Tags::BondiBeta,
36  Spectral::Swsh::Tags::Derivative<Tags::BondiBeta,
38  Spectral::Swsh::Tags::Derivative<Tags::BondiBeta,
41  using argument_tags =
42  tmpl::append<tensor_argument_tags,
43  tmpl::list<Spectral::Swsh::Tags::LMax,
45 
46  static void apply(
48  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_du_bondi_j,
51  const Scalar<SpinWeighted<ComplexDataVector, 2>>& eth_eth_beta,
52  const Scalar<SpinWeighted<ComplexDataVector, 0>>& boundary_r,
53  size_t l_max, size_t number_of_radial_points) noexcept;
54 };
55 
56 /*!
57  * \brief Compute the contribution to the leading \f$\Psi_4\f$ that corresponds
58  * to a total time derivative.
59  *
60  * \details The value \f$\Psi_4\f$ scales asymptotically as \f$r^{-1}\f$, and
61  * has the form
62  *
63  * \f{align*}{
64  * \Psi_4^{(1)} = A \partial_u B,
65  * \f}
66  *
67  * where superscripts denote orders in the expansion in powers of \f$r^{-1}\f$.
68  * This mutator computes \f$B\f$:
69  *
70  * \f{align*}{
71  * B = e^{-2 \beta^{(0)}} (\bar \eth \bar U^{(1)} + \partial_u \bar J)
72  * \f}
73  */
74 template <>
75 struct CalculateScriPlusValue<Tags::TimeIntegral<Tags::ScriPlus<Tags::Psi4>>> {
76  using return_tags =
77  tmpl::list<Tags::TimeIntegral<Tags::ScriPlus<Tags::Psi4>>>;
78  // extra typelist for more convenient testing
79  using tensor_argument_tags =
80  tmpl::list<Tags::Exp2Beta, Tags::Dy<Tags::BondiU>,
86  using argument_tags =
87  tmpl::append<tensor_argument_tags,
88  tmpl::list<Spectral::Swsh::Tags::LMax,
90 
91  static void apply(
93  integral_of_psi_4,
94  const Scalar<SpinWeighted<ComplexDataVector, 0>>& exp_2_beta,
95  const Scalar<SpinWeighted<ComplexDataVector, 1>>& dy_bondi_u,
96  const Scalar<SpinWeighted<ComplexDataVector, 2>>& eth_dy_bondi_u,
97  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_du_bondi_j,
98  const Scalar<SpinWeighted<ComplexDataVector, 0>>& boundary_r,
99  const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_r_divided_by_r,
100  size_t l_max, size_t number_of_radial_points) noexcept;
101 };
102 
103 /*!
104  * \brief Compute the contribution to the leading \f$\Psi_4\f$ that multiplies
105  * the total time derivative
106  *
107  * \details The value \f$\Psi_4\f$ scales asymptotically as \f$r^{-1}\f$, and
108  * has the form
109  *
110  * \f{align*}{
111  * \Psi_4^{(1)} = A \partial_u B,
112  * \f}
113  *
114  * where superscripts denote orders in the expansion in powers of \f$r^{-1}\f$.
115  * This mutator computes \f$A\f$:
116  *
117  * \f{align*}{
118  * A = e^{-2 \beta^{(0)}}
119  * \f}
120  */
121 template <>
122 struct CalculateScriPlusValue<Tags::ScriPlusFactor<Tags::Psi4>> {
123  using return_tags = tmpl::list<Tags::ScriPlusFactor<Tags::Psi4>>;
124  // extra typelist for more convenient testing
125  using tensor_argument_tags = tmpl::list<Tags::Exp2Beta>;
126  using argument_tags =
127  tmpl::append<tensor_argument_tags,
128  tmpl::list<Spectral::Swsh::Tags::LMax,
130 
131  static void apply(
133  scri_plus_factor,
134  const Scalar<SpinWeighted<ComplexDataVector, 0>>& exp_2_beta,
135  size_t l_max, size_t number_of_radial_points) noexcept;
136 };
137 
138 /*!
139  * \brief Computes the leading part of \f$\Psi_3\f$ near \f$\mathcal I^+\f$.
140  *
141  * \details The value \f$\Psi_3\f$ scales asymptotically as \f$r^{-2}\f$, and
142  * has the form (in the coordinates used for regularity preserving CCE)
143  *
144  * \f{align*}{
145  * \Psi_3^{(2)} = 2 \bar \eth \beta^{(0)}
146  * + 4 \bar \eth \beta^{(0)} \eth \bar \eth \beta^{(0)}
147  * + \bar \eth \eth \bar \eth \beta^{(0)}
148  * + \frac{e^{-2 \beta^{(0)}}}{2} \eth \partial_u \bar J^{(1)}
149  * - e^{-2 \beta^{(0)}} \eth \beta^{(0)} \partial_u \bar J^{(1)}
150  * \f},
151  *
152  * where \f$J^{(n)}\f$ is the \f$1/r^n\f$ part of \f$J\f$ evaluated at
153  * \f$\mathcal I^+\f$, so
154  *
155  * \f{align*}{
156  * J^{(1)} = (-2 R \partial_y J)|_{y = 1},
157  * \f}
158  *
159  * where the expansion is determined by the conversion between Bondi and
160  * numerical radii \f$r = 2 R / (1 - y)\f$.
161  */
162 template <>
163 struct CalculateScriPlusValue<Tags::ScriPlus<Tags::Psi3>> {
164  using return_tags = tmpl::list<Tags::ScriPlus<Tags::Psi3>>;
165  // extra typelist for more convenient testing
166  using tensor_argument_tags = tmpl::list<
170  Spectral::Swsh::Tags::Derivative<Tags::BondiBeta,
173  Spectral::Swsh::Tags::Derivative<Tags::BondiBeta,
174  Spectral::Swsh::Tags::EthEthbar>,
178  Spectral::Swsh::Tags::Ethbar>,
180  using argument_tags =
181  tmpl::append<tensor_argument_tags,
182  tmpl::list<Spectral::Swsh::Tags::LMax,
184 
185  static void apply(
187  const Scalar<SpinWeighted<ComplexDataVector, 0>>& exp_2_beta,
189  const Scalar<SpinWeighted<ComplexDataVector, 0>>& eth_ethbar_beta,
190  const Scalar<SpinWeighted<ComplexDataVector, -1>>& ethbar_eth_ethbar_beta,
191  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_du_bondi_j,
192  const Scalar<SpinWeighted<ComplexDataVector, 1>>& ethbar_dy_du_bondi_j,
193  const Scalar<SpinWeighted<ComplexDataVector, 0>>& boundary_r,
194  const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_r_divided_by_r,
195  size_t l_max, size_t number_of_radial_points) noexcept;
196 };
197 
198 /*!
199  * \brief Computes the leading part of \f$\Psi_2\f$ near \f$\mathcal I^+\f$.
200  *
201  * \details The value \f$\Psi_2\f$ scales asymptotically as \f$r^{-3}\f$, and
202  * has the form (in the coordinates used for regularity preserving CCE)
203  *
204  * \f{align*}{
205  * \Psi_2^{(3)} = -\frac{e^{-2 \beta^{(0)}}}{4}
206  * \left(e^{2 \beta^{(0)}} \eth \bar Q^{(1)} + \eth \bar U^{(2)}
207  * + \bar \eth U^{(2)} + J^{(1)} \bar \eth \bar U^{(1)}
208  * + J^{(1)} \bar \partial_u J^{(1)} - 2 W^{(2)}\right)
209  * \f},
210  *
211  * where \f$A^{(n)}\f$ is the \f$1/r^n\f$ part of \f$A\f$ evaluated at
212  * \f$\mathcal I^+\f$, so for any quantity \f$A\f$,
213  *
214  * \f{align*}{
215  * \eth A^{(1)} &= (-2 R \eth \partial_y A
216  * - 2 \eth R \partial_y A)|_{y = 1} \notag\\
217  * \eth A^{(2)} &= (2 R^2 \eth \partial_y^2 A
218  * + 2 R \eth R \partial^2_y A)|_{y = 1}, \notag\\
219  * A^{(1)} &= (- 2 R \partial_y A)|_{y = 1}, \notag\\
220  * A^{(2)} &= (2 R^2 \partial_y^2 A)|_{y = 1},
221  * \f}
222  *
223  * where the expansion is determined by the conversion between Bondi and
224  * numerical radii \f$r = 2 R / (1 - y)\f$.
225  */
226 template <>
227 struct CalculateScriPlusValue<Tags::ScriPlus<Tags::Psi2>> {
228  using return_tags = tmpl::list<Tags::ScriPlus<Tags::Psi2>>;
229  // extra typelist for more convenient testing
230  using tensor_argument_tags = tmpl::list<
239  Spectral::Swsh::Tags::Ethbar>,
243  using argument_tags =
244  tmpl::append<tensor_argument_tags,
245  tmpl::list<Spectral::Swsh::Tags::LMax,
247 
248  static void apply(
250  const Scalar<SpinWeighted<ComplexDataVector, 0>>& exp_2_beta,
251  const Scalar<SpinWeighted<ComplexDataVector, 1>>& dy_bondi_q,
252  const Scalar<SpinWeighted<ComplexDataVector, 0>>& ethbar_dy_bondi_q,
253  const Scalar<SpinWeighted<ComplexDataVector, 1>>& dy_bondi_u,
254  const Scalar<SpinWeighted<ComplexDataVector, 2>>& eth_dy_bondi_u,
255  const Scalar<SpinWeighted<ComplexDataVector, 1>>& dy_dy_bondi_u,
256  const Scalar<SpinWeighted<ComplexDataVector, 0>>& ethbar_dy_dy_bondi_u,
257  const Scalar<SpinWeighted<ComplexDataVector, 0>>& dy_dy_bondi_w,
258  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_bondi_j,
259  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_du_bondi_j,
260  const Scalar<SpinWeighted<ComplexDataVector, 0>>& boundary_r,
261  const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_r_divided_by_r,
262  size_t l_max, size_t number_of_radial_points) noexcept;
263 };
264 
265 /*!
266  * \brief Computes the leading part of \f$\Psi_1\f$ near \f$\mathcal I^+\f$.
267  *
268  * \details The value \f$\Psi_1\f$ scales asymptotically as \f$r^{-4}\f$, and
269  * has the form (in the coordinates used for regularity preserving CCE)
270  *
271  * \f{align*}{
272  * \Psi_1^{(4)} = \frac{1}{8} \left(- 12 \eth \beta^{(2)} + J^{(1)} \bar Q^{(1)}
273  * + 2 Q^{(2)}\right)
274  * \f}
275  *
276  * where \f$A^{(n)}\f$ is the \f$1/r^n\f$ part of \f$A\f$ evaluated at
277  * \f$\mathcal I^+\f$, so for any quantity \f$A\f$,
278  *
279  * \f{align*}{
280  * \eth A^{(2)} &= (2 R^2 \eth \partial_y^2 A
281  * + 2 R \eth R \partial^2_y A)|_{y = 1}, \notag\\
282  * A^{(1)} &= (- 2 R \partial_y A)|_{y = 1}, \notag\\
283  * A^{(2)} &= (2 R^2 \partial_y^2 A)|_{y = 1},
284  * \f}
285  *
286  * where the expansion is determined by the conversion between Bondi and
287  * numerical radii \f$r = 2 R / (1 - y)\f$.
288  */
289 template <>
290 struct CalculateScriPlusValue<Tags::ScriPlus<Tags::Psi1>> {
291  using return_tags = tmpl::list<Tags::ScriPlus<Tags::Psi1>>;
292  // extra typelist for more convenient testing
293  using tensor_argument_tags = tmpl::list<
300  using argument_tags =
301  tmpl::append<tensor_argument_tags,
302  tmpl::list<Spectral::Swsh::Tags::LMax,
304 
305  static void apply(
307  const Scalar<SpinWeighted<ComplexDataVector, 0>>& dy_dy_bondi_beta,
308  const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_dy_dy_bondi_beta,
309  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_bondi_j,
310  const Scalar<SpinWeighted<ComplexDataVector, 1>>& dy_bondi_q,
311  const Scalar<SpinWeighted<ComplexDataVector, 1>>& dy_dy_bondi_q,
312  const Scalar<SpinWeighted<ComplexDataVector, 0>>& boundary_r,
313  const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_r_divided_by_r,
314  size_t l_max, size_t number_of_radial_points) noexcept;
315 };
316 
317 /*!
318  * \brief Computes the leading part of \f$\Psi_0\f$ near \f$\mathcal I^+\f$.
319  *
320  * \details The value \f$\Psi_0\f$ scales asymptotically as \f$r^{-5}\f$, and
321  * has the form (in the coordinates used for regularity preserving CCE)
322  *
323  * \f{align*}{
324  * \Psi_0^{(5)} = \frac{3}{2}\left(\frac{1}{4}\bar J^{(1)} J^{(1)} {}^2
325  * - J^{(3)}\right)
326  * \f}
327  *
328  * where \f$A^{(n)}\f$ is the \f$1/r^n\f$ part of \f$A\f$ evaluated at
329  * \f$\mathcal I^+\f$, so for any quantity \f$A\f$,
330  *
331  * \f{align*}{
332  * A^{(1)} &= (- 2 R \partial_y A)|_{y = 1} \notag\\
333  * A^{(3)} &= \left(-\frac{4}{3} R^3 \partial_y^3 A\right)|_{y = 1},
334  * \f}
335  *
336  * where the expansion is determined by the conversion between Bondi and
337  * numerical radii \f$r = 2 R / (1 - y)\f$.
338  */
339 template <>
340 struct CalculateScriPlusValue<Tags::ScriPlus<Tags::Psi0>> {
341  using return_tags = tmpl::list<Tags::ScriPlus<Tags::Psi0>>;
342  // extra typelist for more convenient testing
343  using tensor_argument_tags =
344  tmpl::list<Tags::Dy<Tags::BondiJ>,
347  using argument_tags =
348  tmpl::append<tensor_argument_tags,
349  tmpl::list<Spectral::Swsh::Tags::LMax,
351 
352  static void apply(
354  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_bondi_j,
355  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_dy_dy_bondi_j,
356  const Scalar<SpinWeighted<ComplexDataVector, 0>>& boundary_r,
357  size_t l_max, size_t number_of_radial_points) noexcept;
358 };
359 
360 /*!
361  * \brief Computes the leading part of the strain \f$h\f$ near \f$\mathcal
362  * I^+\f$.
363  *
364  * \details The value \f$h\f$ scales asymptotically as \f$r^{-1}\f$, and
365  * has the form (in the coordinates used for regularity preserving CCE)
366  *
367  * \f{align*}{
368  * h = \bar J^{(1)} + \bar \eth \bar \eth u^{(0)},
369  * \f}
370  *
371  * where \f$u^{(0)}\f$ is the asymptotically inertial retarded time, and
372  * \f$A^{(n)}\f$ is the \f$1/r^n\f$ part of \f$A\f$ evaluated at
373  * \f$\mathcal I^+\f$, so for any quantity \f$A\f$,
374  *
375  * \f{align*}{
376  * A^{(1)} = (- 2 R \partial_y A)|_{y = 1},
377  * \f}
378  *
379  * where the expansion is determined by the conversion between Bondi and
380  * numerical radii \f$r = 2 R / (1 - y)\f$.
381  */
382 template <>
383 struct CalculateScriPlusValue<Tags::ScriPlus<Tags::Strain>> {
384  using return_tags = tmpl::list<Tags::ScriPlus<Tags::Strain>>;
385  // extra typelist for more convenient testing
386  using tensor_argument_tags = tmpl::list<
391  using argument_tags =
392  tmpl::append<tensor_argument_tags,
393  tmpl::list<Spectral::Swsh::Tags::LMax,
395 
396  static void apply(
398  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_bondi_j,
399  const Scalar<SpinWeighted<ComplexDataVector, 2>>& eth_eth_retarded_time,
400  const Scalar<SpinWeighted<ComplexDataVector, 0>>& boundary_r,
401  size_t l_max, size_t number_of_radial_points) noexcept;
402 };
403 
404 /*!
405  * \brief Assign the time derivative of the asymptotically inertial time
406  * coordinate.
407  *
408  * \details The asymptotically inertial time coordinate \f$\mathring u\f$ obeys
409  * the differential equation:
410  *
411  * \f{align*}{
412  * \partial_u \mathring u = e^{2 \beta}.
413  * \f}
414  */
415 template <>
416 struct CalculateScriPlusValue<::Tags::dt<Tags::InertialRetardedTime>> {
417  using return_tags = tmpl::list<::Tags::dt<Tags::InertialRetardedTime>>;
418  using argument_tags = tmpl::list<Tags::Exp2Beta>;
419 
420  static void apply(
421  gsl::not_null<Scalar<DataVector>*> dt_inertial_time,
422  const Scalar<SpinWeighted<ComplexDataVector, 0>>& exp_2_beta) noexcept;
423 };
424 
425 /// \cond
426 template <typename Tag>
427 struct InitializeScriPlusValue;
428 /// \endcond
429 
430 /// Initialize the inertial retarded time to the value provided in the mutator
431 /// arguments.
432 template <>
433 struct InitializeScriPlusValue<Tags::InertialRetardedTime> {
434  using argument_tags = tmpl::list<>;
435  using return_tags = tmpl::list<Tags::InertialRetardedTime>;
436 
437  static void apply(const gsl::not_null<Scalar<DataVector>*> inertial_time,
438  const double initial_time = 0.0) noexcept {
439  // this is arbitrary, and has to do with choosing a BMS frame.
440  get(*inertial_time) = initial_time;
441  }
442 };
443 } // namespace Cce
Contains functionality for Cauchy Characteristic Extraction.
Definition: BoundaryComputeAndSendToEvolution.hpp:24
Bondi parameter .
Definition: Tags.hpp:25
Definition: ScriPlusValues.hpp:14
Define prefixes for DataBox tags.
Prefix tag representing the spin-weighted derivative of a spin-weighted scalar.
Definition: SwshTags.hpp:139
Complex storage form for the asymptotically inertial retarded time, for taking spin-weighted derivati...
Definition: Tags.hpp:167
Prefix indicating a time derivative.
Definition: Prefixes.hpp:30
Tag for the number of radial grid points in the three-dimensional representation of radially concentr...
Definition: SwshTags.hpp:195
Make a spin-weighted type T with spin-weight Spin. Mathematical operators are restricted to addition...
Definition: SpinWeighted.hpp:25
The value , where is Bondi radius of the worldtube.
Definition: Tags.hpp:283
The value .
Definition: Tags.hpp:309
A prefix tag representing the gauge-transformed boundary data for a quantity on the extraction surfac...
Definition: Tags.hpp:199
Definition: DataBoxTag.hpp:29
The derivative with respect to the numerical coordinate , where is Bondi radius of the worldtube...
Definition: Tags.hpp:99
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:1628
Struct for labeling the spin-weighted derivative in tags.
Definition: SwshTags.hpp:29
Tag for the maximum spin-weighted spherical harmonic l; sets angular resolution.
Definition: SwshTags.hpp:187
Struct for labeling the spin-weighted derivative in tags.
Definition: SwshTags.hpp:36
Struct for labeling the spin-weighted derivative in tags.
Definition: SwshTags.hpp:44
Tensor< T, Symmetry<>, index_list<> > Scalar
Scalar type.
Definition: TypeAliases.hpp:21
Struct for labeling the spin-weighted derivative in tags.
Definition: SwshTags.hpp:33
Require a pointer to not be a nullptr
Definition: Gsl.hpp:182