2424from typing import Callable , List , Optional , Union
2525
2626from ansys .dpf .core import Operator , Workflow , shell_layers
27- from ansys .dpf .core .available_result import _result_properties
27+ from ansys .dpf .core .available_result import AvailableResult
2828from ansys .dpf .core .common import locations
2929
3030from ansys .dpf .post .result_workflows ._component_helper import (
4545from ansys .dpf .post .result_workflows ._utils import (
4646 AveragingConfig ,
4747 _CreateOperatorCallable ,
48+ _get_native_location ,
4849 _Rescoping ,
4950)
5051from ansys .dpf .post .selection import Selection , _WfNames
@@ -120,6 +121,7 @@ class _CreateWorkflowInputs:
120121
121122
122123def _requires_manual_averaging (
124+ available_results : list [AvailableResult ],
123125 base_name : str ,
124126 location : str ,
125127 category : ResultCategory ,
@@ -128,8 +130,7 @@ def _requires_manual_averaging(
128130 create_operator_callable : Callable [[str ], Operator ],
129131 average_per_body : bool ,
130132):
131- res = _result_properties [base_name ] if base_name in _result_properties else None
132- native_location = res ["location" ] if res is not None else None
133+ native_location = _get_native_location (available_results , base_name )
133134
134135 if average_per_body and (
135136 native_location == locations .elemental
@@ -138,7 +139,7 @@ def _requires_manual_averaging(
138139 return True
139140 if category == ResultCategory .equivalent and base_name [0 ] == "E" : # strain eqv
140141 return True
141- if res is not None :
142+ if native_location is not None :
142143 is_model_cyclic = create_operator_callable ("is_cyclic" ).eval ()
143144 is_model_cyclic = is_model_cyclic in ["single_stage" , "multi_stage" ]
144145 if has_external_layer and is_model_cyclic and location != native_location :
@@ -265,6 +266,7 @@ def _create_result_workflows(
265266
266267
267268def _create_result_workflow_inputs (
269+ available_results : list [AvailableResult ],
268270 base_name : str ,
269271 category : ResultCategory ,
270272 components : Union [str , List [str ], int , List [int ], None ],
@@ -284,6 +286,7 @@ def _create_result_workflow_inputs(
284286 )
285287
286288 force_elemental_nodal = _requires_manual_averaging (
289+ available_results = available_results ,
287290 base_name = base_name ,
288291 location = location ,
289292 category = category ,
0 commit comments