node computation
node computation performs mathematical operations on nodal data and coordinates. Data values can be used to affect coordinates (x, y, or z), and coordinates can be used to affect data values.
Up to two fields can be input to node computation. Mathematical expressions can involve one or both of the input fields. The fields must be identical grids, meaning they must have the same number of nodes and cells; otherwise the results will not make sense.
Nodal data input to each port is normally scalar. If a vector data component is used, the value in the expression is automatically the magnitude of the vector (which is a scalar). To use a particular component of a vector, insert vector to scalars before connecting the field to node computation. Each output data component is always a 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 node. Modifying coordinates requires a script. Each nodal data component from Input Field 1 is available as a variable (An0, An1, An2, etc.), and each from Input Field 2 as Bn0, Bn1, Bn2, etc. Coordinate variables (Ax, Ay, Az for Field 1 and Bx, By, Bz for Field 2), the node number, and min/max range variables for each data component are also available, along with the four numeric variables N1 through N4.
Ports
| Direction | Name | Type | Description |
|---|---|---|---|
| Input | Input Field 1 | Field | A field. |
| Input | Input Field 2 | Field | A field. |
| Input | Input Value N1 | Number | A value to use as a variable. |
| Input | Input Value N2 | Number | A value to use as a variable. |
| Input | Input Value N3 | Number | A value to use as a variable. |
| Input | Input Value N4 | Number | A value to use as a variable. |
| Output | Output Value N1 | Number | A value to use as a variable. |
| Output | Output Value N2 | Number | A value to use as a variable. |
| Output | Output Value N3 | Number | A value to use as a variable. |
| Output | Output Value N4 | Number | A value to use as a variable. |
| Output | Output Field | Field | The output field with solved expression data. |
| Output | Output Object | Renderable | A renderable object displaying the solved expression data. |
Properties
| Property | Type | Description |
|---|---|---|
| Allow Run | Boolean | Determines whether the module is allowed to execute. Set to True to allow this module to run. |
| Filename | File | The Python script which is run once per node. The values set within the script are assigned to the coordinates and data of the resulting field. Used in Script mode; a default script can be created from this control. |
| Execute | Button | Accepts all values and runs the computation. If this button is clicked and the application saved, the module will run when the application is loaded. |
| Nodal Computation Variables 1 | String (read-only) | The variables available for use during computation from Input Field 1: coordinates (Ax, Ay, Az), the node number, min/max range variables, and all nodal data components (An0, An1, …). |
| Nodal Computation Variables 2 | String (read-only) | The variables available for use during computation from Input Field 2: coordinates (Bx, By, Bz), the node number, min/max range variables, and all nodal data components (Bn0, Bn1, …). |
Output
| Property | Type | Description |
|---|---|---|
| Affect Coordinates | Boolean | When on, the script can set the X, Y, and Z coordinates. Leaving this off results in more efficient operation when the script only creates data. When on, Script mode is required. |
| Mode | Choice: Expression, Script | Expression mode allows inline expressions per data component. Script mode uses a Python script file. |
| Data Definitions | Data Definitions | The data you wish to generate in addition to coordinates. Each data component has a name, units, a log processing flag, and (in Expression mode) an expression. |
Variables
| Property | Type | Description |
|---|---|---|
| N1 | Double | Number passed into the script. |
| N2 | Double | Number passed into the script. |
| N3 | Double | Number passed into the script. |
| N4 | Double | Number passed into the script. |