Skip to content

Commit

Permalink
update doc regarding tui (#576)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Mainak Kundu <[email protected]>
  • Loading branch information
3 people authored Jul 1, 2022
1 parent 19ff92c commit d9e07fa
Show file tree
Hide file tree
Showing 13 changed files with 72 additions and 73 deletions.
12 changes: 1 addition & 11 deletions codegen/data/tui_menu_descriptions.py
Original file line number Diff line number Diff line change
@@ -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 = {}
2 changes: 1 addition & 1 deletion doc/source/api/core/solver/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Solver
:hidden:

settings
tui/index
tuicommands
datamodel/index
fielddata
events
Expand Down
23 changes: 23 additions & 0 deletions doc/source/api/core/solver/tuicommands.rst
Original file line number Diff line number Diff line change
@@ -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
10 changes: 0 additions & 10 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------------------
Expand Down
8 changes: 4 additions & 4 deletions doc/source/user_guide/boundary_conditions.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions doc/source/user_guide/general_settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions doc/source/user_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ and monitor Ansys Fluent.
:hidden:

launching_ansys_fluent
tui_api
tui_commands
meshing_workflows
general_settings
solver_settings
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions doc/source/user_guide/materials.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions doc/source/user_guide/models.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 5 additions & 7 deletions doc/source/user_guide/solution.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 5 additions & 6 deletions doc/source/user_guide/solver_settings.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/pyreadline3/pyreadline3>`_ which provides
both command line completion and history. You can also use Python built-in functions,
`help <https://docs.python.org/3/library/functions.html#help>`_ and
`dir <https://docs.python.org/3/library/functions.html#dir>`_ on any object in the API to inspect it further.
`dir <https://docs.python.org/3/library/functions.html#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
Expand Down Expand Up @@ -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`.
6 changes: 3 additions & 3 deletions src/ansys/fluent/core/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
)


Expand All @@ -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.
Expand Down

0 comments on commit d9e07fa

Please sign in to comment.