# doFrameTransfer

## Description

The stress-energy tensor when found by evaluating the metric is returned in the coordinate system aligned with the observers that defined the metric. The stress-energy tensor can be further transformed into different frames as it would be seen by different associated observers.

{% hint style="info" %}
Currently, only an **Eulerian Frame** transformation is implemented in Warp Factory.
{% endhint %}

<details>

<summary>Tetrad Formalism</summary>

Observers in general relativity are fully specified by a timelike vector and three spatial vectors, with the timelike vector usually specified as a four-velocity. This can also be put into a tetrad formalism, where each observer has a tetrad that is associated with their frame. The tetrad can be given as a matrix whose columns are constructed from the time vector or four-velocity $$e^{\mu}*{\hat{0}}$$of the observer and its spatial vectors $$e^{\mu}*{\hat{i}}$$:&#x20;

$$e^{\mu}*{\hat{\nu}} = \begin{pmatrix} e^{\mu}*{\hat{0}} & e^{\mu}*{\hat{1}} & e^{\mu}*{\hat{2}} & e^{\mu}\_{\hat{3}}  \end{pmatrix}$$

When evaluating the field equation from the metric tensor what is returned is the stress-energy as represented in the coordinate frame. Generally, we can express any frame's stress-energy tensor $$T\_{\hat{\mu}\hat{\nu}}$$ in terms of the coordinate tensor and the frame's tetrads: $$T\_{\hat{\mu}\hat{\nu}} = T\_{\mu\nu} e^{\mu}*{\hat{\mu}} e^{\nu}*{\hat{\nu}}$$

</details>

<details>

<summary>Eulerian Frame </summary>

A special set of observers is the set of *Eulerian Observers* which is defined as having a tetrad with a four-velocity that is orthogonal to the spatial hypersurface (not moving in space over time). Using 3+1 formalism this observer is defined as:

$$e^\mu\_{\hat{0}}   = n^\mu = \frac{1}{\alpha}\left(1,-\beta^1,-\beta^2,-\beta^3 \right), \ \ n\_\mu = \left(-\alpha,0,0,0\right)$$

</details>

## Method

### Eulerian Frame Transformation

The Eulerian transformation assumes a tetrad form which is a lower triangular matrix and uses the symbolic form of a solution that solves for the transformation that returns a Minkowski metric at all points in the spacetime.  The solution for the tetrad is then contracted with the tensor to perform the frame transformation. This setup assumes the spatial vectors by selecting that x is orthogonal to the coordinate y and z surface and the remaining spatial vectors are orthogonal to each other.&#x20;

{% hint style="warning" %}
The Eulerian transformation requires that the metric signature is (-,+,+,+) at all points, otherwise it will return imaginary results.&#x20;
{% endhint %}

## Syntax

`[`<mark style="color:green;">`transformedEnergyTensor`</mark>`] = doFrameTransfer(`<mark style="color:blue;">`metric`</mark>`,`` `<mark style="color:blue;">`energyTensor`</mark>`,`` `<mark style="color:blue;">`frame`</mark>`,`` `<mark style="color:orange;">`tryGPU`</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="178">Inputs</th><th width="94">Format</th><th width="113">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 object.</td></tr><tr><td><mark style="color:blue;"><code>energyTensor</code></mark> </td><td>struct</td><td>object</td><td>Input stress-energy tensor object.</td></tr><tr><td><mark style="color:blue;"><code>frame</code></mark></td><td>1x1 array</td><td>string</td><td>Selected frame to transform the metric to, <strong>currently only "Eulerian" input can be used.</strong></td></tr><tr><td><mark style="color:orange;"><code>tryGPU</code></mark></td><td>1x1 array</td><td>integer</td><td>Use the GPU for evaluations, input either 1 for true or 0 for false. <strong>The default value is 0.</strong></td></tr></tbody></table>

### Output Arguments

<table><thead><tr><th width="295">Outputs</th><th width="86.33333333333331">Format</th><th width="86">Type</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:green;"><code>transformedEnergyTensor</code></mark></td><td>struct</td><td>object</td><td>Returns the new energy tensor as seen in the transformed frame.</td></tr></tbody></table>
