Skip to content

Commit 87470d9

Browse files
committed
Return modified inputs
1 parent b36686d commit 87470d9

File tree

4 files changed

+17
-22
lines changed

4 files changed

+17
-22
lines changed

src/ansys/dpf/post/harmonic_mechanical_simulation.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@ def _get_result_workflow(
3737
selection: Union[Selection, None] = None,
3838
expand_cyclic: Union[bool, List[Union[int, List[int]]]] = True,
3939
phase_angle_cyclic: Union[float, None] = None,
40-
) -> dpf.Workflow:
40+
) -> (dpf.Workflow, Union[str, list[str], None], str):
4141
"""Generate (without evaluating) the Workflow to extract results."""
42-
comp, to_extract, columns = self._create_components(
43-
base_name, category, components
44-
)
42+
comp, to_extract, _ = self._create_components(base_name, category, components)
4543

4644
# Initialize a workflow
4745
wf = dpf.Workflow(server=self._model._server)
@@ -209,7 +207,7 @@ def _get_result_workflow(
209207
wf.set_output_name("out", out)
210208
wf.progress_bar = False
211209

212-
return wf
210+
return wf, comp, base_name
213211

214212
def _get_result(
215213
self,
@@ -354,7 +352,7 @@ def _get_result(
354352
skin=skin,
355353
)
356354

357-
wf = self._get_result_workflow(
355+
wf, comp, base_name = self._get_result_workflow(
358356
base_name=base_name,
359357
location=location,
360358
category=category,
@@ -372,7 +370,7 @@ def _get_result(
372370

373371
disp_wf = self._generate_disp_workflow(fc, selection)
374372

375-
comp, _, columns = self._create_components(base_name, category, components)
373+
_, _, columns = self._create_components(base_name, category, components)
376374

377375
# Test for empty results
378376
if (len(fc) == 0) or all([len(f) == 0 for f in fc]):

src/ansys/dpf/post/modal_mechanical_simulation.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,10 @@ def _get_result_workflow(
2626
selection: Union[Selection, None] = None,
2727
expand_cyclic: Union[bool, List[Union[int, List[int]]]] = True,
2828
phase_angle_cyclic: Union[float, None] = None,
29-
) -> dpf.Workflow:
29+
) -> (dpf.Workflow, Union[str, list[str], None], str):
3030
"""Generate (without evaluating) the Workflow to extract results."""
3131
comp, to_extract, _ = self._create_components(base_name, category, components)
3232

33-
# Initialize a workflow
34-
wf = dpf.Workflow(server=self._model._server)
35-
3633
force_elemental_nodal = self._requires_manual_averaging(
3734
base_name=base_name,
3835
location=location,
@@ -169,7 +166,7 @@ def _get_result_workflow(
169166
wf.set_output_name("out", out)
170167
wf.progress_bar = False
171168

172-
return wf
169+
return wf, comp, base_name
173170

174171
def _get_result(
175172
self,
@@ -293,7 +290,7 @@ def _get_result(
293290
skin=skin,
294291
)
295292

296-
wf = self._get_result_workflow(
293+
wf, comp, base_name = self._get_result_workflow(
297294
base_name=base_name,
298295
location=location,
299296
category=category,
@@ -316,7 +313,7 @@ def _get_result(
316313
_WfNames.mesh, dpf.types.meshed_region
317314
)
318315

319-
comp, _, columns = self._create_components(base_name, category, components)
316+
_, _, columns = self._create_components(base_name, category, components)
320317
return self._create_dataframe(
321318
fc, location, columns, comp, base_name, disp_wf, submesh
322319
)

src/ansys/dpf/post/static_mechanical_simulation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def _get_result_workflow(
2626
selection: Union[Selection, None] = None,
2727
expand_cyclic: Union[bool, List[Union[int, List[int]]]] = True,
2828
phase_angle_cyclic: Union[float, None] = None,
29-
) -> core.Workflow:
29+
) -> (core.Workflow, Union[str, list[str], None], str):
3030
"""Generate (without evaluating) the Workflow to extract results."""
3131
comp, to_extract, _ = self._create_components(base_name, category, components)
3232

@@ -166,7 +166,7 @@ def _get_result_workflow(
166166
wf.set_output_name("out", out)
167167
wf.progress_bar = False
168168

169-
return wf
169+
return wf, comp, base_name
170170

171171
def _get_result(
172172
self,
@@ -292,7 +292,7 @@ def _get_result(
292292
skin=skin,
293293
)
294294

295-
wf = self._get_result_workflow(
295+
wf, comp, base_name = self._get_result_workflow(
296296
base_name=base_name,
297297
location=location,
298298
category=category,
@@ -314,7 +314,7 @@ def _get_result(
314314
_WfNames.mesh, core.types.meshed_region
315315
)
316316

317-
comp, _, columns = self._create_components(base_name, category, components)
317+
_, _, columns = self._create_components(base_name, category, components)
318318

319319
return self._create_dataframe(
320320
fc, location, columns, comp, base_name, disp_wf, submesh

src/ansys/dpf/post/transient_mechanical_simulation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def _get_result_workflow(
2424
components: Union[str, List[str], int, List[int], None] = None,
2525
norm: bool = False,
2626
selection: Union[Selection, None] = None,
27-
) -> dpf.Workflow:
27+
) -> (dpf.Workflow, Union[str, list[str], None], str):
2828
"""Generate (without evaluating) the Workflow to extract results."""
2929
comp, to_extract, _ = self._create_components(base_name, category, components)
3030

@@ -166,7 +166,7 @@ def _get_result_workflow(
166166
wf.set_output_name("out", out)
167167
wf.progress_bar = False
168168

169-
return wf
169+
return wf, comp, base_name
170170

171171
def _get_result(
172172
self,
@@ -284,7 +284,7 @@ def _get_result(
284284
skin=skin,
285285
)
286286

287-
wf = self._get_result_workflow(
287+
wf, comp, base_name = self._get_result_workflow(
288288
base_name=base_name,
289289
location=location,
290290
category=category,
@@ -305,7 +305,7 @@ def _get_result(
305305
_WfNames.mesh, dpf.types.meshed_region
306306
)
307307

308-
comp, _, columns = self._create_components(base_name, category, components)
308+
_, _, columns = self._create_components(base_name, category, components)
309309
return self._create_dataframe(
310310
fc, location, columns, comp, base_name, disp_wf=disp_wf, submesh=submesh
311311
)

0 commit comments

Comments
 (0)