Skip to content

Commit 2a9d667

Browse files
Activate add_beam on skin only for 10.0 (#795)
* Activate add_beam on skin only for 10.0 * Add missing server arg.
1 parent 7553885 commit 2a9d667

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

src/ansys/dpf/post/result_workflows/_sub_workflows.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def _enrich_mesh_with_property_fields(
333333

334334
def _create_split_scope_by_body_workflow(server, body_defining_properties: list[str]):
335335
split_scope_by_body_wf = Workflow(server=server)
336-
split_scop_op = operators.scoping.split_on_property_type()
336+
split_scop_op = operators.scoping.split_on_property_type(server=server)
337337
split_scope_by_body_wf.add_operator(split_scop_op)
338338
split_scope_by_body_wf.set_input_name(_WfNames.mesh, split_scop_op.inputs.mesh)
339339
split_scope_by_body_wf.set_input_name(

src/ansys/dpf/post/selection.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,9 @@ def select_skin(
443443
on the expanded mesh.
444444
"""
445445
skin_operator = operators.mesh.skin(server=self._server)
446-
if self._server.meet_version("9.1"):
447-
# add_beam argument is not available in versions prior to 9.0
446+
if self._server.meet_version("10.0"):
447+
# Add beam argument available since 9.1, but produces inconsistent
448+
# facets_to_elem mappings before 10.0
448449
skin_operator.inputs.add_beam(True)
449450
self._selection.add_operator(skin_operator)
450451

tests/conftest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,10 @@ def license_context():
368368
yield
369369

370370

371+
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0 = meets_version(
372+
get_server_version(core._global_server()), "10.0"
373+
)
374+
371375
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_9_1 = meets_version(
372376
get_server_version(core._global_server()), "9.1"
373377
)

tests/test_simulation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_8_0,
6363
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_9_0,
6464
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_9_1,
65+
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0,
6566
ReferenceCsvFilesNodal,
6667
)
6768

@@ -4648,8 +4649,8 @@ def test_beam_results_on_skin(beam_example):
46484649
data_sources=beam_example,
46494650
simulation_type=AvailableSimulationTypes.static_mechanical,
46504651
)
4651-
if not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_9_1:
4652-
# Add beams on skin not supported before 9.1
4652+
if not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0:
4653+
# Add beams on skin not activated before 10.0
46534654
return
46544655

46554656
res = simulation.displacement(skin=True, norm=True)

0 commit comments

Comments
 (0)