cell computation

cell computation

cell computation performs mathematical operations on cell data in fields. Unlike node computation, it cannot affect coordinates. Although data values cannot be used to affect coordinates (x, y, or z), the cell center (average of nodes) coordinates can be used to affect data values.

Up to two fields can be input to cell computation. Mathematical expressions can involve one or both of the input fields. Cell data input to each port is scalar. If a field contains more than one data component, you may use any of them.

Expressions and Scripts:

Calculations can be defined either as inline expressions (one per output data component) or in a Python script that is run once per cell. Each cell data component from Input Field 1 is available as a variable (Ac0, Ac1, Ac2, etc.), and each from Input Field 2 as Bc0, Bc1, Bc2, etc. Cell center coordinate variables (Ax, Ay, Az for Field 1 and Bx, By, Bz for Field 2), the cell number, and min/max range variables for each data component are also available, along with the four numeric variables N1 through N4.

Ports

DirectionNameTypeDescription
InputInput Field 1FieldA field.
InputInput Field 2FieldA field.
InputInput Value N1NumberA value to use as a variable.
InputInput Value N2NumberA value to use as a variable.
InputInput Value N3NumberA value to use as a variable.
InputInput Value N4NumberA value to use as a variable.
OutputOutput Value N1NumberA value to use as a variable.
OutputOutput Value N2NumberA value to use as a variable.
OutputOutput Value N3NumberA value to use as a variable.
OutputOutput Value N4NumberA value to use as a variable.
OutputOutput FieldFieldThe output field with solved expression data.
OutputOutput ObjectRenderableA renderable object displaying the solved expression data.

Properties

PropertyTypeDescription
Allow RunBooleanDetermines whether the module is allowed to execute. Set to True to allow this module to run.
FilenameFileThe Python script which is run once per cell. The values set within the script are assigned to the cell data of the resulting field. Used in Script mode; a default script can be created from this control.
ExecuteButtonAccepts all values and runs the computation. If this button is clicked and the application saved, the module will run when the application is loaded.
Cell Computation Variables 1String (read-only)The variables available for use during computation from Input Field 1: average cell coordinates (Ax, Ay, Az), the cell number, min/max range variables, and all cell data components (Ac0, Ac1, …).
Cell Computation Variables 2String (read-only)The variables available for use during computation from Input Field 2: average cell coordinates (Bx, By, Bz), the cell number, min/max range variables, and all cell data components (Bc0, Bc1, …).

Output

PropertyTypeDescription
ModeChoice: Expression, ScriptExpression mode allows inline expressions per data component. Script mode uses a Python script file.
Data DefinitionsData DefinitionsThe cell data you wish to generate. Each data component has a name, units, a log processing flag, and (in Expression mode) an expression.

Variables

PropertyTypeDescription
N1DoubleNumber passed into the script.
N2DoubleNumber passed into the script.
N3DoubleNumber passed into the script.
N4DoubleNumber passed into the script.