# getMomentumFlowLines

## Description

The stress-energy tensor momentum flux components structure can be visualized by treating the values as a vector field and creating paths along the field.

<details>

<summary>Momentum Flowlines</summary>

The momentum flow field $$\Omega^\mu$$is constructed from the given stress-energy tensor as:

$$\Omega^\mu(X) = \left(T^{01}(X), T^{02}(X), T^{03}(X)\right)$$

</details>

## Method

The flowlines are found by forward-stepping trajectories through the vector field of the momentum flux components. This currently assumes a static stress-energy tensor without time variation, where the timesteps of the flowlines are a virtual timestep, not a step through the time slices of the stress-energy tensor. Newton's method is used to solve the steps.

## Syntax

`[`<mark style="color:green;">`paths`</mark>`] = getMomentumFlowLines(`<mark style="color:blue;">`energyTensor`</mark>`,`` `<mark style="color:blue;">`startPoints`</mark>`,`` `<mark style="color:blue;">`stepSize`</mark>`,`` `<mark style="color:blue;">`maxSteps`</mark>`,`` `<mark style="color:blue;">`ScaleFactor`</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="191">Inputs</th><th width="106">Format</th><th width="126">Type</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:blue;"><code>energyTensor</code></mark> </td><td>struct</td><td>object</td><td>Input stress-energy tensor.</td></tr><tr><td><mark style="color:blue;"><code>startPoints</code></mark> </td><td>1x3 cell of 1xN array</td><td>double</td><td>Starting locations for the flowlines, are given as {x, y, z} points on the spatial hypersurface (3D coordinates). The points for each cell are in the 1 x N array. <strong>Each cell should have a 1 x N array of the same size N.</strong></td></tr><tr><td><mark style="color:blue;"><code>stepSize</code></mark></td><td>1x1 array</td><td>double</td><td>The step size that is used in the forward step of the Newton solver.</td></tr><tr><td><mark style="color:blue;"><code>ScaleFactor</code></mark></td><td>1x1 array</td><td>double</td><td>Scales the value of the momentum flux components.</td></tr></tbody></table>

### Output Arguments

<table><thead><tr><th width="126">Outputs</th><th width="110.33333333333331">Format</th><th width="95">Type</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:green;"><code>paths</code></mark></td><td>1x3 cell of 1xN array</td><td>double</td><td>Returns each path as a new cell index with an array of vectors for each 3D coordinate of the flowline path up to the max step (N &#x3C; <mark style="color:blue;"><code>maxSteps</code></mark>). Note that if the path reaches world boundaries the flowline is terminated. </td></tr></tbody></table>
