Commit 830edfa9 authored by Cory Quammen's avatar Cory Quammen

Add example that shows how to access field data

parent bf4b3be4
......@@ -1352,6 +1352,14 @@ in the expression as \py{t\_index} or \py{time\_index}, and \py{t\_value} or \py
respectively. When dealing with multiple inputs, you can specify the same variable names scoped on the
appropriate input e.g. \py{inputs[0].t\_index}.
In some datasets, field data is used to store global data values not associated with cells or points.
To use field data in a \ui{Python Calculator} expression, access it with the \py{FieldData} dictionary
available in the input as in the following example:
VolumeOfCell * inputs[0].FieldData['MaterialData'][time_index]
Under the cover, the \ui{Python Calculator} uses NumPy. All arrays in the
expression are compatible with NumPy arrays and can be used where NumPy arrays
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment