launcher#

Provides a module for launching Ansys TurboGrid.

This module supports starting Ansys TurboGrid locally.

Classes:

TurboGridVersion(value)

An enumeration over supported Ansys TurboGrid versions.

Functions:

get_latest_ansys_version()

Get the latest available Ansys version from the AWP_ROOT environment variables.

get_turbogrid_exe_path(**launch_argvals)

Get the path to a local installation of TurboGrid.

launch_turbogrid([product_version, ...])

Launch TurboGrid locally in server mode.

class ansys.turbogrid.core.launcher.launcher.TurboGridVersion(value)#

Bases: Enum

An enumeration over supported Ansys TurboGrid versions.

Attributes:

version_23R2

version_23R2 = '23.2.0'#
ansys.turbogrid.core.launcher.launcher.get_latest_ansys_version() str#

Get the latest available Ansys version from the AWP_ROOT environment variables.

Returns#

str

Latest available version, in the form of “23.2.0”.

ansys.turbogrid.core.launcher.launcher.get_turbogrid_exe_path(**launch_argvals) Path#

Get the path to a local installation of TurboGrid.

The path is obtained by searching in the following order:

  1. The path specified by the “turbogrid_path” parameter from launch_argvals.

  2. The path specified by the “PYTURBOGRID_TURBOGRID_ROOT” environment variable.

  3. The path of the TurboGrid installation found from the “product_version” parameter from launch_argvals, using the corresponding “AWP_ROOTnnn” environment variable.

  4. The path of the TurboGrid installation in latest available Ansys version from the AWP_ROOT environment variables.

Returns#

Path

The path of a local TurboGrid installation.

ansys.turbogrid.core.launcher.launcher.launch_turbogrid(product_version: str | None = None, turbogrid_path: str | None = None, log_level: TurboGridLogLevel = TurboGridLogLevel.INFO, additional_args_str: str | None = None, additional_kw_args: dict | None = None, port: int | None = None, **kwargs) PyTurboGrid#

Launch TurboGrid locally in server mode.

Parameters#

product_versionstr, optional

Version of TurboGrid to use in the numeric format (such as "23.2.0" for 2023 R2). The default is None, in which case the latest installed version is used.

turbogrid_pathstr, optional

Path to the “cfxtg” command used to start TurboGrid. The default is None, in which case the product_version is used instead.

portint, optional

Port to use for TurboGrid communications. If not specified, any free port is used.

log_level: pyturbogrid_core.PyTurboGrid.TurboGridLogLevel, optional

Level of logging information written to the terminal. The default is INFO. Other available options are WARNING, ERROR, CRITICAL and DEBUG. This setting does not affect the level of output which is written to the log files.

additional_args_strstr, optional

Additional arguments to send to TurboGrid. The default is None.

additional_kw_argsdict, optional

Additional arguments to send to TurboGrid. The default is None.

Returns#

pyturbogrid_core.PyTurboGrid

TurboGrid session.