From d9e07fa1a1b7fcd638a88651d37dfd567ad7b357 Mon Sep 17 00:00:00 2001 From: Sean Pearson <93727996+seanpearsonuk@users.noreply.github.com> Date: Fri, 1 Jul 2022 17:26:46 +0100 Subject: [PATCH] update doc regarding tui (#576) * update doc regarding tui * Update conf.py * Expand the root section of settings.rst. (#574) * Expand the root section of settings.rst. * Fix doc build * Add doc paths in API code cache * update doc regarding tui * doc * doc * doc * Fix toctree * Update conf.py Co-authored-by: Mainak Kundu <94432368+mkundu1@users.noreply.github.com> Co-authored-by: Mainak Kundu --- codegen/data/tui_menu_descriptions.py | 12 +------- doc/source/api/core/solver/index.rst | 2 +- doc/source/api/core/solver/tuicommands.rst | 23 +++++++++++++++ doc/source/index.rst | 10 ------- doc/source/user_guide/boundary_conditions.rst | 8 ++--- doc/source/user_guide/general_settings.rst | 6 ++-- doc/source/user_guide/index.rst | 10 +++---- doc/source/user_guide/materials.rst | 8 ++--- doc/source/user_guide/models.rst | 8 ++--- doc/source/user_guide/solution.rst | 12 ++++---- doc/source/user_guide/solver_settings.rst | 11 ++++--- .../{tui_api.rst => tui_commands.rst} | 29 +++++++++---------- src/ansys/fluent/core/session.py | 6 ++-- 13 files changed, 72 insertions(+), 73 deletions(-) create mode 100644 doc/source/api/core/solver/tuicommands.rst rename doc/source/user_guide/{tui_api.rst => tui_commands.rst} (73%) diff --git a/codegen/data/tui_menu_descriptions.py b/codegen/data/tui_menu_descriptions.py index 636fb30c477..7bad3f3cfc4 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/index.rst b/doc/source/api/core/solver/index.rst index 78720bdbe55..e70bd1b6d8d 100644 --- a/doc/source/api/core/solver/index.rst +++ b/doc/source/api/core/solver/index.rst @@ -12,7 +12,7 @@ Solver :hidden: settings - tui/index + tuicommands datamodel/index fielddata events diff --git a/doc/source/api/core/solver/tuicommands.rst b/doc/source/api/core/solver/tuicommands.rst new file mode 100644 index 00000000000..a265e46c894 --- /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 344522b110b..5ae2ecbd948 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 3bd8e7b87ac..c58caf888a8 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 5cefbe0a920..087ac7035d7 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 3daa2376eca..841825fec0b 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, diff --git a/doc/source/user_guide/materials.rst b/doc/source/user_guide/materials.rst index af89ea22b06..df44857128e 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 c3fe622ef88..09840827a20 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 818713d51d7..b12d8cfa364 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 eb7d3426aea..cc8346254fc 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 9de7f58bcf6..6c5c25a7087 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 816a6a88a86..7ceabf72c0a 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.