subset by expression

subset by expression

The subset by expression module creates a subset of the input grid with the same dimensionality. It can receive a field model with cells which are points, lines, surfaces and/or volumes, and its output will be a subset of the same type of cells.

Subset by expression is different from plume in that it outputs entire cells, making its output “lego-like”.

It uses a mathematical expression, allowing you to do complex subsetting calculations on coordinates and multiple data components with a single module, which can dramatically simplify your network and reduce memory usage. It has two floating point variables (N1, N2) which are connected to ports so they can be easily animated.

Variables:

When subsetting by nodal data, the expression can use X, Y and Z (the node coordinates), NodeNumber (the overall node number), and D0, D1, … (the nodal data components of the input). When subsetting by cell data, the expression can use X, Y and Z (the cell coordinates), CellNumber (the overall cell number), and D0, D1, … (the cell data components of the input). The Nodal Subset Variables and Cell Subset Variables lists show the variable name assigned to each data component.

Operators:

  • == Equal to
  • < Less than
  • > Greater than
  • <= Less than or equal to
  • >= Greater than or equal to
  • or
  • and
  • in (as in list)

Example Expressions:

  • If Nodal Data is selected:
    • D0 >= N1: all nodes with the first analyte greater than or equal to N1 will be used for inclusion determination.
    • (D0 < N1) or (D1 < N2): all nodes with the first analyte less than N1 OR the second analyte less than N2 will be used for inclusion determination.
  • If Cell Data is selected:
    • D1 in [0, 2] where D1 is Layer will give you the uppermost and third layers.
    • D1 in [1] where D1 is Layer will give you the middle layer.
    • D1 == 0 where D1 is Layer will give you the uppermost layer.
    • D1 >= 1 where D1 is Layer will give you all but the uppermost layer.

Ports

DirectionNameTypeDescription
InputInput FieldFieldThe field to use when calculating the expression.
InputInput Number Variable 1NumberA value used as a variable in the expression.
InputInput Number Variable 2NumberA value used as a variable in the expression.
OutputOutputFieldFieldThe field created when applying the expression with the result being false.
OutputOutput Number Variable 1NumberA value used as a variable in the expression.
OutputOutput Number Variable 2NumberA value used as a variable in the expression.
OutputOutput ObjectRenderableA renderable object to display.

Properties

PropertyTypeDescription
Allow RunBooleanPrevents the module from running when turned off.
ExecuteButtonCauses the module to run one time even if Allow Run has been turned off.
Subset ByChoice: Nodal Data, Cell DataChooses which criteria to use for subsetting cells.
N1DoubleA value usable by the expression. It may be passed in via the Input Number Variable 1 port.
N2DoubleA value usable by the expression. It may be passed in via the Input Number Variable 2 port.
Subset ExpressionStringDetermines which nodes or cells to include in the output. All expressions should resolve to either true or false for each node (if using a nodal subset) or cell (if using a cell subset). See the operators and examples above.
Nodal Subset VariablesString (read-only)The variables available to set the criteria when subsetting by nodal data.
Expression Cells To IncludeChoice: All Nodes Match Criteria, Any Node Matches CriteriaWhen subsetting by nodal data, includes a cell if all nodes in the cell match the expression criteria, or if any of the nodes in the cell match the expression criteria.
Cell Subset VariablesString (read-only)The variables available to set the criteria when subsetting by cell data.