Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include "DataStructures/DataBox/Prefixes.hpp"
7 : #include "DataStructures/DataBox/Tag.hpp"
8 : #include "DataStructures/DataBox/TagName.hpp"
9 : #include "DataStructures/SpinWeighted.hpp"
10 : #include "DataStructures/Tensor/Tensor.hpp"
11 : #include "DataStructures/Tensor/TypeAliases.hpp"
12 : #include "Evolution/Systems/Cce/InterfaceManagers/GhInterfaceManager.hpp"
13 : #include "Evolution/Systems/Cce/InterfaceManagers/GhLockstep.hpp"
14 : #include "NumericalAlgorithms/SpinWeightedSphericalHarmonics/SwshTags.hpp"
15 :
16 : namespace Cce {
17 :
18 : /// \cond
19 : struct MetricWorldtubeDataManager;
20 : template <typename ToInterpolate, typename Tag>
21 : struct ScriPlusInterpolationManager;
22 : /// \endcond
23 :
24 : /// Tags for Cauchy Characteristic Extraction routines
25 : namespace Tags {
26 :
27 : // Bondi parameter tags
28 :
29 : /// Bondi parameter \f$\beta\f$
30 1 : struct BondiBeta : db::SimpleTag {
31 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 0>>;
32 : };
33 :
34 : /// Bondi parameter \f$J\f$
35 1 : struct BondiJ : db::SimpleTag {
36 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 2>>;
37 0 : static std::string name() { return "J"; }
38 : };
39 :
40 : // The scalar field in scalar-tensor theory
41 0 : struct KleinGordonPsi : db::SimpleTag {
42 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 0>>;
43 0 : static std::string name() { return "KGPsi"; }
44 : };
45 :
46 : } // namespace Tags
47 : } // namespace Cce
48 :
49 : namespace Tags {
50 : /// \cond
51 : template <>
52 : struct dt<Cce::Tags::BondiJ> : db::PrefixTag, db::SimpleTag {
53 : static std::string name() { return "H"; }
54 : using type = Scalar<::SpinWeighted<ComplexDataVector, 2>>;
55 : using tag = Cce::Tags::BondiJ;
56 : };
57 :
58 : template <>
59 : struct dt<Cce::Tags::KleinGordonPsi> : db::PrefixTag, db::SimpleTag {
60 : static std::string name() { return "KGPi"; }
61 : using type = Scalar<::SpinWeighted<ComplexDataVector, 0>>;
62 : using tag = Cce::Tags::KleinGordonPsi;
63 : };
64 : /// \endcond
65 : } // namespace Tags
66 :
67 : namespace Cce {
68 : namespace Tags {
69 : /// \brief Bondi parameter \f$H = \partial_u J\f$.
70 : /// \note The notation in the literature is not consistent regarding this
71 : /// quantity, or whether it is denoted by an \f$H\f$ at all. The SpECTRE CCE
72 : /// module consistently uses it to describe the (retarded) partial time
73 : /// derivative of \f$J\f$ at fixed compactified radius \f$y\f$ (to be contrasted
74 : /// with the physical Bondi radius, which is not directly used for numerical
75 : /// grids).
76 1 : using BondiH = ::Tags::dt<BondiJ>;
77 :
78 : /// \brief Klein-Gordon variable \f$\Pi = \partial_u \psi\f$.
79 1 : using KleinGordonPi = ::Tags::dt<KleinGordonPsi>;
80 :
81 : /// Bondi parameter \f$\bar{J}\f$
82 1 : struct BondiJbar : db::SimpleTag {
83 0 : using type = Scalar<SpinWeighted<ComplexDataVector, -2>>;
84 0 : static std::string name() { return "Jbar"; }
85 : };
86 :
87 : /// Bondi parameter \f$K = \sqrt{1 + J \bar{J}}\f$
88 1 : struct BondiK : db::SimpleTag {
89 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 0>>;
90 0 : static std::string name() { return "K"; }
91 : };
92 :
93 : /// Bondi parameter \f$Q\f$
94 1 : struct BondiQ : db::SimpleTag {
95 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 1>>;
96 0 : static std::string name() { return "Q"; }
97 : };
98 :
99 : /// Bondi parameter \f$\bar{Q}\f$
100 1 : struct BondiQbar : db::SimpleTag {
101 0 : using type = Scalar<SpinWeighted<ComplexDataVector, -1>>;
102 0 : static std::string name() { return "Qbar"; }
103 : };
104 :
105 : /// Bondi parameter \f$U\f$
106 1 : struct BondiU : db::SimpleTag {
107 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 1>>;
108 0 : static std::string name() { return "U"; }
109 : };
110 :
111 : /// The surface quantity of Bondi \f$U\f$ evaluated at the null spacetime
112 : /// boundary \f$\mathcal I^+\f$
113 1 : struct BondiUAtScri : db::SimpleTag {
114 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 1>>;
115 : };
116 :
117 : /// Bondi parameter \f$\bar{U}\f$
118 1 : struct BondiUbar : db::SimpleTag {
119 0 : using type = Scalar<SpinWeighted<ComplexDataVector, -1>>;
120 0 : static std::string name() { return "Ubar"; }
121 : };
122 :
123 : /// Bondi parameter \f$W\f$
124 1 : struct BondiW : db::SimpleTag {
125 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 0>>;
126 0 : static std::string name() { return "W"; }
127 : };
128 :
129 : /// Bondi parameter \f$\bar{J}\f$ in the Cauchy frame
130 1 : struct BondiJCauchyView : db::SimpleTag {
131 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 2>>;
132 : };
133 :
134 : /// The derivative with respect to the numerical coordinate \f$y = 1 - 2R/r\f$,
135 : /// where \f$R(u, \theta, \phi)\f$ is Bondi radius of the worldtube.
136 : template <typename Tag>
137 1 : struct Dy : db::PrefixTag, db::SimpleTag {
138 0 : using type = Scalar<SpinWeighted<ComplexDataVector, Tag::type::type::spin>>;
139 0 : using tag = Tag;
140 0 : static const size_t dimension_to_differentiate = 2;
141 : };
142 :
143 : /// The derivative with respect to Bondi \f$r\f$
144 : template <typename Tag>
145 1 : struct Dr : db::PrefixTag, db::SimpleTag {
146 0 : using type = typename Tag::type;
147 0 : using tag = Tag;
148 : };
149 :
150 : /// The derivative with respect to \f$\lambda\f$,
151 : /// where \f$\lambda\f$ is an affine parameter along \f$l\f$, see
152 : /// Eq. (19a) of \cite Moxon2020gha.
153 : template <typename Tag>
154 1 : struct Dlambda : db::PrefixTag, db::SimpleTag {
155 0 : using type = typename Tag::type;
156 0 : using tag = Tag;
157 : };
158 :
159 : /// The derivative with respect to Bondi retarded time \f$u\f$
160 : template <typename Tag>
161 1 : struct Du : db::PrefixTag, db::SimpleTag {
162 0 : using type = Scalar<SpinWeighted<ComplexDataVector, Tag::type::type::spin>>;
163 0 : using tag = Tag;
164 : };
165 :
166 : /// The spin-weight 2 angular Jacobian factor in the partially flat Bondi-like
167 : /// coordinates, see Eq. (31a) of \cite Moxon2020gha
168 1 : struct PartiallyFlatGaugeC : db::SimpleTag {
169 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 2>>;
170 : };
171 :
172 : /// The spin-weight 0 angular Jacobian factor in the partially flat Bondi-like
173 : /// coordinates, see Eq. (31b) of \cite Moxon2020gha
174 1 : struct PartiallyFlatGaugeD : db::SimpleTag {
175 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 0>>;
176 : };
177 :
178 : /// The spin-weight 2 angular Jacobian factor in the Cauchy coordinates, similar
179 : /// to Eq. (31a) of \cite Moxon2020gha, but without hat.
180 1 : struct CauchyGaugeC : db::SimpleTag {
181 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 2>>;
182 : };
183 :
184 : /// The spin-weight 0 angular Jacobian factor in the Cauchy coordinates, similar
185 : /// to Eq. (31b) of \cite Moxon2020gha, but without hat.
186 1 : struct CauchyGaugeD : db::SimpleTag {
187 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 0>>;
188 : };
189 :
190 : /// The conformal factor in the partially flat Bondi-like coordinates,
191 : /// associated with an angular transformation, see Eq. (32) of
192 : /// \cite Moxon2020gha
193 1 : struct PartiallyFlatGaugeOmega : db::SimpleTag {
194 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 0>>;
195 : };
196 :
197 : /// The conformal factor in the Cauchy coordinates, similar to Eq. (32) of
198 : /// \cite Moxon2020gha, but without hat.
199 1 : struct CauchyGaugeOmega : db::SimpleTag {
200 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 0>>;
201 : };
202 :
203 0 : struct News : db::SimpleTag {
204 0 : using type = Scalar<SpinWeighted<ComplexDataVector, -2>>;
205 : };
206 :
207 : // For expressing the Cauchy angular coordinates for the worldtube data in terms
208 : // of the evolution angular coordinates.
209 0 : struct CauchyAngularCoords : db::SimpleTag {
210 0 : using type = tnsr::i<DataVector, 2, ::Frame::Spherical<::Frame::Inertial>>;
211 : };
212 :
213 : /// The angular coordinates for the partially flat Bondi-like coordinates.
214 1 : struct PartiallyFlatAngularCoords : db::SimpleTag {
215 0 : using type = tnsr::i<DataVector, 2, ::Frame::Spherical<::Frame::Inertial>>;
216 : };
217 :
218 : // For expressing the Cauchy Cartesian coordinates for the worldtube data in
219 : // terms of the evolution angular coordinates.
220 0 : struct CauchyCartesianCoords : db::SimpleTag {
221 0 : using type = tnsr::i<DataVector, 3>;
222 : };
223 :
224 : /// The partially flat Bondi-like coordinates.
225 1 : struct PartiallyFlatCartesianCoords : db::SimpleTag {
226 0 : using type = tnsr::i<DataVector, 3>;
227 : };
228 :
229 : /// The asymptotically inertial retarded time in terms of the evolution time
230 : /// variable
231 1 : struct InertialRetardedTime : db::SimpleTag {
232 0 : using type = Scalar<DataVector>;
233 : };
234 :
235 : /// Represents \f$\eth u_{\rm inertial}\f$, which is a useful quantity for
236 : /// asymptotic coordinate transformations.
237 1 : struct EthInertialRetardedTime : db::SimpleTag {
238 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 1>>;
239 : };
240 :
241 : /// Complex storage form for the asymptotically inertial retarded time, for
242 : /// taking spin-weighted derivatives
243 1 : struct ComplexInertialRetardedTime : db::SimpleTag {
244 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 0>>;
245 : };
246 :
247 : // prefix tags associated with the integrands which are used as input to solvers
248 : // for the CCE equations
249 :
250 : /// A prefix tag representing a quantity that will appear on the right-hand side
251 : /// of an explicitly regular differential equation
252 : template <typename Tag>
253 1 : struct Integrand : db::PrefixTag, db::SimpleTag {
254 0 : using type = Scalar<SpinWeighted<ComplexDataVector, Tag::type::type::spin>>;
255 0 : using tag = Tag;
256 : };
257 :
258 : /// A prefix tag representing the boundary data for a quantity on the extraction
259 : /// surface.
260 : template <typename Tag>
261 1 : struct BoundaryValue : db::PrefixTag, db::SimpleTag {
262 0 : using type = Scalar<SpinWeighted<ComplexDataVector, Tag::type::type::spin>>;
263 0 : using tag = Tag;
264 : };
265 :
266 : /// A prefix tag representing the gauge-transformed boundary data for a quantity
267 : /// on the extraction surface.
268 : template <typename Tag>
269 1 : struct EvolutionGaugeBoundaryValue : db::PrefixTag, db::SimpleTag {
270 0 : using type = Scalar<SpinWeighted<ComplexDataVector, Tag::type::type::spin>>;
271 0 : using tag = Tag;
272 : };
273 :
274 : /// A prefix tag representing the coefficient of a pole part of the right-hand
275 : /// side of a singular differential equation
276 : template <typename Tag>
277 1 : struct PoleOfIntegrand : db::PrefixTag, db::SimpleTag {
278 0 : using type = Scalar<SpinWeighted<ComplexDataVector, Tag::type::type::spin>>;
279 0 : using tag = Tag;
280 : };
281 :
282 : /// A prefix tag representing the regular part of the right-hand side of a
283 : /// regular differential equation
284 : template <typename Tag>
285 1 : struct RegularIntegrand : db::PrefixTag, db::SimpleTag {
286 0 : using type = Scalar<SpinWeighted<ComplexDataVector, Tag::type::type::spin>>;
287 0 : using tag = Tag;
288 : };
289 :
290 : /// A prefix tag representing a linear factor that acts on `Tag`. To determine
291 : /// the spin weight, It is assumed that the linear factor plays the role of
292 : /// \f$L\f$ in an equation of the form,
293 : /// \f$ (y - 1) \partial_y H + L H + L^\prime \bar{H} = A + (1 - y) B \f$
294 : template <typename Tag>
295 1 : struct LinearFactor : db::PrefixTag, db::SimpleTag {
296 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 0>>;
297 0 : using tag = Tag;
298 : };
299 :
300 : /// A prefix tag representing a linear factor that acts on `Tag`. To determine
301 : /// the spin weight, it is assumed that the linear factor plays the role of
302 : /// \f$L^\prime\f$ in an equation of the form,
303 : /// \f$ (y - 1) \partial_y H + L H + L^\prime \bar{H} = A + (1 - y) B \f$
304 : template <typename Tag>
305 1 : struct LinearFactorForConjugate : db::PrefixTag, db::SimpleTag {
306 0 : using type =
307 : Scalar<SpinWeighted<ComplexDataVector, 2 * Tag::type::type::spin>>;
308 0 : using tag = Tag;
309 : };
310 :
311 : // Below are additional tags for values which are frequently used in CCE
312 : // calculations, and therefore worth caching
313 :
314 : /// Coordinate value \f$(1 - y)\f$, which will be cached and sent to the
315 : /// implementing functions
316 1 : struct OneMinusY : db::SimpleTag {
317 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 0>>;
318 : };
319 :
320 : /// A tag for the first time derivative of the worldtube parameter
321 : /// \f$\partial_u R\f$, where \f$R(u, \theta, \phi)\f$ is Bondi
322 : /// radius of the worldtube.
323 1 : struct DuR : db::SimpleTag {
324 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 0>>;
325 : };
326 :
327 : /// The value \f$\partial_u R / R\f$, where \f$R(u, \theta, \phi)\f$ is Bondi
328 : /// radius of the worldtube.
329 1 : struct DuRDividedByR : db::SimpleTag {
330 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 0>>;
331 : };
332 :
333 : /// The value \f$\eth R / R\f$, where \f$R(u, \theta, \phi)\f$ is Bondi
334 : /// radius of the worldtube.
335 1 : struct EthRDividedByR : db::SimpleTag {
336 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 1>>;
337 0 : using derivative_kind = Spectral::Swsh::Tags::Eth;
338 0 : static constexpr int spin = 1;
339 : };
340 :
341 : /// The value \f$\eth \eth R / R\f$, where \f$R(u, \theta, \phi)\f$ is Bondi
342 : /// radius of the worldtube.
343 1 : struct EthEthRDividedByR : db::SimpleTag {
344 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 2>>;
345 0 : using derivative_kind = Spectral::Swsh::Tags::EthEth;
346 0 : static constexpr int spin = 2;
347 : };
348 :
349 : /// The value \f$\eth \bar{\eth} R / R\f$, where \f$R(u, \theta, \phi)\f$ is
350 : /// Bondi radius of the worldtube.
351 1 : struct EthEthbarRDividedByR : db::SimpleTag {
352 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 0>>;
353 0 : using derivative_kind = Spectral::Swsh::Tags::EthEthbar;
354 0 : static constexpr int spin = 0;
355 : };
356 :
357 : /// The value \f$\exp(2\beta)\f$.
358 1 : struct Exp2Beta : db::SimpleTag {
359 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 0>>;
360 : };
361 :
362 : /// The value \f$ \bar{J} (Q - 2 \eth \beta ) \f$.
363 1 : struct JbarQMinus2EthBeta : db::SimpleTag {
364 0 : using type = Scalar<SpinWeighted<ComplexDataVector, -1>>;
365 : };
366 :
367 : /// The Bondi radius \f$R(u, \theta, \phi)\f$ is of the worldtube.
368 1 : struct BondiR : db::SimpleTag {
369 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 0>>;
370 0 : static std::string name() { return "R"; }
371 : };
372 :
373 0 : struct EndTime : db::BaseTag {};
374 :
375 0 : struct StartTime : db::BaseTag {};
376 :
377 : /// The Weyl scalar \f$\Psi_0\f$
378 1 : struct Psi0 : db::SimpleTag {
379 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 2>>;
380 : };
381 :
382 : /// The Weyl scalar \f$\Psi_0\f$ for matching (in the Cauchy frame)
383 1 : struct Psi0Match : db::SimpleTag {
384 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 2>>;
385 : };
386 : /// The Weyl scalar \f$\Psi_1\f$
387 1 : struct Psi1 : db::SimpleTag {
388 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 1>>;
389 : };
390 :
391 : /// The Weyl scalar \f$\Psi_2\f$
392 1 : struct Psi2 : db::SimpleTag {
393 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 0>>;
394 : };
395 :
396 : /// The Weyl scalar \f$\Psi_3\f$
397 1 : struct Psi3 : db::SimpleTag {
398 0 : using type = Scalar<SpinWeighted<ComplexDataVector, -1>>;
399 : };
400 :
401 : /// The Weyl scalar \f$\Psi_4\f$
402 1 : struct Psi4 : db::SimpleTag {
403 0 : using type = Scalar<SpinWeighted<ComplexDataVector, -2>>;
404 : };
405 :
406 : /// The gravitational wave strain \f$h\f$
407 1 : struct Strain : db::SimpleTag {
408 0 : using type = Scalar<SpinWeighted<ComplexDataVector, -2>>;
409 : };
410 :
411 : /// A prefix tag representing the time integral of the value it prefixes
412 : template <typename Tag>
413 1 : struct TimeIntegral : db::PrefixTag, db::SimpleTag {
414 0 : using type = Scalar<SpinWeighted<ComplexDataVector, Tag::type::type::spin>>;
415 0 : using tag = Tag;
416 : };
417 :
418 : /// A prefix tag representing the value at \f$\mathcal I^+\f$
419 : template <typename Tag>
420 1 : struct ScriPlus : db::PrefixTag, db::SimpleTag {
421 0 : using type = Scalar<SpinWeighted<ComplexDataVector, Tag::type::type::spin>>;
422 0 : using tag = Tag;
423 : };
424 :
425 : /// A prefix tag representing an additional correction factor necessary to
426 : /// compute the quantity at \f$\mathcal I^+\f$
427 : template <typename Tag>
428 1 : struct ScriPlusFactor : db::PrefixTag, db::SimpleTag {
429 0 : using type = Scalar<SpinWeighted<ComplexDataVector, 0>>;
430 0 : using tag = Tag;
431 : };
432 :
433 : /// A prefix tag representing Klein-Gordon sources in Cce hypersurface equations
434 : template <typename Tag>
435 1 : struct KleinGordonSource : db::PrefixTag, db::SimpleTag {
436 0 : using type = Scalar<SpinWeighted<ComplexDataVector, Tag::type::type::spin>>;
437 0 : using tag = Tag;
438 : };
439 :
440 : template <typename ToInterpolate, typename ObservationTag>
441 0 : struct InterpolationManager : db::SimpleTag {
442 0 : using type = ScriPlusInterpolationManager<ToInterpolate, ObservationTag>;
443 0 : static std::string name() {
444 : return "InterpolationManager(" + db::tag_name<ObservationTag>() + ")";
445 : }
446 : };
447 :
448 : /// During self-start, we must be in lockstep with the GH system (if running
449 : /// concurrently), because the step size is unchangable during self-start.
450 1 : struct SelfStartGhInterfaceManager : db::SimpleTag {
451 0 : using type = InterfaceManagers::GhLockstep;
452 0 : using option_tags = tmpl::list<>;
453 :
454 0 : static constexpr bool pass_metavariables = false;
455 0 : static InterfaceManagers::GhLockstep create_from_options() {
456 : return Cce::InterfaceManagers::GhLockstep();
457 : }
458 : };
459 : } // namespace Tags
460 : } // namespace Cce
|