# metricGet\_WarpShellComoving

## Description

Create the Warp Shell metric in a defined spacetime grid.

<details>

<summary>Warp Shell Metric</summary>

The Warp Shell uses a numerical solution that combines the lapse rate and spatial contraction of a regular matter shell with an Alcubeirre-like shift vector.&#x20;

The shell metric is defined by an inner and outer radius with a total ADM mass parameter. For a definition of ADM mass see: <https://arxiv.org/pdf/gr-qc/0609079>&#x20;

The shift vector is defined to exist on the interior at a constant value which transitions in the bubble region to zero by the outer bubble radius.  The equation for the transition function $$S(r)$$ is:

$$S(r) = \begin{cases} 1 & r < R\_1 + R\_b\ 1 - f(r) & R\_1 + R\_b < r < R\_2 - R\_b \ 0 & r > R\_2 - R\_b \end{cases}$$

where $$f(r)$$is given by:

$$f(r) = \left(\exp\left\[(R\_2 - R\_1)\left(\frac{1}{r - R\_2} + \frac{1}{r - R\_1}\right)\right] + 1\right)^{-1}$$

The metric lapse and spatial terms are solved numerically by considering a spherical solution with a constant density shell and enforced boundary of vacuum interior and exterior regions. The pressure is determined using the Tolman-Oppenheimer-Volkoff (TOV) equation, with the resulting pressure and density smoothed by an input smoothing factor to remove sharp-edged boundaries in the metric. These pressures and densities are then used to solve for the lapse and spatial terms of the metric in spherical coordinates. This spherical solution is translated into cartesian coordinates where the shift vector is then added.

The metric is defined in a comoving frame of a timelike observer that is comoving with the bubble.

</details>

For more details on the Warp Shell metric and its numerical process, please read:

{% embed url="<https://arxiv.org/abs/gr-qc/9905084>" %}

## Method

The metric is constructed using the parameters of ADM mass, shell radii, smoothing factor, and shift-vector. The metric relies on several helper functions that solve the necessary terms for the lapse and spatial contraction. Note that by setting the shift vector amount to zero this function will return a stable matter shell (or setting <mark style="color:blue;">`doWarp`</mark> to 0).

{% hint style="info" %}
This metric is only available in a comoving frame.
{% endhint %}

{% hint style="warning" %}
For the metric to satisfy the energy conditions, three important factors must be considered:

1. The amount of shift vector, along with its spatial change, must be balanced by the total ADM mass parameter selected. Adding more shifts or sharp changes in the shift vectors' radial distribution will cause an increase in momentum flux that can exceed the positive energy density in that region supplied by the ADM mass parameter.
2. The mass shell smoothing factor must be chosen to not cause energy violations on the inner boundary due to excessive pressures. Select the smoothing factors to adjust this amount, along with the inner and outer radius.&#x20;
3. The mass added into the region of the warp shell should not exceed the Schwarzchild radius limit to become a black hole.

See the Constant Velocity paper for a more detailed discussion of these aspects.&#x20;
{% endhint %}

The code for the specific instance of the metric discussed in the Constant Velocity paper is provided in the example [W1](https://applied-physics.gitbook.io/warp-factory/examples/warp-shell/w1-warp-shell-comoving).

## Syntax

`[`<mark style="color:green;">`metric`</mark>`] = metricGet_WarpShellComoving(`<mark style="color:blue;">`gridSize`</mark>`,`<mark style="color:blue;">`worldCenter`</mark>`,`<mark style="color:blue;">`M`</mark>`,`<mark style="color:blue;">`R1`</mark>`,`<mark style="color:blue;">`R2`</mark>`,`<mark style="color:blue;">`Rbuff`</mark>`,`<mark style="color:blue;">`sigma`</mark>` ``,`` `<mark style="color:blue;">`smoothfactor`</mark>` ``,`<mark style="color:blue;">`v`</mark>`,`` `<mark style="color:orange;">`doWarp`</mark>`,`` `<mark style="color:orange;">`gridScale`</mark>`)`

### Input Arguments

{% hint style="info" %} <mark style="color:blue;">blue</mark> are required inputs.

<mark style="color:orange;">orange</mark> are optional inputs with native default values.
{% endhint %}

<table><thead><tr><th width="187">Inputs</th><th width="108">Format</th><th width="95">Type</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:blue;"><code>gridSize</code></mark></td><td>1x4 array</td><td>integer</td><td><p>The size of the world specified as:</p><p></p><p><span class="math">[t, x, y, z]</span> </p></td></tr><tr><td><mark style="color:blue;"><code>worldCenter</code></mark></td><td>1x4 array</td><td>double</td><td><p>The center of the world, which defines the center of <span class="math">r_s</span> as a 4-vector, specified as:</p><p></p><p><span class="math">[t,x,y,z]</span></p></td></tr><tr><td><mark style="color:blue;"><code>M</code></mark></td><td>1x1 array</td><td>double</td><td>The ADM mass of the shell</td></tr><tr><td><mark style="color:blue;"><code>R1</code></mark></td><td>1x1 array</td><td>double</td><td>Inner radius of the shell</td></tr><tr><td><mark style="color:blue;"><code>R2</code></mark></td><td>1x1 array</td><td>double</td><td>Outer radius of the shell</td></tr><tr><td><mark style="color:blue;"><code>Rbuff</code></mark></td><td>1x1 array</td><td>double</td><td>Defines the buffer between radii and the start of the sigmoid transition.</td></tr><tr><td><mark style="color:blue;"><code>v</code></mark></td><td>1x1 array</td><td>double</td><td>Speed of the warp drive, given as a factor of c. This sets the magnitude of shift on the inside of the bubble.</td></tr><tr><td><mark style="color:blue;"><code>sigma</code></mark></td><td>1x1 array</td><td>double</td><td>Transition factor for the sigmoid.</td></tr><tr><td><mark style="color:blue;"><code>smoothfactor</code></mark></td><td>1x1 array</td><td>double</td><td>The smoothing factor used by the solver to compute the lapse and spatial terms.</td></tr><tr><td><mark style="color:orange;"><code>doWarp</code></mark></td><td>1x1 array</td><td>double</td><td>Setting to apply shift vector to the metric. Has values of 0 or 1<br><br><strong>The default value is 1</strong></td></tr><tr><td><mark style="color:orange;"><code>gridScale</code></mark></td><td>1x4 array</td><td>double</td><td><p>Unit scaling factor of the grid dimensions defined relative to <mark style="color:blue;"><code>gridSize</code></mark>.  This determines the resolution of the grid along each dimension. Specified as:</p><p></p><p><span class="math">[t_{scale}, x_{scale}, y_{scale}, z_{scale}]</span></p><p></p><p> <strong>The default value is [1, 1, 1, 1].</strong></p></td></tr></tbody></table>

### Output Arguments

<table><thead><tr><th width="151">Outputs</th><th width="113.33333333333331">Format</th><th width="93">Type</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:green;"><code>metric</code></mark></td><td>struct</td><td>object</td><td>Warp Shell solution returned as the metric tensor object.</td></tr></tbody></table>
