Skip to content

Commit

Permalink
Feat/gui mode (#430)
Browse files Browse the repository at this point in the history
* allow show gui via arg

* allow show gui via arg - tweaked te logic

* correct comment following logic change

* Update src/ansys/fluent/core/launcher/launcher.py

Co-authored-by: Dan Williams <[email protected]>

* remove code that differs in style

* change == to is (review comment)

* Adding settings based api example, and other changes (#428)

* Adding settings based api example, and other changes

* Titles fix

* Fixing convergance issue. Removing pandas.

* Fixing typo

* Adding exit commands, thubnail image

* Style check fix

* Upgrade to protobuf==3.20.1

* allow show gui via arg

* allow show gui via arg - tweaked te logic

* correct comment following logic change

* remove code that differs in style

* Update src/ansys/fluent/core/launcher/launcher.py

Co-authored-by: Dan Williams <[email protected]>

* change == to is (review comment)

Co-authored-by: Dan Williams <[email protected]>
Co-authored-by: Yogesh Patel <[email protected]>
  • Loading branch information
3 people authored May 30, 2022
1 parent 41ae157 commit 7b2cfc7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/ansys/fluent/core/launcher/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def launch_fluent(
ip: str = None,
port: int = None,
cleanup_on_exit: bool = True,
show_gui: bool = None,
) -> Session:
"""Start Fluent locally in server mode or connect to a running Fluent
server instance.
Expand Down Expand Up @@ -183,6 +184,15 @@ def launch_fluent(
PyFluent is exited or exit() is called on the session instance,
by default True.
show_gui : bool, optional
When True, the Fluent GUI will be displayed as long as start_instance
is also True, which can also be set by the environment
variable PYFLUENT_SHOW_SERVER_GUI=<0 or 1>``. The show-gui argument has
the effect of overriding the PYFLUENT_SHOW_SERVER_GUI variable. E.g., if
PYFLUENT_SHOW_SERVER_GUI is set to 1, the gui is hidden if show-gui is
set to False. The default is None so that explicit False settings can
be detected.
Returns
-------
ansys.fluent.session.Session
Expand All @@ -200,7 +210,9 @@ def launch_fluent(
launch_string += f" {additional_arguments}"
launch_string += f' -sifile="{server_info_filepath}"'
launch_string += " -nm"
if not os.getenv("PYFLUENT_SHOW_SERVER_GUI"):
if (show_gui is False) or (
show_gui is None and (os.getenv("PYFLUENT_SHOW_SERVER_GUI") != "1")
):
launch_string += " -hidden"
LOG.info("Launching Fluent with cmd: %s", launch_string)
sifile_last_mtime = Path(server_info_filepath).stat().st_mtime
Expand Down

0 comments on commit 7b2cfc7

Please sign in to comment.