Skip to content

What do expressions look like?

Matt Larsen edited this page Aug 24, 2019 · 8 revisions

This is a scratch pad for the types of expressions we want to support.

Reduction expressions (triggers, queries, or filter parameters)

An expression that reduces to a single variable. Example types:

  • bool (stored as an integer)
  • integer
  • double
  • vec3

Ex

Queries

Queries compute the result of an expression and stores the result into an identifier that can be accessed by other queries or triggers. This result can be any supported types (e.g., scalars or something more complex like a histogram). These named identifiers can serve as the building blocks for more complicated expressions.

Triggers

Triggers evaluate an expression that results in a boolean value. If true, a set of Ascent actions are executed.

History

Since queries and triggers are actions within ascent, they execute many times during a simulation run, and with that comes a time history of each query that can be accessed.

Example syntax:

  • bool: max("pressure") > 10.0
  • integer: 1 + 1
  • double: pow(1.0,0.5), magnitude(vec3(1.0, 2.0, 3.0) - coordinate(max("pressure")))
  • vec3: coordinate(max("pressure"))

Variable expressions (computing a new field on the mesh)

Clone this wiki locally