diff --git a/doc/changelog.d/4629.maintenance.md b/doc/changelog.d/4629.maintenance.md new file mode 100644 index 000000000000..1f4c8ff70741 --- /dev/null +++ b/doc/changelog.d/4629.maintenance.md @@ -0,0 +1 @@ +Update launcher tests for better coverage diff --git a/doc/source/user_guide/session/launching_ansys_fluent.rst b/doc/source/user_guide/session/launching_ansys_fluent.rst index 91d9af744cb4..599ccb821b85 100644 --- a/doc/source/user_guide/session/launching_ansys_fluent.rst +++ b/doc/source/user_guide/session/launching_ansys_fluent.rst @@ -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() `: + + - 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 `_ mode ---------------------------------------------------------------------- diff --git a/src/ansys/fluent/core/session_pure_meshing.py b/src/ansys/fluent/core/session_pure_meshing.py index 5ad58a9c2f6f..2135b119d99a 100644 --- a/src/ansys/fluent/core/session_pure_meshing.py +++ b/src/ansys/fluent/core/session_pure_meshing.py @@ -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 = [ diff --git a/tests/test_session.py b/tests/test_session.py index 0f5ed74e428b..7c3541184b50 100644 --- a/tests/test_session.py +++ b/tests/test_session.py @@ -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