Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/4629.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update launcher tests for better coverage
20 changes: 20 additions & 0 deletions doc/source/user_guide/session/launching_ansys_fluent.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,26 @@ Use this method when:
solver.exit()
solver_connected.exit()

.. note::

PyFluent offers two Python interfaces for meshing:

- ``Meshing``: meshing interface with an additional method to switch to solver mode.
- ``PureMeshing``: meshing interface without any solver switching features.

The two interfaces expose the **same meshing functionality**. The only difference is that
``Meshing`` includes ``switch_to_solver()``.

When connecting to an existing Fluent session
via :meth:`from_connection() <ansys.fluent.core.session_utilities.SessionBase.from_connection>`:

- Use ``PureMeshing.from_connection()`` if the session was launched for **meshing only**.
- Use ``Meshing.from_connection()`` if the session supports **meshing and solving**.
- You may also use ``PureMeshing.from_connection()`` with a session that supports solving,
if you intentionally want access **only to meshing features**.

A ``Meshing`` interface is not recommended for a **meshing-only** session, because
``switch_to_solver()`` would raise an error in that case.

Launch in `PIM <https://pypim.docs.pyansys.com/version/stable/>`_ mode
----------------------------------------------------------------------
Expand Down
15 changes: 9 additions & 6 deletions src/ansys/fluent/core/session_pure_meshing.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@


class PureMeshing(BaseSession):
"""Encapsulates a Fluent meshing session.
"""Encapsulates a Fluent meshing session with a meshing-only Python interface.

A ``tui`` object
for meshing TUI commanding, and ``meshing`` and ``workflow``
objects for access to task-based meshing workflows are all
exposed here. No ``switch_to_solver`` method is available
in this mode.
``PureMeshing`` is designed for workflows where meshing and solving are run as
separate stages or in different environments, such as modular or containerized
deployments. It provides a clean API that focuses solely on meshing tasks.

This interface exposes:

- ``workflow`` and ``meshing`` objects for task-based meshing operations.
- ``tui`` for scripting via the legacy Text User Interface (when needed).
"""

_rules = [
Expand Down
30 changes: 30 additions & 0 deletions tests/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,36 @@ def test_new_launch_fluent_api():
solver.exit()
solver_connected.exit()

solver_aero = pyfluent.SolverAero.from_install()
assert solver_aero.is_server_healthy()

ip = solver_aero.connection_properties.ip
port = solver_aero.connection_properties.port
password = solver_aero.connection_properties.password

solver_aero_connected = pyfluent.SolverAero.from_connection(
ip=ip, port=port, password=password
)
assert solver_aero_connected.is_server_healthy()

solver_aero.exit()
solver_aero_connected.exit()

meshing = pyfluent.Meshing.from_install()
assert meshing.is_server_healthy()

ip = meshing.connection_properties.ip
port = meshing.connection_properties.port
password = meshing.connection_properties.password

meshing_connected = pyfluent.Meshing.from_connection(
ip=ip, port=port, password=password
)
assert meshing_connected.is_server_healthy()

meshing.exit()
meshing_connected.exit()


def test_new_launch_fluent_api_from_container():
import ansys.fluent.core as pyfluent
Expand Down