# getScalars

## Description

The properties of the metric can be explored by comparing geometric properties such as the expansion, shear, and vorticity scalars. Each of these scalars is built from the metric tensor and evaluated at each point in spacetime using projections of the metric on a timelike vector field.&#x20;

<details>

<summary>Expansion Scalar</summary>

The expansion scalar is a quantity that describes the change in the volume of a region. We define this scalar $$\theta$$ as:

$$\theta = g^{\mu\nu}\theta\_{\mu\nu}$$

where $$\theta\_{\mu\nu}$$ is the stress tensor found from the projection tensor $$P^\alpha\_\mu$$ acting on the observer vector field $$U^\mu$$ as&#x20;

$$\theta\_{\mu\nu} = P^\alpha\_\mu P^\beta\_\nu \nabla\_{(\alpha} U\_{\beta)}$$

and the projection tensor is given by:&#x20;

$$P\_{\mu\nu} = g\_{\mu\nu} + U\_\mu U\_\nu$$

</details>

<details>

<summary>Shear Scalar</summary>

The shear scalar is a quantity that describes the relative stretching while preserving the volume of an object. The shear scalar $$\sigma^2$$ is defined as:

$$\sigma^2 = \frac{1}{2} \sigma\_{\mu\nu} \sigma^{\mu\nu}$$

where $$\sigma\_{\mu\nu}$$ is the shear tensor found from the stress tensor and projection tensor$$P\_{\mu\nu}$$, shear tensor $$\theta\_{\mu\nu}$$ and shear scalar $$\theta$$ as:&#x20;

$$\sigma\_{\mu\nu} = \theta\_{\mu\nu} - \frac{\theta}{3} P\_{\mu\nu}$$

</details>

<details>

<summary>Vorticity Scalar</summary>

The vorticity scalar is the magnitude of the twist in spacetime, given by:

$$\omega^2 = \frac{1}{2}\omega\_{\mu\nu}\omega^{\mu\nu}$$

Where $$\omega\_{\mu\nu}$$ is the vorticity tensor found from the projection tensor as

$$\omega\_{\mu\nu} = P^\alpha\_\mu P^\beta\_\nu \nabla\_{\[\alpha} U\_{\beta]}.$$

</details>

## Method

The finite difference methods are used to compute the covariant derivatives for the metric scalars. The 3+1 function is also used to define the observer vector field.

{% hint style="info" %}
Currently, only the Eulerian observer vector field is used in Warp Factory.
{% endhint %}

{% hint style="info" %}
The Eulerian observer vector field results in a Vorticity Scalar that is always zero (within the numerical noise threshold).
{% endhint %}

## Syntax

`[`<mark style="color:green;">`expansionScalar`</mark>`,`` `<mark style="color:green;">`shearScalar`</mark>`,`` `<mark style="color:green;">`vorticityScalar`</mark>`] = getScalars(`<mark style="color:blue;">`metric`</mark>`)`

### Input Arguments

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

<table><thead><tr><th width="232">Inputs</th><th width="94">Format</th><th width="106">Type</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:blue;"><code>Metric</code></mark></td><td>struct</td><td>object</td><td>Input metric tensor.</td></tr></tbody></table>

### Output Arguments

<table><thead><tr><th width="221">Outputs</th><th width="120.33333333333331">Format</th><th width="92">Type</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:green;"><code>expansionScalar</code></mark></td><td>4x4 array</td><td>double</td><td>Returned expansion scalar at all spacetime points.</td></tr><tr><td><mark style="color:green;"><code>shearScalar</code></mark></td><td>4x4 array</td><td>double</td><td>Returned shear scalar at all spacetime points.</td></tr><tr><td><mark style="color:green;"><code>vorticityScalar</code></mark></td><td>4x4 array</td><td>double</td><td>Returned vorticity scalar at all spacetime points.</td></tr></tbody></table>
