Skip to content

Commit

Permalink
Activate add_beam on skin only for 10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
janvonrickenbach committed Feb 3, 2025
1 parent 7553885 commit 2b15536
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/ansys/dpf/post/selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,9 @@ def select_skin(
on the expanded mesh.
"""
skin_operator = operators.mesh.skin(server=self._server)
if self._server.meet_version("9.1"):
# add_beam argument is not available in versions prior to 9.0
if self._server.meet_version("10.0"):
# Add beam argument available since 9.1, but produces inconsistent
# facets_to_elem mappings before 10.0
skin_operator.inputs.add_beam(True)
self._selection.add_operator(skin_operator)

Expand Down
4 changes: 4 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,10 @@ def license_context():
yield


SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0 = meets_version(
get_server_version(core._global_server()), "10.0"
)

SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_9_1 = meets_version(
get_server_version(core._global_server()), "9.1"
)
Expand Down
5 changes: 3 additions & 2 deletions tests/test_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_8_0,
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_9_0,
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_9_1,
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0,
ReferenceCsvFilesNodal,
)

Expand Down Expand Up @@ -4648,8 +4649,8 @@ def test_beam_results_on_skin(beam_example):
data_sources=beam_example,
simulation_type=AvailableSimulationTypes.static_mechanical,
)
if not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_9_1:
# Add beams on skin not supported before 9.1
if not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0:
# Add beams on skin not activated before 10.0
return

res = simulation.displacement(skin=True, norm=True)
Expand Down

0 comments on commit 2b15536

Please sign in to comment.