-
Notifications
You must be signed in to change notification settings - Fork 12
Fix skin result extraction based on list of elements #532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 20 commits
2734aaa
cd4746b
548aa0c
dab0442
fe7a25e
552b032
b040a22
15308a2
3bc8779
e3393a0
8f81e3d
29926b8
f6161a4
a43d2fb
c34562a
d7f1189
fa8aa84
adc8a46
e24b07a
72c1d14
f15e96c
2d37b76
039ab55
e5abaad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,7 @@ def _get_result( | |
| phase_angle_cyclic: Union[float, None] = None, | ||
| external_layer: Union[bool, List[int]] = False, | ||
| skin: Union[bool, List[int]] = False, | ||
| reduce_mesh: Union[bool, List[int]] = False, | ||
| ) -> DataFrame: | ||
| """Extract results from the simulation. | ||
|
|
||
|
|
@@ -104,6 +105,11 @@ def _get_result( | |
| is computed over list of elements (not supported for cyclic symmetry). Getting the | ||
| skin on more than one result (several time freq sets, split data...) is only | ||
| supported starting with Ansys 2023R2. | ||
| reduce_mesh: | ||
| Perform a reduction of the mesh under consideration based on, by order of priority: | ||
| - the list of element IDs given to this parameter | ||
| - parameter skin if reduce_mesh=True | ||
| - parameter element_ids if reduce_mesh=True and skin=None | ||
PProfizi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Returns | ||
| ------- | ||
|
|
@@ -138,6 +144,7 @@ def _get_result( | |
| location=location, | ||
| external_layer=external_layer, | ||
| skin=skin, | ||
| reduce_mesh=reduce_mesh, | ||
| ) | ||
|
|
||
| comp, to_extract, columns = self._create_components( | ||
|
|
@@ -172,19 +179,32 @@ def _get_result( | |
| output_input_names=("scoping", "time_scoping"), | ||
| ) | ||
| if selection.requires_mesh: | ||
| self._model._metadata = None | ||
| mesh_wf = core.Workflow(server=self._model._server) | ||
| mesh_wf.progress_bar = False | ||
| mesh_wf.set_output_name( | ||
| _WfNames.initial_mesh, self._model.metadata.mesh_provider | ||
| "initial_mesh_wf_out", self._model.metadata.mesh_provider | ||
| ) | ||
| selection.spatial_selection._selection.connect_with( | ||
| mesh_wf, | ||
| output_input_names={_WfNames.initial_mesh: _WfNames.initial_mesh}, | ||
| output_input_names={"initial_mesh_wf_out": _WfNames.initial_mesh}, | ||
| ) | ||
| else: | ||
| result_op.connect(7, self.mesh._meshed_region) | ||
|
|
||
| if selection.reduces_mesh: | ||
| wf.connect_with( | ||
| selection.spatial_selection._selection, | ||
| output_input_names={ | ||
| "scoping": "mesh_scoping", | ||
| "initial_mesh": _WfNames.result_mesh, | ||
| }, | ||
| ) | ||
| else: | ||
| wf.connect_with( | ||
| selection.spatial_selection._selection, | ||
| output_input_names={"scoping": "mesh_scoping"}, | ||
| ) | ||
|
|
||
| wf.connect_with( | ||
| selection.spatial_selection._selection, | ||
| output_input_names={"scoping": "mesh_scoping"}, | ||
| ) | ||
|
|
||
| # Treat cyclic cases | ||
| wf = self._treat_cyclic(expand_cyclic, phase_angle_cyclic, wf) | ||
|
|
@@ -1099,6 +1119,7 @@ def stress_eqv_von_mises_elemental( | |
| phase_angle_cyclic: Union[float, None] = None, | ||
| external_layer: Union[bool, List[int]] = False, | ||
| skin: Union[bool, List[int]] = False, | ||
| reduce_mesh: Union[bool, List[int]] = False, | ||
| ) -> DataFrame: | ||
| """Extract elemental equivalent von Mises stress results from the simulation. | ||
|
|
||
|
|
@@ -1137,17 +1158,22 @@ def stress_eqv_von_mises_elemental( | |
| If the problem is multi-stage, can take a list of lists of sector numbers, ordered | ||
| by stage. | ||
| phase_angle_cyclic: | ||
| For cyclic problems, phase angle to apply (in degrees). | ||
| For cyclic problems, phase angle to apply (in degrees). | ||
| external_layer: | ||
| Select the external layer (last layer of solid elements under the skin) | ||
| of the mesh for plotting and data extraction. If a list is passed, the external | ||
| layer is computed over list of elements. | ||
| Select the external layer (last layer of solid elements under the skin) | ||
| of the mesh for plotting and data extraction. If a list is passed, the external | ||
| layer is computed over list of elements. | ||
| skin: | ||
| Select the skin (creates new 2D elements connecting the external nodes) | ||
| of the mesh for plotting and data extraction. If a list is passed, the skin | ||
| is computed over list of elements (not supported for cyclic symmetry). Getting the | ||
| skin on more than one result (several time freq sets, split data...) is only | ||
| supported starting with Ansys 2023R2. | ||
| Select the skin (creates new 2D elements connecting the external nodes) | ||
| of the mesh for plotting and data extraction. If a list is passed, the skin | ||
| is computed over list of elements (not supported for cyclic symmetry). Getting the | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't this description true only for reduce_mesh==True?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cbellot000 do you mean the fact that having If If |
||
| skin on more than one result (several time freq sets, split data...) is only | ||
| supported starting with Ansys 2023R2. | ||
PProfizi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| reduce_mesh: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what about the external layer?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cbellot000 you're right, I'll check what it does in combination with |
||
| Perform a reduction of the mesh under consideration based on, by order of priority: | ||
| - the list of element IDs given to this parameter | ||
| - parameter skin if reduce_mesh=True | ||
| - parameter element_ids if reduce_mesh=True and skin=None | ||
PProfizi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Returns | ||
| ------- | ||
|
|
@@ -1171,6 +1197,7 @@ def stress_eqv_von_mises_elemental( | |
| phase_angle_cyclic=phase_angle_cyclic, | ||
| external_layer=external_layer, | ||
| skin=skin, | ||
| reduce_mesh=reduce_mesh, | ||
| ) | ||
|
|
||
| def stress_eqv_von_mises_nodal( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.