Required setup
Always initialize the Mechanical context before using any operator:mech_dpf.setExtAPI(ExtAPI), operator execution silently fails or raises unexpected errors.
Creating operators
Use the hierarchicaldpf.operators namespace to instantiate operators by category:
Connecting inputs
Each operator exposes typed input pins via.inputs. Connect data sources, scopings, and
other operator outputs by name:
Getting outputs
Retrieve results from a typed output pin with.GetData():
FieldsContainer and produce another FieldsContainer follow the same pattern.
Use the matching output pin name (for example fields_container) and call .GetData():
Chaining operators
Chain operators by connecting one operator’s output directly to the next operator’s input:Workflows
Adpf.Workflow groups a connected set of operators into a named, reusable graph. You can evaluate
it directly in a scripting window to encapsulate a multi-step computation, or register it with
Mechanical for contour rendering inside a Python Result object.
Creating and evaluating a workflow
Workflows in Python Result objects
When used inside adefine_dpf_workflow(analysis) function, a workflow must additionally be
recorded so that Mechanical can render its output as a contour plot. The final operator added to
the workflow must expose a FieldsContainer that Mechanical will use for the result display.
The operator passed to
wf.SetOutputContour must produce a FieldsContainer output.