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 template <typename Tag>
16 
17 /*!
18  * \brief Compute the Bondi news from the evolution quantities.
19  *
20  * \details In the gauge used for regularity-preserving CCE,
21  * the Bondi news takes the convenient form
22  *
23  * \f{align*}{
24  * N = e^{-2 \beta^{(0)}} \left( (\partial_u \bar J)^{(1)}
25  * + \bar \eth \bar \eth e^{2 \beta^{(0)}}\right),
26  * \f}
27  *
28  * where \f$(0)\f$ and \f$(1)\f$ in the superscripts denote the zeroth and first
29  * order in an expansion in \f$1/r\f$ near \f$\mathcal{I}^+\f$.
30  */
31 template <>
32 struct CalculateScriPlusValue<Tags::News> {
33  using return_tags = tmpl::list<Tags::News>;
34  // extra typelist for more convenient testing
35  using tensor_argument_tags =
36  tmpl::list<Tags::Dy<Tags::Du<Tags::BondiJ>>, Tags::BondiBeta,
42  using argument_tags =
43  tmpl::append<tensor_argument_tags,
44  tmpl::list<Tags::LMax, Tags::NumberOfRadialPoints>>;
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<Tags::LMax, Tags::NumberOfRadialPoints>>;
89 
90  static void apply(
92  integral_of_psi_4,
93  const Scalar<SpinWeighted<ComplexDataVector, 0>>& exp_2_beta,
94  const Scalar<SpinWeighted<ComplexDataVector, 1>>& dy_bondi_u,
95  const Scalar<SpinWeighted<ComplexDataVector, 2>>& eth_dy_bondi_u,
96  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_du_bondi_j,
97  const Scalar<SpinWeighted<ComplexDataVector, 0>>& boundary_r,
98  const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_r_divided_by_r,
99  size_t l_max, size_t number_of_radial_points) noexcept;
100 };
101 
102 /*!
103  * \brief Compute the contribution to the leading \f$\Psi_4\f$ that multiplies
104  * the total time derivative
105  *
106  * \details The value \f$\Psi_4\f$ scales asymptotically as \f$r^{-1}\f$, and
107  * has the form
108  *
109  * \f{align*}{
110  * \Psi_4^{(1)} = A \partial_u B,
111  * \f}
112  *
113  * where superscripts denote orders in the expansion in powers of \f$r^{-1}\f$.
114  * This mutator computes \f$A\f$:
115  *
116  * \f{align*}{
117  * A = e^{-2 \beta^{(0)}}
118  * \f}
119  */
120 template <>
121 struct CalculateScriPlusValue<Tags::ScriPlusFactor<Tags::Psi4>> {
122  using return_tags = tmpl::list<Tags::ScriPlusFactor<Tags::Psi4>>;
123  // extra typelist for more convenient testing
124  using tensor_argument_tags = tmpl::list<Tags::Exp2Beta>;
125  using argument_tags = tmpl::push_back<tensor_argument_tags, Tags::LMax,
127 
128  static void apply(
130  scri_plus_factor,
131  const Scalar<SpinWeighted<ComplexDataVector, 0>>& exp_2_beta,
132  size_t l_max, size_t number_of_radial_points) noexcept;
133 };
134 
135 /*!
136  * \brief Computes the leading part of \f$\Psi_3\f$ near \f$\mathcal I^+\f$.
137  *
138  * \details The value \f$\Psi_3\f$ scales asymptotically as \f$r^{-2}\f$, and
139  * has the form (in the coordinates used for regularity preserving CCE)
140  *
141  * \f{align*}{
142  * \Psi_3^{(2)} = 2 \bar \eth \beta^{(0)}
143  * + 4 \bar \eth \beta^{(0)} \eth \bar \eth \beta^{(0)}
144  * + \bar \eth \eth \bar \eth \beta^{(0)}
145  * + \frac{e^{-2 \beta^{(0)}}}{2} \eth \partial_u \bar J^{(1)}
146  * - e^{-2 \beta^{(0)}} \eth \beta^{(0)} \partial_u \bar J^{(1)}
147  * \f},
148  *
149  * where \f$J^{(n)}\f$ is the \f$1/r^n\f$ part of \f$J\f$ evaluated at
150  * \f$\mathcal I^+\f$, so
151  *
152  * \f{align*}{
153  * J^{(1)} = (-2 R \partial_y J)|_{y = 1},
154  * \f}
155  *
156  * where the expansion is determined by the conversion between Bondi and
157  * numerical radii \f$r = 2 R / (1 - y)\f$.
158  */
159 template <>
160 struct CalculateScriPlusValue<Tags::ScriPlus<Tags::Psi3>> {
161  using return_tags = tmpl::list<Tags::ScriPlus<Tags::Psi3>>;
162  // extra typelist for more convenient testing
163  using tensor_argument_tags = tmpl::list<
177  using argument_tags = tmpl::push_back<tensor_argument_tags, Tags::LMax,
179 
180  static void apply(
182  const Scalar<SpinWeighted<ComplexDataVector, 0>>& exp_2_beta,
184  const Scalar<SpinWeighted<ComplexDataVector, 0>>& eth_ethbar_beta,
185  const Scalar<SpinWeighted<ComplexDataVector, -1>>& ethbar_eth_ethbar_beta,
186  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_du_bondi_j,
187  const Scalar<SpinWeighted<ComplexDataVector, 1>>& ethbar_dy_du_bondi_j,
188  const Scalar<SpinWeighted<ComplexDataVector, 0>>& boundary_r,
189  const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_r_divided_by_r,
190  size_t l_max, size_t number_of_radial_points) noexcept;
191 };
192 
193 /*!
194  * \brief Computes the leading part of \f$\Psi_2\f$ near \f$\mathcal I^+\f$.
195  *
196  * \details The value \f$\Psi_2\f$ scales asymptotically as \f$r^{-3}\f$, and
197  * has the form (in the coordinates used for regularity preserving CCE)
198  *
199  * \f{align*}{
200  * \Psi_2^{(3)} = -\frac{e^{-2 \beta^{(0)}}}{4}
201  * \left(e^{2 \beta^{(0)}} \eth \bar Q^{(1)} + \eth \bar U^{(2)}
202  * + \bar \eth U^{(2)} + J^{(1)} \bar \eth \bar U^{(1)}
203  * + J^{(1)} \bar \partial_u J^{(1)} - 2 W^{(2)}\right)
204  * \f},
205  *
206  * where \f$A^{(n)}\f$ is the \f$1/r^n\f$ part of \f$A\f$ evaluated at
207  * \f$\mathcal I^+\f$, so for any quantity \f$A\f$,
208  *
209  * \f{align*}{
210  * \eth A^{(1)} &= (-2 R \eth \partial_y A
211  * - 2 \eth R \partial_y A)|_{y = 1} \notag\\
212  * \eth A^{(2)} &= (2 R^2 \eth \partial_y^2 A
213  * + 2 R \eth R \partial^2_y A)|_{y = 1}, \notag\\
214  * A^{(1)} &= (- 2 R \partial_y A)|_{y = 1}, \notag\\
215  * A^{(2)} &= (2 R^2 \partial_y^2 A)|_{y = 1},
216  * \f}
217  *
218  * where the expansion is determined by the conversion between Bondi and
219  * numerical radii \f$r = 2 R / (1 - y)\f$.
220  */
221 template <>
222 struct CalculateScriPlusValue<Tags::ScriPlus<Tags::Psi2>> {
223  using return_tags = tmpl::list<Tags::ScriPlus<Tags::Psi2>>;
224  // extra typelist for more convenient testing
225  using tensor_argument_tags = tmpl::list<
238  using argument_tags = tmpl::push_back<tensor_argument_tags, Tags::LMax,
240 
241  static void apply(
243  const Scalar<SpinWeighted<ComplexDataVector, 0>>& exp_2_beta,
244  const Scalar<SpinWeighted<ComplexDataVector, 1>>& dy_bondi_q,
245  const Scalar<SpinWeighted<ComplexDataVector, 0>>& ethbar_dy_bondi_q,
246  const Scalar<SpinWeighted<ComplexDataVector, 1>>& dy_bondi_u,
247  const Scalar<SpinWeighted<ComplexDataVector, 2>>& eth_dy_bondi_u,
248  const Scalar<SpinWeighted<ComplexDataVector, 1>>& dy_dy_bondi_u,
249  const Scalar<SpinWeighted<ComplexDataVector, 0>>& ethbar_dy_dy_bondi_u,
250  const Scalar<SpinWeighted<ComplexDataVector, 0>>& dy_dy_bondi_w,
251  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_bondi_j,
252  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_du_bondi_j,
253  const Scalar<SpinWeighted<ComplexDataVector, 0>>& boundary_r,
254  const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_r_divided_by_r,
255  size_t l_max, size_t number_of_radial_points) noexcept;
256 };
257 
258 /*!
259  * \brief Computes the leading part of \f$\Psi_1\f$ near \f$\mathcal I^+\f$.
260  *
261  * \details The value \f$\Psi_1\f$ scales asymptotically as \f$r^{-4}\f$, and
262  * has the form (in the coordinates used for regularity preserving CCE)
263  *
264  * \f{align*}{
265  * \Psi_1^{(4)} = \frac{1}{8} \left(- 12 \eth \beta^{(2)} + J^{(1)} \bar Q^{(1)}
266  * + 2 Q^{(2)}\right)
267  * \f}
268  *
269  * where \f$A^{(n)}\f$ is the \f$1/r^n\f$ part of \f$A\f$ evaluated at
270  * \f$\mathcal I^+\f$, so for any quantity \f$A\f$,
271  *
272  * \f{align*}{
273  * \eth A^{(2)} &= (2 R^2 \eth \partial_y^2 A
274  * + 2 R \eth R \partial^2_y A)|_{y = 1}, \notag\\
275  * A^{(1)} &= (- 2 R \partial_y A)|_{y = 1}, \notag\\
276  * A^{(2)} &= (2 R^2 \partial_y^2 A)|_{y = 1},
277  * \f}
278  *
279  * where the expansion is determined by the conversion between Bondi and
280  * numerical radii \f$r = 2 R / (1 - y)\f$.
281  */
282 template <>
283 struct CalculateScriPlusValue<Tags::ScriPlus<Tags::Psi1>> {
284  using return_tags = tmpl::list<Tags::ScriPlus<Tags::Psi1>>;
285  // extra typelist for more convenient testing
286  using tensor_argument_tags = tmpl::list<
293  using argument_tags = tmpl::push_back<tensor_argument_tags, Tags::LMax,
295 
296  static void apply(
298  const Scalar<SpinWeighted<ComplexDataVector, 0>>& dy_dy_bondi_beta,
299  const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_dy_dy_bondi_beta,
300  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_bondi_j,
301  const Scalar<SpinWeighted<ComplexDataVector, 1>>& dy_bondi_q,
302  const Scalar<SpinWeighted<ComplexDataVector, 1>>& dy_dy_bondi_q,
303  const Scalar<SpinWeighted<ComplexDataVector, 0>>& boundary_r,
304  const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_r_divided_by_r,
305  size_t l_max, size_t number_of_radial_points) noexcept;
306 };
307 
308 /*!
309  * \brief Computes the leading part of \f$\Psi_0\f$ near \f$\mathcal I^+\f$.
310  *
311  * \details The value \f$\Psi_0\f$ scales asymptotically as \f$r^{-5}\f$, and
312  * has the form (in the coordinates used for regularity preserving CCE)
313  *
314  * \f{align*}{
315  * \Psi_0^{(5)} = \frac{3}{2}\left(\frac{1}{4}\bar J^{(1)} J^{(1)} {}^2
316  * - J^{(3)}\right)
317  * \f}
318  *
319  * where \f$A^{(n)}\f$ is the \f$1/r^n\f$ part of \f$A\f$ evaluated at
320  * \f$\mathcal I^+\f$, so for any quantity \f$A\f$,
321  *
322  * \f{align*}{
323  * A^{(1)} &= (- 2 R \partial_y A)|_{y = 1} \notag\\
324  * A^{(3)} &= \left(-\frac{4}{3} R^3 \partial_y^3 A\right)|_{y = 1},
325  * \f}
326  *
327  * where the expansion is determined by the conversion between Bondi and
328  * numerical radii \f$r = 2 R / (1 - y)\f$.
329  */
330 template <>
331 struct CalculateScriPlusValue<Tags::ScriPlus<Tags::Psi0>> {
332  using return_tags = tmpl::list<Tags::ScriPlus<Tags::Psi0>>;
333  // extra typelist for more convenient testing
334  using tensor_argument_tags =
335  tmpl::list<Tags::Dy<Tags::BondiJ>,
338  using argument_tags = tmpl::push_back<tensor_argument_tags, Tags::LMax,
340 
341  static void apply(
343  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_bondi_j,
344  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_dy_dy_bondi_j,
345  const Scalar<SpinWeighted<ComplexDataVector, 0>>& boundary_r,
346  size_t l_max, size_t number_of_radial_points) noexcept;
347 };
348 
349 /*!
350  * \brief Computes the leading part of the strain \f$h\f$ near \f$\mathcal
351  * I^+\f$.
352  *
353  * \details The value \f$h\f$ scales asymptotically as \f$r^{-1}\f$, and
354  * has the form (in the coordinates used for regularity preserving CCE)
355  *
356  * \f{align*}{
357  * h = \bar J^{(1)} + \bar \eth \bar \eth u^{(0)},
358  * \f}
359  *
360  * where \f$u^{(0)}\f$ is the asymptotically inertial retarded time, and
361  * \f$A^{(n)}\f$ is the \f$1/r^n\f$ part of \f$A\f$ evaluated at
362  * \f$\mathcal I^+\f$, so for any quantity \f$A\f$,
363  *
364  * \f{align*}{
365  * A^{(1)} = (- 2 R \partial_y A)|_{y = 1},
366  * \f}
367  *
368  * where the expansion is determined by the conversion between Bondi and
369  * numerical radii \f$r = 2 R / (1 - y)\f$.
370  */
371 template <>
372 struct CalculateScriPlusValue<Tags::ScriPlus<Tags::Strain>> {
373  using return_tags = tmpl::list<Tags::ScriPlus<Tags::Strain>>;
374  // extra typelist for more convenient testing
375  using tensor_argument_tags = tmpl::list<
380  using argument_tags = tmpl::push_back<tensor_argument_tags, Tags::LMax,
382 
383  static void apply(
385  const Scalar<SpinWeighted<ComplexDataVector, 2>>& dy_bondi_j,
386  const Scalar<SpinWeighted<ComplexDataVector, 2>>& eth_eth_retarded_time,
387  const Scalar<SpinWeighted<ComplexDataVector, 0>>& boundary_r,
388  size_t l_max, size_t number_of_radial_points) noexcept;
389 };
390 
391 /*!
392  * \brief Assign the time derivative of the asymptotically inertial time
393  * coordinate.
394  *
395  * \details The asymptotically inertial time coordinate \f$\mathring u\f$ obeys
396  * the differential equation:
397  *
398  * \f{align*}{
399  * \partial_u \mathring u = e^{2 \beta}.
400  * \f}
401  */
402 template <>
403 struct CalculateScriPlusValue<::Tags::dt<Tags::InertialRetardedTime>> {
404  using return_tags = tmpl::list<::Tags::dt<Tags::InertialRetardedTime>>;
405  using argument_tags = tmpl::list<Tags::Exp2Beta>;
406 
407  static void apply(
408  gsl::not_null<Scalar<DataVector>*> dt_inertial_time,
409  const Scalar<SpinWeighted<ComplexDataVector, 0>>& exp_2_beta) noexcept;
410 };
411 
412 /// Initialize the \f$\mathcal I^+\f$ value `Tag` for the first hypersurface.
413 template <typename Tag>
415 
416 /// Initialize the inertial retarded time to the value provided in the mutator
417 /// arguments.
418 template <>
419 struct InitializeScriPlusValue<Tags::InertialRetardedTime> {
420  using argument_tags = tmpl::list<>;
421  using return_tags = tmpl::list<Tags::InertialRetardedTime>;
422 
423  static void apply(const gsl::not_null<Scalar<DataVector>*> inertial_time,
424  const double initial_time = 0.0) noexcept {
425  // this is arbitrary, and has to do with choosing a BMS frame.
426  get(*inertial_time) = initial_time;
427  }
428 };
429 } // namespace Cce
Cce::CalculateScriPlusValue
Definition: ScriPlusValues.hpp:15
Cce::Tags::EthRDividedByR
The value , where is Bondi radius of the worldtube.
Definition: Tags.hpp:297
get
constexpr Tag::type & get(Variables< TagList > &v) noexcept
Return Tag::type pointing into the contiguous array.
Definition: Variables.hpp:689
Cce::Tags::NumberOfRadialPoints
Definition: OptionTags.hpp:228
Spectral::Swsh::Tags::Eth
Struct for labeling the spin-weighted derivative in tags.
Definition: SwshTags.hpp:30
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:414
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:320
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:1443
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
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:218
Cce::Tags::ComplexInertialRetardedTime
Complex storage form for the asymptotically inertial retarded time, for taking spin-weighted derivati...
Definition: Tags.hpp:184
Cce::Tags::EvolutionGaugeBoundaryValue
A prefix tag representing the gauge-transformed boundary data for a quantity on the extraction surfac...
Definition: Tags.hpp:216
Prefixes.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: Gsl.hpp:183