Skip to content

Commit f0d9bb0

Browse files
fix: from_pim ignoring non-Dimension dimensions (#4610)
Fixes #4605 --------- Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent e06e0e0 commit f0d9bb0

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

doc/changelog.d/4610.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
From_pim ignoring non-Dimension dimensions

examples/00-fluent/catalytic_converter_workflow.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@
341341

342342
# Write mesh files
343343

344-
meshing.tui.file.write_mesh('out/catalytic_converter.msh.h5')
344+
meshing.tui.file.write_mesh("out/catalytic_converter.msh.h5")
345345
# %%
346346
# Switch to Solver
347347
# ^^^^^^^^^^^^^^^^
@@ -542,7 +542,9 @@
542542
# Set iteration count and run calculation
543543

544544
run_calculation = RunCalculation(solver_session)
545-
run_calculation.iter_count = 150 # Iteration count, keep it at 150 for demo purposes only
545+
run_calculation.iter_count = (
546+
150 # Iteration count, keep it at 150 for demo purposes only
547+
)
546548
run_calculation.calculate()
547549

548550

src/ansys/fluent/core/launcher/pim_launcher.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def __init__(
7777
FluentWindowsGraphicsDriver | FluentLinuxGraphicsDriver | str | None
7878
) = None,
7979
product_version: FluentVersion | str | float | int | None = None,
80-
dimension: Dimension | int | None = None,
80+
dimension: Dimension | int = Dimension.THREE,
8181
precision: Precision | str | None = None,
8282
processor_count: int | None = None,
8383
start_timeout: int = 60,
@@ -251,7 +251,7 @@ def launch_remote_fluent(
251251
product_version: str | None = None,
252252
cleanup_on_exit: bool = True,
253253
mode: FluentMode = FluentMode.SOLVER,
254-
dimensionality: str | None = None,
254+
dimensionality: Dimension | int = Dimension.THREE,
255255
launcher_args: Dict[str, Any] | None = None,
256256
file_transfer_service: Any | None = None,
257257
) -> Meshing | PureMeshing | Solver | SolverIcing:
@@ -336,7 +336,7 @@ def launch_remote_fluent(
336336

337337

338338
def create_fluent_instance(
339-
pim, mode: FluentMode, dimensionality: str | None, product_version: str | None
339+
pim, mode: FluentMode, dimensionality: Dimension | int, product_version: str | None
340340
):
341341
"""Create a Fluent instance based on mode and dimensionality."""
342342

tests/test_launcher.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,12 @@ def test_fluent_launchers():
473473
assert pim_solver_session
474474
pim_solver_session.exit()
475475

476+
pim_meshing_launcher = create_launcher(
477+
LaunchMode.PIM, mode=FluentMode.MESHING, **kwargs, dimension=2, dry_run=True
478+
)
479+
args = pim_meshing_launcher()
480+
assert args[0] == "fluent-2ddp"
481+
476482

477483
@pytest.mark.parametrize(
478484
"topy,journal_file_names,result,raises",

0 commit comments

Comments
 (0)