diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 74c780921aba..527f98db6627 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -252,6 +252,10 @@ jobs: src/ansys/fluent/core/meshing/tui.py src/ansys/fluent/core/solver/settings src/ansys/fluent/core/solver/tui.py + doc/source/api/core/meshing/tui + doc/source/api/core/meshing/datamodel + doc/source/api/core/solver/tui + doc/source/api/core/solver/datamodel key: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-${{ matrix.image-tag }}-${{ hashFiles('codegen/**') }}-${{ github.sha }} restore-keys: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-${{ matrix.image-tag }}-${{ hashFiles('codegen/**') }} diff --git a/codegen/data/tui_menu_descriptions.py b/codegen/data/tui_menu_descriptions.py index 636fb30c477d..7bad3f3cfc4a 100644 --- a/codegen/data/tui_menu_descriptions.py +++ b/codegen/data/tui_menu_descriptions.py @@ -1,11 +1 @@ -MENU_DESCRIPTIONS = { - "solver.tui": """The PyFluent solver text user interface (TUI) API is provided to command the -Fluent solver using commands that are Pythonic versions of the TUI commands used -in the Fluent console. Much like Fluent's TUI the API provides a hierarchical -interface to the underlying procedural interface of the program. - -See :ref:`ref_user_guide_tui_api` for general guidance on using the TUI APIs. - -The TUI based examples in our gallery, such as in :ref:`ref_mixing_elbow_tui_api`, provide a guide for how to use this API. -""" -} +MENU_DESCRIPTIONS = {} diff --git a/doc/source/api/core/solver/events.rst b/doc/source/api/core/solver/events.rst index 24ad19fb045d..317c418ebc2d 100644 --- a/doc/source/api/core/solver/events.rst +++ b/doc/source/api/core/solver/events.rst @@ -1,5 +1,7 @@ .. _ref_events: +:orphan: + EventsManager ============= diff --git a/doc/source/api/core/solver/index.rst b/doc/source/api/core/solver/index.rst index a6a0d6da102e..46a09ac6ac51 100644 --- a/doc/source/api/core/solver/index.rst +++ b/doc/source/api/core/solver/index.rst @@ -12,6 +12,6 @@ Solver :hidden: settings - tui/index + tuicommands datamodel/index fielddata diff --git a/doc/source/api/core/solver/monitors.rst b/doc/source/api/core/solver/monitors.rst index bf59d4da78a9..c2ca144d2a2e 100644 --- a/doc/source/api/core/solver/monitors.rst +++ b/doc/source/api/core/solver/monitors.rst @@ -1,5 +1,7 @@ .. _ref_monitors: +:orphan: + MonitorsManager =============== diff --git a/doc/source/api/core/solver/settings.rst b/doc/source/api/core/solver/settings.rst index b7d845994c05..4a7acdb73d53 100644 --- a/doc/source/api/core/solver/settings.rst +++ b/doc/source/api/core/solver/settings.rst @@ -12,7 +12,7 @@ issue commands with a hierarchy of objects. Top-level Objects ----------------- -The top-level settings object is available as the ``root`` property of session.solver. +The top-level settings object is available as the :ref:`root` property of session.solver. .. code-block:: @@ -203,6 +203,11 @@ Example(2): The list of valid commands can be accessed as follows: >>> root.solution.run_calculation.get_active_command_names() ['iterate'] +.. _settings_root_section: + Settings Objects Root --------------------- -:ref:`Settings root` \ No newline at end of file + +The ``root`` object is the top-level settings object which contains all other +settings objects in a hierarchical structure. The full API documentation of settings +objects can be browsed from the :ref:`root object's page`. diff --git a/doc/source/api/core/solver/tuicommands.rst b/doc/source/api/core/solver/tuicommands.rst new file mode 100644 index 000000000000..a265e46c894d --- /dev/null +++ b/doc/source/api/core/solver/tuicommands.rst @@ -0,0 +1,23 @@ +.. _ref_solver_tui_commands: + +Solver TUI Commands +=================== + +Introduction +------------ +The solver TUI (text user interface) is exposed in PyFluent in a hierarchy +of Python commands. + +See :ref:`ref_user_guide_tui_commands` for general guidance on using the TUI Commands. + +The TUI based examples in our gallery, such as in :ref:`ref_mixing_elbow_tui_api`, provide a guide for how to use these commands. + +Solver TUI Commands Root +------------------------ +:ref:`ref_solver_tui` + +.. toctree:: + :maxdepth: 2 + :hidden: + + tui/index diff --git a/doc/source/index.rst b/doc/source/index.rst index 344522b110b3..5ae2ecbd9489 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -56,16 +56,6 @@ The primary package, ``ansys-fluent``, provides features such as: - Scripting using Fluent's TUI commands. See the :ref:`ref_solver_tui` module for more information about the available commands. - and more... - -Beta Features -------------- -The settings object interface provides a more Pythonic way to access and modify -Fluent settings than the TUI command interface. These API calls group Fluent -settings into a tree of objects where individal settings for material -properties, boundary conditions are accessible without the need to pass -parameter lists. - -More information is available in the :ref:`ref_settings` module documentation. Documentation and Issues ------------------------ diff --git a/doc/source/user_guide/boundary_conditions.rst b/doc/source/user_guide/boundary_conditions.rst index 3bd8e7b87ac5..c58caf888a8c 100644 --- a/doc/source/user_guide/boundary_conditions.rst +++ b/doc/source/user_guide/boundary_conditions.rst @@ -1,11 +1,11 @@ Defining Boundary Conditions ============================ -PyFluent supports defining boundary conditions using the TUI API and :ref:`ref_settings`. +PyFluent supports defining boundary conditions using the :ref:`ref_solver_tui_commands` and :ref:`ref_settings`. -Text User Interface (TUI) API ------------------------------ +Solver TUI Commands +------------------- The following example demonstrates how you can define boundary conditions using -the TUI API: +:ref:`ref_solver_tui_commands`: .. code:: python diff --git a/doc/source/user_guide/general_settings.rst b/doc/source/user_guide/general_settings.rst index 5cefbe0a9208..087ac7035d7a 100644 --- a/doc/source/user_guide/general_settings.rst +++ b/doc/source/user_guide/general_settings.rst @@ -3,10 +3,10 @@ Applying General Settings PyFluent supports defining general settings using the TUI API and :ref:`ref_settings`. -Text User Interface (TUI) API ------------------------------ +Solver TUI Commands +------------------- The following example demonstrates how you can define units using -the TUI API: +:ref:`ref_solver_tui_commands`: .. code:: python diff --git a/doc/source/user_guide/index.rst b/doc/source/user_guide/index.rst index bde8283332a9..30c2994bc956 100644 --- a/doc/source/user_guide/index.rst +++ b/doc/source/user_guide/index.rst @@ -17,7 +17,7 @@ and monitor Ansys Fluent. :hidden: launching_ansys_fluent - tui_api + tui_commands meshing_workflows general_settings solver_settings @@ -71,9 +71,9 @@ users: tui.define.models.energy("yes") -See :ref:`ref_solver_tui` for details of the full hierarchical API +See :ref:`ref_solver_tui_commands` for details of the full hierarchy under the ``tui`` object. Some general guidance on -programming in terms of such an API can be found in :ref:`ref_user_guide_tui_api`. +programming in terms of such an interface can be found in :ref:`ref_user_guide_tui_commands`. The same ``solver`` object also has a ``root`` object, which provides a different interface to the Fluent solver. The ``root`` object exposes most of the @@ -109,8 +109,8 @@ straightforward and familiar command and settings interactions are available: tui.file.write_case("pipe.cas.h5") -See :ref:`ref_meshing_tui` for details of the full hierarchical API under the -``tui`` object. As mentioned above, :ref:`ref_user_guide_tui_api` contains +See :ref:`ref_meshing_tui` for details of the full hierarchy under the +``tui`` object. As mentioned above, :ref:`ref_user_guide_tui_commands` contains more general guidance. In addition, the ``meshing`` object has ``meshing`` and ``workflow`` properties, @@ -144,7 +144,7 @@ code that could be executed in Fluent for the current mode: .. code:: python - unsteady = solver_session.scheme_eval.scheme_eval("(rp-unsteady?)")​ + unsteady = solver_session.scheme_eval.scheme_eval("(rp-unsteady?)") Surface field and mesh data services are available in solution mode only via the ``field_data`` object attribute of the session object: @@ -160,16 +160,16 @@ The connection status of any session can be verified as follows .. code:: python - health = solver_session.check_health()​​ + health = solver_session.check_health() Streaming of the Fluent transcript can be stopped/started as follows (it is automatically started by default): .. code:: python - solver_session.stop_transcript()​​ + solver_session.stop_transcript() - solver_session.start_transcript()​​ + solver_session.start_transcript() Streaming of events pertaining to various, specific solver event types can be enabled/disabled via the ``events_manager`` attribute of a solution-mode session: @@ -178,7 +178,10 @@ enabled/disabled via the ``events_manager`` attribute of a solution-mode session solver_session.events_manager.start() -Event management is detailed further here: :ref:`ref_events`. +.. + + Add the following line after fixing events_manager doc + Event management is detailed further here: The global logging level can be controlled at any time: diff --git a/doc/source/user_guide/materials.rst b/doc/source/user_guide/materials.rst index af89ea22b06b..df44857128e6 100644 --- a/doc/source/user_guide/materials.rst +++ b/doc/source/user_guide/materials.rst @@ -1,12 +1,12 @@ Defining Materials ================== -PyFluent supports defining materials using the TUI API and +PyFluent supports defining materials using the :ref:`ref_solver_tui_commands` and :ref:`ref_settings`. -Text User Interface (TUI) API ------------------------------ +Solver TUI Commands +------------------- The following example demonstrates how you can define materials using -the TUI API: +the :ref:`ref_solver_tui_commands`: .. code:: python diff --git a/doc/source/user_guide/models.rst b/doc/source/user_guide/models.rst index c3fe622ef883..09840827a208 100644 --- a/doc/source/user_guide/models.rst +++ b/doc/source/user_guide/models.rst @@ -1,11 +1,11 @@ Defining Models =============== -PyFluent supports defining models using the TUI API and :ref:`ref_settings`. +PyFluent supports defining models using :ref:`ref_solver_tui_commands` and :ref:`ref_settings`. -Text User Interface (TUI) API ------------------------------ +Solver TUI Commands +------------------- The following example demonstrates how you can define the energy model -using the TUI API: +using :ref:`ref_solver_tui_commands`: .. code:: python diff --git a/doc/source/user_guide/solution.rst b/doc/source/user_guide/solution.rst index 818713d51d7e..b12d8cfa364d 100644 --- a/doc/source/user_guide/solution.rst +++ b/doc/source/user_guide/solution.rst @@ -1,15 +1,13 @@ Applying Solution Settings ========================== -PyFluent supports applying solution settings using the TUI API and :ref:`ref_settings`. -PyFluent allows you to initialize and solve using the traditional -Text User Interface (TUI) command-based infrastructure and the settings -module. +PyFluent allows you to apply solution settings, initialize and solve using both +:ref:`ref_solver_tui_commands` and :ref:`ref_settings`. -Text User Interface (TUI) API ------------------------------ +Solver TUI Commands +------------------- The following example demonstrates how you can apply solution settings -using the TUI API: +using :ref:`ref_solver_tui_commands`: .. code:: python diff --git a/doc/source/user_guide/solver_settings.rst b/doc/source/user_guide/solver_settings.rst index eb7d3426aeae..cc8346254fc9 100644 --- a/doc/source/user_guide/solver_settings.rst +++ b/doc/source/user_guide/solver_settings.rst @@ -1,15 +1,14 @@ .. _ref_user_guide_solver_settings: - Specifying Solver Settings ========================== -PyFluent supports specifying solver settings using the TUI API and -:ref:`ref_settings`. +PyFluent supports specifying solver settings using both +:ref:`ref_solver_tui_commands` and :ref:`ref_settings`. -Text User Interface (TUI) API ------------------------------ +Solver TUI Commands +------------------- The following example demonstrates how you can specify solver -settings using the TUI API: +settings using the :ref:`ref_solver_tui_commands`: .. code:: python diff --git a/doc/source/user_guide/tui_api.rst b/doc/source/user_guide/tui_commands.rst similarity index 73% rename from doc/source/user_guide/tui_api.rst rename to doc/source/user_guide/tui_commands.rst index 9de7f58bcf63..6c5c25a70873 100644 --- a/doc/source/user_guide/tui_api.rst +++ b/doc/source/user_guide/tui_commands.rst @@ -1,30 +1,29 @@ -.. _ref_user_guide_tui_api: +.. _ref_user_guide_tui_commands: -Using the TUI APIs +Using TUI Commands ================== -TUI API refers to a programming interface that mirrors the Fluent text user -interface (TUI). There is a TUI API defined for each of meshing and solution mode - -which API is active depends on the current Fluent mode. The guidance here is +TUI commands refers to a programming interface that mirrors the Fluent text user +interface (TUI). There is a TUI command hierarchy defined for each of meshing and solution mode - +which hierarchy is active depends on the current Fluent mode. The guidance here is applicable to either mode. -The TUI APIs represent a means to automate workflows comprehensively: everything +The PyFluent TUI commands represent a means to automate workflows comprehensively: everything that's in the Fluent TUI (which itself is a comprehensive automation interface) -is in the TUI API. The TUI APIs provide commands that are Pythonic versions of the TUI commands used -in the Fluent console. Much like Fluent's TUI the API provides a hierarchical -interface to the underlying procedural interface of the program. +is exposed in PyFluent. The PyFluent TUI commands are Pythonic versions of those used +in the Fluent console. -The TUI APIs do not support Fluent TUI features such as aliases or -command abbreviation. As an alternative, using these APIs in an interactive +The PyFluent TUI commands do not support TUI features such as aliases or +command abbreviation. As an alternative, using these PyFluent commands in an interactive session is easier if you install a tool such as `pyreadline3 `_ which provides both command line completion and history. You can also use Python built-in functions, `help `_ and -`dir `_ on any object in the API to inspect it further. +`dir `_ on any PyFluent TUI object to inspect it further. The arguments to a TUI command are just those that would be passed in direct interaction with the -Fluent Console, but in a Pythonic style. Let's look in more detail at how the API usage mirrors -existing TUI usage, because the most productive way to write TUI API Python commands is with reference to +Fluent Console, but in a Pythonic style. Let's look in more detail at how the Python usage mirrors +existing TUI usage, because the most productive way to write Python commands is with reference to existing TUI commands. For instance, in solution mode: .. code:: lisp @@ -103,4 +102,4 @@ Note the following rules implied in the above examples: That quoting has to be preserved by wrapping the Python string in additional single quotes - The contents of string arguments are preserved -There are plenty of additional examples of TUI API usage in :ref:`ref_mixing_elbow_tui_api`. +There are plenty of additional examples of TUI command usage in :ref:`ref_mixing_elbow_tui_api`. diff --git a/src/ansys/fluent/core/session.py b/src/ansys/fluent/core/session.py index 816a6a88a862..7ceabf72c0a5 100644 --- a/src/ansys/fluent/core/session.py +++ b/src/ansys/fluent/core/session.py @@ -86,9 +86,9 @@ def _get_max_c_int_limit() -> int: ) _CODEGEN_MSG_TUI = ( - "Currently calling the TUI API in a generic manner. " + "Currently calling the TUI commands in a generic manner. " "Please run `python codegen/allapigen.py` from the top-level pyfluent " - "directory to generate the local TUI API classes." + "directory to generate the local TUI commands classes." ) @@ -102,7 +102,7 @@ class Session: for meshing TUI and various meshing datamodel API calls. solver: Session.Solver Instance of Session.Solver which holds the top-level objects - for solver TUI and settings API calls. + for solver TUI and settings objects calls. scheme_eval: SchemeEval Instance of SchemeEval on which Fluent's scheme code can be executed. diff --git a/src/ansys/fluent/core/solver/events_manager.py b/src/ansys/fluent/core/solver/events_manager.py index 3acd5eba9bb3..88a97fca573d 100644 --- a/src/ansys/fluent/core/solver/events_manager.py +++ b/src/ansys/fluent/core/solver/events_manager.py @@ -54,6 +54,13 @@ def _listen_events(self): @property def events_list(self) -> List[str]: + """Returns the list of supported events. + + Returns + ------- + List[str] + List of supported events. + """ return self._events_list def register_callback(