> For the complete documentation index, see [llms.txt](https://applied-physics.gitbook.io/warp-factory/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://applied-physics.gitbook.io/warp-factory/modules/analyzer-module/getmomentumflowlines.md).

# 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>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://applied-physics.gitbook.io/warp-factory/modules/analyzer-module/getmomentumflowlines.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
