91
91
% the date your document was last changed, if your document is in CVS,
92
92
% please use:
93
93
% \date{$ $Date$ $}
94
- \date {July 27 2023 }
94
+ \date {April 17 2024 }
95
95
96
96
\maketitle
97
97
103
103
104
104
% Add an abstract for this thorn's documentation
105
105
\begin {abstract }
106
- This thorn implements the radiative boundary condition originally introduced
107
- in the Carpet-based NewRad thorn.
106
+ This thorn implements radiative boundary conditions for \code {CarpetX}. The
107
+ original implementation was introduced in the \code {Carpet}-based \code {NewRad}
108
+ thorn in the \code {EinsteinEvolve}~\cite {SpacetimeX_NewRadX_EinsteinEvolve }
109
+ arrangement.
108
110
\end {abstract }
109
111
110
112
% The following sections are suggestive only.
111
113
% Remove them or add your own.
112
114
113
115
\section {Introduction }
114
116
This thorn provides routines to implement radiative boundary conditions as
115
- described in section VI of~\cite {EinsteinEvolve_NewRad_Alcubierre :2002kk }:
117
+ described in section VI of~\cite {SpacetimeX_NewRadX_Alcubierre :2002kk }:
116
118
\begin {equation }
117
119
f = f_0 + u(r - v t)/r\mbox {,}
118
- \label {eqn:EinsteinEvolve_NewRad_bc }
120
+ \label {eqn:SpacetimeX_NewRadX_bc }
119
121
\end {equation }
120
122
in its differential form
121
123
\begin {equation }
122
124
\partial _t f + v \partial _r f - v\, (f - f_0) = 0\mbox {,}
123
- \label {eqn:EinsteinEvolve_NewRad_diff_bc }
125
+ \label {eqn:SpacetimeX_NewRadX_diff_bc }
124
126
\end {equation }
125
127
where $ v$ is the asymptotic propagation speed of the field $ f$ and $ f_0 $
126
128
is its asymptotic value.
127
129
128
130
\section {Physical System }
129
131
% RH: this is copied verbatim from Alcubierre:2002kk
130
- Quoting~\cite {EinsteinEvolve_NewRad_Alcubierre :2002kk }:
132
+ Quoting~\cite {SpacetimeX_NewRadX_Alcubierre :2002kk }:
131
133
132
134
At the outer boundary we use a radiation (Sommerfeld) boundary
133
135
condition. We start from the assumption that near the boundary all
@@ -184,7 +186,7 @@ \section{Physical System}
184
186
\begin {equation }
185
187
\frac {x_i}{r} \, \partial _t f + v \partial _i f + \frac {v x_i}{r^2} \,
186
188
\left ( f - f_0 \right ) \simeq \frac {x_i h'(t)}{r^{n+1}} .
187
- \label {eqn:EinsteinEvolve_NewRad_num_bc }
189
+ \label {eqn:SpacetimeX_NewRadX_num_bc }
188
190
\end {equation }
189
191
190
192
This expression still contains the unknown function $ h'(t)$ . Having
@@ -195,26 +197,33 @@ \section{Physical System}
195
197
boundary condition on its own.
196
198
197
199
\section {Numerical Implementation }
198
- The thorn implements to ingredients for the evolution.
199
- \begin {enumerate }
200
- \item the boundary condition~\eqref {eqn:EinsteinEvolve_NewRad_num_bc },
201
- \item a routine to extrapolate the contracted Christoffel symbols
202
- $ g^{jk} \Gamma ^i_{jk}$ (\code {Xt1}\ldots\code {Xt3} in the code) into the
203
- outer boundaries at $ t=0 $ .
204
- \end {enumerate }
205
-
206
- \subsection {Extrapolation }
207
- At outer boundary points, as determined by \code {GenericFD}'s routine
208
- \code {GenericFD\_ GetBoundaryInfo} we use cubic polynomials along the
209
- normal of the boundary to extrapolate data from the interior into the
210
- boundary region. Due to the use of cubic polynomial we require at least
211
- four (4) points of valid data to be available for the extrapolation.
212
- This \emph {includes } ghost zones, which are assumed to contain valid
213
- data in the interior of the domain.
200
+ The thorn implements the boundary condition
201
+ ~\eqref {eqn:SpacetimeX_NewRadX_num_bc } for the evolution. The original
202
+ \code {Carpet}-based version of \code {NewRad} provides an additional
203
+ routine \code {ExtrapolateGammas}, which can be used to extrapolate
204
+ a grid function from the interior to the outer boundaries at $ t=0 $ .
205
+ Originally, this was used in the BSSN evolution thorn \code {ML\_ BSSN}
206
+ on the contracted Christoffel symbols
207
+ $ g^{jk} \Gamma ^i_{jk}$ (\code {Xt1}\ldots\code {Xt3} in the code).
208
+ This extrapolation routine is not yet ported over to the current version
209
+ of \code {NewRadX}.
210
+
211
+
212
+ % \subsection{Extrapolation}
213
+ % In the \code{CarpetX} version of NewRadX, the boundary information is
214
+ % obtained from the \code{Loop} thorn.
215
+ %
216
+ % At outer boundary points, as determined by \code{GenericFD}'s routine
217
+ % \code{GenericFD\_GetBoundaryInfo} we use cubic polynomials along the
218
+ % normal of the boundary to extrapolate data from the interior into the
219
+ % boundary region. Due to the use of cubic polynomial we require at least
220
+ % four (4) points of valid data to be available for the extrapolation.
221
+ % This \emph{includes} ghost zones, which are assumed to contain valid
222
+ % data in the interior of the domain.
214
223
215
224
\subsection {Radiative boundary condition }
216
225
The derivatives $ \partial _i f$ appearing in
217
- \eqref {eqn:EinsteinEvolve_NewRad_num_bc } are approximated as
226
+ \eqref {eqn:SpacetimeX_NewRadX_num_bc } are approximated as
218
227
2\textsuperscript {nd} order accurate finite difference expressions using
219
228
centred expressions
220
229
\begin {equation }
@@ -233,100 +242,128 @@ \subsection{Radiative boundary condition}
233
242
that does not behave as a pure wave (i.e.\ Coulomb type
234
243
terms caused by infall of the coordinate lines).
235
244
236
- This we do by comparing the source term one grid point
245
+ This we do by comparing the source term \code {nghostzones} grid points
237
246
away from the boundary (which we already have), to what
238
247
we would have obtained if we had used the boundary
239
- condition there. The difference gives us an idea of the
248
+ condition there. The difference gives us an idea of the
240
249
missing part and we extrapolate that to the boundary
241
250
assuming a power-law decay.
242
251
243
252
\section {Using This Thorn }
244
- The thorn exports two aliased functions \code {ExtrapolateGammas} and
245
- \code {NewRad \_ Apply} that should be used in \code {INITIAL} and
246
- \code {MoL \_ CalcRHS} respectively to extrapolate the contracted
247
- Christoffel symbols and apply radiative boundary conditions to evolved
248
- variables respectively .
253
+ The thorn provides the routine \code {NewRadX \_ Apply}, which should be scheduled
254
+ in the \code {ODESolvers \_ RHS} bin to apply radiative boundary conditions on
255
+ evolved variables. To use it in an evolution thorn, it can either be called
256
+ inside the RHS evaluation routine, or scheduled in a separate function right
257
+ after the RHS routine .
249
258
250
- There call signatures are :
259
+ The call signature is :
251
260
\begin {verbatim }
252
- CCTK_INT FUNCTION \
253
- ExtrapolateGammas \
254
- (CCTK_POINTER_TO_CONST IN cctkGH, \
255
- CCTK_REAL ARRAY INOUT var)
256
-
257
- CCTK_INT FUNCTION \
258
- NewRad_Apply \
259
- (CCTK_POINTER_TO_CONST IN cctkGH, \
260
- CCTK_REAL ARRAY IN var, \
261
- CCTK_REAL ARRAY INOUT rhs, \
262
- CCTK_REAL IN var0, \
263
- CCTK_REAL IN v0, \
264
- CCTK_INT IN radpower)
261
+ void NewRadX_Apply \
262
+ (const cGH *restrict const cctkGH, \
263
+ const Loop::GF3D2<const CCTK_REAL> var, \
264
+ Loop::GF3D2<CCTK_REAL> rhs, \
265
+ CCTK_REAL var0, \
266
+ CCTK_REAL v0, \
267
+ CCTK_REAL radpower)
265
268
\end {verbatim }
266
269
where \code {var0} corresponds to $ f_0 $ , \code {v0} is $ v$ and
267
270
\code {radpower} is the assumed decay exponent $ n$ .
268
271
269
272
\subsection {Obtaining This Thorn }
270
- The thorn is part of the EinsteinEvolve arrangement available on
271
- bitbucket .
273
+ The thorn is part of the \code {SpacetimeX} arrangement available on
274
+ GitHub .
272
275
\begin {verbatim }
273
- git clone git@bitbucket.org:einsteintoolkit/einsteinevolve .git
276
+ git clone git@github.com:lwJi/SpacetimeX .git
274
277
\end {verbatim }
275
278
276
279
\subsection {Basic Usage }
280
+ For an overview of the implementation and usage of this thorn, please
281
+ see~\cite {SpacetimeX_NewRadX_intro_presentation } for a presentation by
282
+ Alexandru Dima and Cheng-Hsin Cheng during the weekly \code {CarpetX}
283
+ developer meetings.
284
+
277
285
278
286
\subsection {Special Behaviour }
279
- If the parameter \code {z\_ is\_ radial} is set it assumes that the $ z$
280
- direction is a radial direction and uses this to evaluate the radial
281
- derivative in \eqref {eqn:EinsteinEvolve_NewRad_num_bc }. This is the case
282
- for the multi-patch coordinate systems provided by the
283
- \code {Llama}~\cite {EinsteinEvolve_NewRad_llamacode } infrastructure.
287
+ In contrast with the \code {Carpet}-version of \code {NewRad}, which updates
288
+ the RHS variables on the physical outer boundary of the simulation domain,
289
+ \code {NewRadX} updates them on the so-called `` outermost interior points'' .
290
+ These points are defined as the interior points which are located
291
+ \code {nghostzones} or fewer grid points from the outer boundary.
292
+ Therefore, the boundary conditions are effectively applied on a set of points
293
+ that are labelled as `` interior'' in \code {CarpetX}.
294
+ It is necessary to introduce this change because imposing a wave-like time
295
+ evolution on the \code {CarpetX} `` proper'' boundary points is incompatible with the
296
+ synchronization conducted by AMReX.
297
+
298
+
299
+ Currently, this thorn only supports single-patch, Cartesian grids provided by
300
+ \code {CarpetX}, but not multi-patch coordinate systems.
301
+
284
302
285
303
\subsection {Interaction With Other Thorns }
286
- This thorn requires thorn \code {GenericFD } which is part of
287
- \code {Kranc}~ \cite { EinsteinEvolve_NewRad_kranccode }.
304
+ This thorn requires thorn \code {Loop } which is part of
305
+ \code {CarpetX }.
288
306
289
307
\subsection {Examples }
290
- The best example is likely to inspect the source code \code {ML\_ BSSN}
291
- and \code {ML\_ BSSN\_ Helper}, namely:
308
+ The simplest example is likely to inspect the source code for
309
+ \code {TestNewRadX}, which is a thorn from \code {SpacetimeX} that tests the
310
+ boundary condition on the evolution of a scalar pulse on flat background.
311
+ Here the boundary conditions are applied in the RHS calculation routine
312
+ \code {TestNewRadX\_ RHS}, where \code {NewRadX\_ Apply} is called after the main
313
+ loop that updates the RHS of the state variables in the interior.
314
+
315
+ \begin {verbatim }
316
+ <configuration.ccl>
317
+ REQUIRES Loop NewRadX
318
+ \end {verbatim }
292
319
293
320
\begin {verbatim }
294
321
<interface.ccl>
295
- CCTK_INT FUNCTION \
296
- NewRad_Apply \
297
- (CCTK_POINTER_TO_CONST IN cctkGH, \
298
- CCTK_REAL ARRAY IN var, \
299
- CCTK_REAL ARRAY INOUT rhs, \
300
- CCTK_REAL IN var0, \
301
- CCTK_REAL IN v0, \
302
- CCTK_INT IN radpower)
303
- USES FUNCTION NewRad_Apply
322
+ USES INCLUDE HEADER: newradx.hxx
304
323
\end {verbatim }
305
324
306
325
\begin {verbatim }
307
326
<schedule.ccl>
308
- SCHEDULE ML_BSSN_NewRad IN MoL_CalcRHS AFTER ML_BSSN_EvolutionInterior
327
+ SCHEDULE TestNewRadX_RHS IN ODESolvers_RHS
309
328
{
310
329
LANG: C
311
- # No need to sync here -- the RHS variables are never synced
312
- } "Apply NewRad boundary conditions to RHS"
330
+ READS: state(everywhere)
331
+ WRITES: rhs(interior)
332
+ SYNC: rhs
333
+ } "Calculate scalar wave RHS"
313
334
\end {verbatim }
314
335
315
336
\begin {verbatim }
316
- <NewRad.cc>
317
- #include "cctk_Arguments.h"
318
- #include "cctk_Functions.h"
319
-
320
- void ML_BSSN_NewRad(CCTK_ARGUMENTS)
321
- {
322
- DECLARE_CCTK_ARGUMENTS;
337
+ <test_newradx.cxx>
338
+ #include <newradx.hxx>
339
+
340
+ extern "C" void TestNewRadX_RHS(CCTK_ARGUMENTS) {
341
+ DECLARE_CCTK_ARGUMENTSX_TestNewRadX_RHS;
342
+ DECLARE_CCTK_PARAMETERS;
343
+
344
+ /* First loop over the interior to update RHS of the state variables */
345
+ grid.loop_int_device<0, 0, 0>(grid.nghostzones,
346
+ [=] CCTK_DEVICE(const Loop::PointDesc &p)
347
+ CCTK_ATTRIBUTE_ALWAYS_INLINE {
348
+ uu_rhs(p.I) = vv(p.I);
349
+ vv_rhs(p.I) = Laplacian_4thorder(uu, p);
350
+ });
351
+
352
+ /* After RHS grid functions are updated, apply boundary conditions */
353
+ if (test_use_newradx) {
354
+ NewRadX::NewRadX_Apply(cctkGH, uu, uu_rhs, 0, 1, n_falloff);
355
+ NewRadX::NewRadX_Apply(cctkGH, vv, vv_rhs, 0, 1, n_falloff + 1);
356
+ }
323
357
324
- const int radpower = 2; // for example
325
-
326
- NewRad_Apply(cctkGH, gt12, gt12rhs, 0.0, 1.0, radpower);
327
358
}
328
359
\end {verbatim }
329
360
361
+
362
+ Other examples of \code {CarpetX} evolution thorns that use \code {NewRadX}
363
+ include \code {CanudaX\_ BSSNMoL}\cite {SpacetimeX_NewRadX_CanudaX_BSSNMoL }
364
+ and \code {Z4c}\cite {SpacetimeX_NewRadX_Z4c }.
365
+
366
+
330
367
\subsection {Support and Feedback }
331
368
Please use the Einstein Toolkit mailing list
332
369
\url {
[email protected] } to report issues and ask for help.
@@ -336,30 +373,42 @@ \section{History}
336
373
\subsection {Thorn Source Code }
337
374
\begin {itemize }
338
375
\item Initial version of method likely by Miguel Alcubierre;
339
- \item Carpet version of code by Erik Schnetter;
340
- \item CarpetX version of code by Cheng-Hsin Cheng, Jake Doherty, Michail Chabanov, Alexandru Dima.
376
+ \item \code {Carpet} version of code by Erik Schnetter;
377
+ \item \code {CarpetX} version of code by Cheng-Hsin Cheng, Jake Doherty,
378
+ Michail Chabanov, Alexandru Dima.
341
379
\end {itemize }
342
380
343
381
\subsection {Thorn Documentation }
344
382
\begin {itemize }
345
383
\item Initial version by Roland Haas using text by Miguel, Erik.
346
- \item Current version by Alexandru Dima.
384
+ \item Current version by Alexandru Dima and Cheng-Hsin Cheng .
347
385
\end {itemize }
348
386
349
387
\subsection {Acknowledgements }
350
- This documentation copies text from comments in the source code as well
351
- as the paper~\cite {EinsteinEvolve_NewRad_Alcubierre:2002kk }.
388
+ This documentation is based on the original one for the \code {Carpet} version
389
+ of \code {NewRad}, which copies text from comments in the source code as well
390
+ as the paper~\cite {SpacetimeX_NewRadX_Alcubierre:2002kk }.
352
391
353
392
\begin {thebibliography }{9}
354
- \bibitem {EinsteinEvolve_NewRad_Alcubierre:2002kk}
393
+
394
+ \bibitem {SpacetimeX_NewRadX_EinsteinEvolve} `` EinsteinEvolve`` ,
395
+ \url {https://bitbucket.org/einsteintoolkit/einsteinevolve}.
396
+
397
+ \bibitem {SpacetimeX_NewRadX_Alcubierre:2002kk}
355
398
M.~Alcubierre, B.~Bruegmann, P.~Diener, M.~Koppitz, D.~Pollney, E.~Seidel and R.~Takahashi,
356
399
`` Gauge conditions for long term numerical black hole evolutions without excision,''
357
400
Phys.\ Rev.\ D {\bf 67}, 084023 (2003)
358
401
doi:10.1103/PhysRevD.67.084023
359
402
[gr-qc/0206072].
360
- \bibitem {EinsteinEvolve_NewRad_kranccode} `` Kranc: Kranc assembles
361
- numerical code`` , \url {http://kranccode.org/}.
362
- \bibitem {EinsteinEvolve_NewRad_llamacode} `` The Llama code`` , \url {https://llamacode.bitbucket.io/}.
403
+
404
+ \bibitem {SpacetimeX_NewRadX_intro_presentation} `` NewRadX Intro`` ,
405
+ \url {https://github.com/eschnett/CarpetX/wiki/NewRadX-Intro}.
406
+
407
+ \bibitem {SpacetimeX_NewRadX_CanudaX_BSSNMoL} `` CanudaX\_ Lean`` ,
408
+ \url {https://bitbucket.org/canuda/canudax_lean}.
409
+
410
+ \bibitem {SpacetimeX_NewRadX_Z4c} `` Z4c'' ,
411
+ \url {https://github.com/lwJi/SpacetimeX/tree/main/Z4c}.
363
412
364
413
\end {thebibliography}
365
414
0 commit comments