## EinsteinExact

10 May 2012

Abstract

The EinsteinExact arrangement provides a collection of thorns which compute exact solutions to the Einstein equation and set the $3+1$ ADM variables provided by the ADMBase thorn. The solutions may be computed either as initial data, or at each iteration of an evolution. The computation is done analytically from expressions for the metric which are taken from a database of solutions provided by the Metrics package for Mathematica. Adding new solutions to EinsteinExact only requires that the metric be added to this database.

### 1 Introduction

The EinsteinExact code relies on the fact that a given analytic expression for the $4$-metric ${g}_{ab}$ (and its inverse ${g}^{ab}$) of a spacetime may be decomposed into the $3+1$ ADM variables,

 ${g}_{ab}=\left(\begin{array}{cc}\hfill -{\alpha }^{2}+{\beta }_{k}{\beta }^{k}\hfill & \hfill {\beta }_{i}\hfill \\ \hfill {\beta }_{i}\hfill & \hfill {\gamma }_{ij}\hfill \\ \hfill \hfill \end{array}\right),\phantom{\rule{1em}{0ex}}{g}^{ab}=\left(\begin{array}{cc}\hfill -1∕{\alpha }^{2}\hfill & \hfill {\beta }^{i}∕{\alpha }^{2}\hfill \\ \hfill {\beta }^{i}∕{\alpha }^{2}\hfill & \hfill {\gamma }^{ij}-{\beta }^{i}{\beta }^{j}∕{\alpha }^{2}\hfill \\ \hfill \hfill \end{array}\right),$ (1)

where $\alpha$ is the lapse, ${\beta }^{i}$ is the shift and ${\gamma }_{ij}$ is the three metric on the slice. The ADMBase variables for the lapse, shift and three metric may therefore be directly obtained from components of the four metric and its inverse:

 $\alpha =\frac{1}{\sqrt{-{g}_{00}}},\phantom{\rule{1em}{0ex}}{\beta }^{i}={\alpha }^{2}{g}^{0i},\phantom{\rule{1em}{0ex}}{\gamma }_{ij}={g}_{ij}.$ (2)

Another ADMBase variable which must be set is the extrinsic curvature ${K}_{ij}$. This may be written as

 ${K}_{ij}=-\frac{1}{2\alpha }{\mathsc{ℒ}}_{\alpha \stackrel{\to }{n}}{\gamma }_{ij}$ (3)

where $\mathsc{ℒ}$ is the Lie derivative and $\stackrel{\to }{n}$ is the normal to the slice. Explicitly expanding this out gives

$\begin{array}{llll}\hfill {K}_{ij}=& \frac{1}{2\alpha }\left(-{\partial }_{t}{\gamma }_{ij}+{D}_{i}{\beta }_{j}+{D}_{j}{\beta }_{i}\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill =& \frac{1}{2\alpha }\left(-{\partial }_{t}{\gamma }_{ij}+{\beta }^{k}{\partial }_{k}{\gamma }_{ij}+{\gamma }_{ik}{\partial }_{j}{\beta }^{k}+{\gamma }_{kj}{\partial }_{i}{\beta }^{k}\right)\phantom{\rule{2em}{0ex}}& \hfill \text{(4)}\phantom{\rule{0.33em}{0ex}}\end{array}$

which is readily computed from the previous analytic expressions for $\alpha$, ${\beta }^{i}$ and ${\gamma }_{ij}$. Finally, the ADMBase variables for the time derivatives for the lapse and shift are computed by analytically differentiating $\alpha$ and ${\beta }^{i}$ with respect to $t$.

### 2 Obtaining EinsteinExact

The latest version of EinsteinExact will always be available from the project git repository:

git clone git://github.com/barrywardell/EinsteinExact

### 3 Using EinsteinExact

The EinsteinExact thorns are designed to work with Cactus as part of the Einstein Toolkit. All requirements are therefore already included with the Einstein Toolkit.

To use an EinsteinExact thorn, include the thorn for your desired spacetime in your thornlist and in the ActiveThorns section of your parameter file and set either the ADMBase::initial_data or ADMBase::evolution_method parameters (or both) described below. It is also necessary to set the ADMBase::initial_lapse, ADMBase::initial_dtlapse, ADMBase::initial_shift and ADMBase::initial_dtshift parameters in order for storage to be allocated for all ADMBase variables set by EinsteinExact.

As each thorn sets the ADM variables for a specific spacetime in some particular coordinate system it only makes sense to have one thorn in the arrangement activated at a time.

### 4 Common parameters

Although there is a separate Cactus thorn for each supported spacetime, all thorns are generated from the same Kranc script and therefore share some common parameters. The parameters supported by all thorns are listed in this section.

The ADM variables can be set by EinsteinExact as initial data for an evolution. Each EinsteinExact thorn extends the ADMBase::initial_data keyword parameter with another option corresponding to the name of the thorn. If the parameter is set to the thorn name, then initial data for the ADM variables will be set by the thorn in the ADMBase_InitialData schedule bin.

The setting of the ADM variables can optionally be done at each step in an evolution. Each EinsteinExact thorn extends the ADMBase::evolution_method keyword parameter with another option corresponding to the name of the thorn. If the parameter is set to the thorn name, then the ADM variables will be set by the thorn at each iteration during the ANALYSIS schedule bin.

Each EinsteinExact thorn extends this keyword parameter with another option corresponding to the name of the thorn. This parameter is currently ignored by the EinsteinExact code but must be set nonetheless in order to ensure storage is allocated for the lapse variable.

Each EinsteinExact thorn extends this keyword parameter with another option corresponding to the name of the thorn. This parameter is currently ignored by the EinsteinExact code but must be set nonetheless in order to ensure storage is allocated for the shift variables.

Each EinsteinExact thorn extends this keyword parameter with another option corresponding to the name of the thorn. This parameter is currently ignored by the EinsteinExact code but must be set nonetheless in order to ensure storage is allocated for the dtlapse variable.

Each EinsteinExact thorn extends this keyword parameter with another option corresponding to the name of the thorn. This parameter is currently ignored by the EinsteinExact code but must be set nonetheless in order to ensure storage is allocated for the dtshift variables.

##### 4.0.7 Origin: timeoffset, positionx, positiony, positionz

These parameters specify the position at which the origin of the spacetime should be located.

##### 4.0.8 Lapse: lapsefactor

Factor that should rescale the lapse such that ${\alpha }^{\prime }=\frac{1}{\text{}\mathtt{\text{lapsefactor}}}\phantom{\rule{0.33em}{0ex}}\alpha$. This has the effect of rescaling the time coordinate so that ${t}^{\prime }=\text{}\mathtt{\text{lapsefactor}}\phantom{\rule{0.33em}{0ex}}t$. Note that this also has the effect of rescaling the shift by a factor $\frac{1}{\text{}\mathtt{\text{lapsefactor}}}$ (see xform.nb for more details).

Shift that should be added to the metric. This has the effect of adding an offset to the spatial coordinates so that ${x}^{\prime }=x-\text{}\mathtt{\text{shiftaddx}}\phantom{\rule{0.33em}{0ex}}{t}^{\prime }$, ${y}^{\prime }=y-\text{}\mathtt{\text{shiftaddy}}\phantom{\rule{0.33em}{0ex}}{t}^{\prime }$, ${z}^{\prime }=z-\text{}\mathtt{\text{shiftaddz}}\phantom{\rule{0.33em}{0ex}}{t}^{\prime }$ (see xform.nb for more details).

##### 4.0.10 Lorentz Boost: boostx, boosty, boostz

Lorentz-boost the spacetime by a velocity ${v}^{i}=\left[\text{}\mathtt{\text{boostx}},\text{}\mathtt{\text{boosty}},\text{}\mathtt{\text{boostz}}\right]$. This applies a Lorentz boost transformation to the coordinates of the form

 $\left[\begin{array}{c}\hfill {t}^{\prime }\hfill \\ \hfill {r}^{\prime }\hfill \end{array}\right]=\left[\begin{array}{cc}\hfill \gamma \hfill & \hfill -\gamma {\beta }^{}\hfill \end{array}T\hfill -\gamma \beta \hfill & \hfill I+{\gamma }^{2}∕\left(\gamma +1\right)\beta {\beta }^{}T\hfill \\ \hfill \hfill \right]\left[\begin{array}{c}\hfill t\hfill \\ \hfill r\hfill \end{array}\right].$ (5)

##### 4.0.11 Rotation: theta, phi, psi

The spacetime may have an arbitrary $3$D rigid rotation applied to it. This rotation is specified by the theta, phi and psi parameters which correspond to the Euler angles of the rotation. The conventions used are such that the rotations are given by the three rotation matrices :

$\begin{array}{llll}\hfill {R}_{\varphi }=& \left(\begin{array}{ccc}\hfill \mathrm{cos}\left(\varphi \right)\hfill & \hfill \mathrm{sin}\left(\varphi \right)\hfill & \hfill 0\hfill \\ \hfill -\mathrm{sin}\left(\varphi \right)\hfill & \hfill \mathrm{cos}\left(\varphi \right)\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill \\ \hfill \hfill \end{array}\right),\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {R}_{𝜃}=& \left(\begin{array}{ccc}\hfill 1\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill \mathrm{cos}\left(𝜃\right)\hfill & \hfill \mathrm{sin}\left(𝜃\right)\hfill \\ \hfill 0\hfill & \hfill -\mathrm{sin}\left(𝜃\right)\hfill & \hfill \mathrm{cos}\left(𝜃\right)\hfill \\ \hfill \hfill \end{array}\right),\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {R}_{\psi }=& \left(\begin{array}{ccc}\hfill \mathrm{cos}\left(\psi \right)\hfill & \hfill \mathrm{sin}\left(\psi \right)\hfill & \hfill 0\hfill \\ \hfill -\mathrm{sin}\left(\psi \right)\hfill & \hfill \mathrm{cos}\left(\psi \right)\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill \\ \hfill \hfill \end{array}\right).\phantom{\rule{2em}{0ex}}& \hfill \text{(6)}\phantom{\rule{0.33em}{0ex}}\end{array}$

### 5 Included spacetimes

This section lists all spacetimes currently supported by EinsteinExact.

#### 5.1 GaugeWave

Description: 4D flat spacetime in Cartesian gauge wave coordinates
Thorn name: GaugeWave
Parameters: amp, period
Metric:

 ${g}_{ab}=\left(\begin{array}{cccc}\hfill amp\mathrm{sin}\left(\frac{2\pi \left(x-t\right)}{period}\right)-1\hfill & \hfill 0\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 1-amp\mathrm{sin}\left(\frac{2\pi \left(x-t\right)}{period}\right)\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill \\ \hfill \hfill \end{array}\right)$ (7)

#### 5.2 KerrSchild

Description: Kerr spacetime in Kerr-Schild coordinates
Thorn name: KerrSchild
Parameters: M, a
Metric:

 ${g}_{ab}=\left(\begin{array}{cccc}\hfill \frac{2M{r}^{3}}{{a}^{2}{z}^{2}+{r}^{4}}-1\hfill & \hfill \frac{2M{r}^{3}\left(ay+rx\right)}{\left({a}^{2}+{r}^{2}\right)\left({a}^{2}{z}^{2}+{r}^{4}\right)}\hfill & \hfill \frac{2M{r}^{3}\left(ry-ax\right)}{\left({a}^{2}+{r}^{2}\right)\left({a}^{2}{z}^{2}+{r}^{4}\right)}\hfill & \hfill \frac{2M{r}^{2}z}{{a}^{2}{z}^{2}+{r}^{4}}\hfill \\ \hfill \frac{2M{r}^{3}\left(ay+rx\right)}{\left({a}^{2}+{r}^{2}\right)\left({a}^{2}{z}^{2}+{r}^{4}\right)}\hfill & \hfill \frac{2M{r}^{3}{\left(ay+rx\right)}^{2}}{{\left({a}^{2}+{r}^{2}\right)}^{2}\left({a}^{2}{z}^{2}+{r}^{4}\right)}+1\hfill & \hfill \frac{2M{r}^{3}\left(ay+rx\right)\left(ry-ax\right)}{{\left({a}^{2}+{r}^{2}\right)}^{2}\left({a}^{2}{z}^{2}+{r}^{4}\right)}\hfill & \hfill \frac{2M{r}^{2}z\left(ay+rx\right)}{\left({a}^{2}+{r}^{2}\right)\left({a}^{2}{z}^{2}+{r}^{4}\right)}\hfill \\ \hfill \frac{2M{r}^{3}\left(ry-ax\right)}{\left({a}^{2}+{r}^{2}\right)\left({a}^{2}{z}^{2}+{r}^{4}\right)}\hfill & \hfill \frac{2M{r}^{3}\left(ay+rx\right)\left(ry-ax\right)}{{\left({a}^{2}+{r}^{2}\right)}^{2}\left({a}^{2}{z}^{2}+{r}^{4}\right)}\hfill & \hfill \frac{2M{r}^{3}{\left(ry-ax\right)}^{2}}{{\left({a}^{2}+{r}^{2}\right)}^{2}\left({a}^{2}{z}^{2}+{r}^{4}\right)}+1\hfill & \hfill \frac{2M{r}^{2}z\left(ry-ax\right)}{\left({a}^{2}+{r}^{2}\right)\left({a}^{2}{z}^{2}+{r}^{4}\right)}\hfill \\ \hfill \frac{2M{r}^{2}z}{{a}^{2}{z}^{2}+{r}^{4}}\hfill & \hfill \frac{2M{r}^{2}z\left(ay+rx\right)}{\left({a}^{2}+{r}^{2}\right)\left({a}^{2}{z}^{2}+{r}^{4}\right)}\hfill & \hfill \frac{2M{r}^{2}z\left(ry-ax\right)}{\left({a}^{2}+{r}^{2}\right)\left({a}^{2}{z}^{2}+{r}^{4}\right)}\hfill & \hfill \frac{2Mr{z}^{2}}{{a}^{2}{z}^{2}+{r}^{4}}+1\hfill \\ \hfill \hfill \end{array}\right)$ (8)

where

 $r\left(x,y,z\right)=\frac{\sqrt{\sqrt{{\left(-{a}^{2}+{x}^{2}+{y}^{2}+{z}^{2}\right)}^{2}+4{a}^{2}{z}^{2}}-{a}^{2}+{x}^{2}+{y}^{2}+{z}^{2}}}{\sqrt{2}}$ (9)

#### 5.3 Minkowski

Description: 4D flat spacetime in Cartesian coordinates
Thorn name: Minkowski
Metric:

 ${g}_{ab}=\left(\begin{array}{cccc}\hfill -1\hfill & \hfill 0\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 1\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill \\ \hfill \hfill \end{array}\right)$ (10)

#### 5.4 ShiftedGaugeWave

Description: 4D flat spacetime in Cartesian shifted gauge wave coordinates
Thorn name: ShiftedGaugeWave
Parameters: amp, period
Metric:

 ${g}_{ab}=\left(\begin{array}{cccc}\hfill amp\mathrm{sin}\left(\frac{2\pi \left(x-t\right)}{period}\right)-1\hfill & \hfill -amp\mathrm{sin}\left(\frac{2\pi \left(x-t\right)}{period}\right)\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill -amp\mathrm{sin}\left(\frac{2\pi \left(x-t\right)}{period}\right)\hfill & \hfill amp\mathrm{sin}\left(\frac{2\pi \left(x-t\right)}{period}\right)+1\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill \\ \hfill \hfill \end{array}\right)$ (11)

#### 5.5 Vaidya

Description: A Vaidya spacetime with mass function m(v) = M (1 + Tanh[v dM / M]${}^{\wedge }$2)
Thorn name: Vaidya2
Parameters: M, dM
Metric:

 ${g}_{ab}=\left(\begin{array}{cccc}\hfill \frac{2m}{r}-1\hfill & \hfill \frac{2mx}{{r}^{2}}\hfill & \hfill \frac{2my}{{r}^{2}}\hfill & \hfill \frac{2mz}{{r}^{2}}\hfill \\ \hfill \frac{2mx}{{r}^{2}}\hfill & \hfill \frac{2m{x}^{2}}{{r}^{3}}+1\hfill & \hfill \frac{2mxy}{{r}^{3}}\hfill & \hfill \frac{2mxz}{{r}^{3}}\hfill \\ \hfill \frac{2my}{{r}^{2}}\hfill & \hfill \frac{2mxy}{{r}^{3}}\hfill & \hfill \frac{2m{y}^{2}}{{r}^{3}}+1\hfill & \hfill \frac{2myz}{{r}^{3}}\hfill \\ \hfill \frac{2mz}{{r}^{2}}\hfill & \hfill \frac{2mxz}{{r}^{3}}\hfill & \hfill \frac{2myz}{{r}^{3}}\hfill & \hfill \frac{2m{z}^{2}}{{r}^{3}}+1\hfill \\ \hfill \hfill \end{array}\right)$ (12)

where

 $r\left(x,y,z\right)=\sqrt{{x}^{2}+{y}^{2}+{z}^{2}}$ (13)
 $m\left(t,x,y,z\right)=M\left({\mathrm{tanh}}^{2}\left(\frac{dM\left(t+\sqrt{{x}^{2}+{y}^{2}+{z}^{2}}\right)}{M}\right)+1\right)$ (14)

#### 5.6 ModifiedSchwarzschildBL

Description: Modified Schwarzschild spacetime in Brill-Lindquist coordinates with a radially dependent mass inside the black hole
Thorn name: ModifiedSchwarzschildBL
Parameters: M, epsilon
Metric:

 ${g}_{ab}=\left(\begin{array}{cccc}\hfill -1\hfill & \hfill 0\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill {\left(1+\frac{M\left(r\right)}{2r}\right)}^{4}\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill {\left(1+\frac{M\left(r\right)}{2r}\right)}^{4}\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 0\hfill & \hfill {\left(1+\frac{M\left(r\right)}{2r}\right)}^{4}\hfill \\ \hfill \hfill \end{array}\right)$ (15)

where

 $r\left(x,y,z\right)=\sqrt{{x}^{2}+{y}^{2}+{z}^{2}}$ (16)
 $M\left(r\right)=\left\{\begin{array}{cc}4r-\frac{8\frac{{r}^{2}}{2}+\left[\mathrm{cos}\left(\frac{4\pi r}{M}\right)-1\right]{\left(\frac{M}{4\pi }\right)}^{2}}{M}\hfill & \hfill :r (17)

### 6 Modifying EinsteinExact

#### 6.1 Generating the code

The script which generates the thorns requires the Kranc and Metrics Mathematica packages to be installed. Kranc is included with the Einstein Toolkit and the Metrics package is included in the Metrics directory.

To regenerate the code make from within the m directory.

To add a new spacetime to EinsteinExact, simply create a new file for the spacetime under m/Metrics/metrics/ and then add this spacetime to the thorns = and spacetimes = lines at the end of the Kranc script in m/EinsteinExact.m. Also consider adding a regression test to the EinsteinExact_test thorn and correctness tests under the tests directory.

If you think this spacetime would be of use to others, please consider submitting a patch. As all of the spacetimes in the EinsteinExact arrangement come from them Metrics database it is highly preferable to have new spacetimes added to the upstream repository for the Metrics package. The version of the Metrics package used by EinsteinExact can then be updated.

#### 6.3 Updating the Metrics database

The Metrics database exists as a separate git repository. For convenience, a version of it is included with EinsteinExact under the m/Metrics directory. This is a version of the standalone Metrics repository which has been merged using the git-subtree command1 .

If a new version of the Metrics package becomes available, the version in the EinsteinExact repository may be updated using the following command:

git subtree pull --prefix=m/Metrics --squash git://github.com/barrywardell/Metrics master

This will pull in new changes from the Metrics repository and merge them with the EinsteinExact repository under the m/Metrics directory.

### 7 Tests

#### 7.1 Correctness tests

There are correctness tests for the EinsteinExact thorns under the tests directory. These tests include:

• Checks that the solutions provided by the Exact thorn converge to those provided by each of the EinsteinExact thorns at the appropriate order.
• Checks that the constraints for the solutions provided by each of the EinsteinExact converge to $0$ at the appropriate order.

In addition, the Metrics package has independent correctness tests which check that the provided metrics are correct.

#### 7.2 Regression tests

Each thorn provided by EinsteinExact has a corresponding regression test in the EinsteinExact_code thorn which checks that no new bugs are introduced in the code.

### 8 Acknowledgments

Erik Schnetter contributed helpful comments and suggestions, along with some patches for the code.

### References

   Eric W. Weisstein, Euler Angles, MathWorld–A Wolfram Web Resource. http://mathworld.wolfram.com/EulerAngles.html