> 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/evalmetric.md).

# evalMetric

## Description

The function evaluates the common analysis functions of the metric tensor. It returns the stress-energy tensor in coordinate and Eulerian frame, the energy conditions, and the metric scalars.

## Method

evalMetric runs several solver and analysis functions and packages the output into a struct for the user.

## Syntax

`[`<mark style="color:green;">`output`</mark>`] = evalMetric(`<mark style="color:blue;">`metric`</mark>`,`` `<mark style="color:orange;">`tryGPU`</mark>`,`` `<mark style="color:orange;">`keepPositive`</mark>`,`` `<mark style="color:orange;">`numAngularVec`</mark>`,`` `<mark style="color:orange;">`numTimeVec`</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="197">Inputs</th><th width="94">Format</th><th width="97">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><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><tr><td><mark style="color:orange;"><code>keepPositive</code></mark></td><td>1x1 array</td><td>integer</td><td>Selects if the energy condition output only returns positive violation values. Input either 1 for true or 0 for false, returning positive and negative values. <strong>The default value is 1.</strong></td></tr><tr><td><mark style="color:orange;"><code>numAngularVec</code></mark></td><td>1x1 array</td><td>integer</td><td>The number of spatial vectors used for energy conditions. <strong>The default value is 100.</strong></td></tr><tr><td><mark style="color:orange;"><code>numTimeVec</code></mark></td><td>1x1 array</td><td>integer</td><td>The number of time vectors used for energy conditions. <strong>The default value is 10.</strong></td></tr></tbody></table>

### Output Arguments

<table><thead><tr><th width="116">Outputs</th><th width="86.33333333333331">Format</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:green;"><code>output</code></mark></td><td>struct</td><td>object</td><td>Returns a struct with the following fields:<br><code>.metric</code>: metric tensor<br><code>.energyTensor</code>: stress-energy tensor in the coordinate frame<br><code>.energyTensorEulerian</code>: stress-energy tensor in the Eulerian frame<br><code>.null</code>: null energy condition<br><code>.weak</code>: weak energy condition<br><code>.strong</code>: strong energy condition<br><code>.dominant</code>: dominant energy condition<br><code>.expansion</code>: expansion scalar<br><code>.shear</code>: shear scalar<br><code>.vorticity</code>: vorticity scalar</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/evalmetric.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.
