launcher#
Module for launching a local instance of Ansys TurboGrid.
Classes:
|
Provide an enumeration over supported TurboGrid versions. |
Functions:
Get the latest installed Ansys version from |
|
|
Get the path to a local installation of TurboGrid. |
|
Launch TurboGrid locally in server mode. |
|
Launch TurboGrid from within the Ansys Labs environment. |
- class ansys.turbogrid.core.launcher.launcher.TurboGridVersion(value)#
Bases:
EnumProvide an enumeration over supported TurboGrid versions.
Attributes:
- version_23R2 = '23.2.0'#
- version_24R1 = '24.1.0'#
- version_24R2 = '24.2.0'#
- version_25R1 = '25.1.0'#
- version_25R2 = '25.2.0'#
- version_26R1 = '26.1.0'#
- ansys.turbogrid.core.launcher.launcher.get_latest_ansys_version() str#
Get the latest installed Ansys version from
AWP_ROOTxxxenvironment variables.Note
The
xxxis the three-digit Ansys version. For example, theAWP_ROOT232environment variable specifies the path to the directory where Ansys 2023 R2 is installed. If Ansys 2023 R2 is installed in the default directory on Windows, the value for this environment variable isC:\Program Files\ANSYS Inc\v232.Returns#
- str
Latest installed Ansys version in this format:
"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 this order:
The path specified by the
turbogrid_pathparameter fromlaunch_argvals.The path specified by the
PYTURBOGRID_TURBOGRID_ROOTenvironment variable.The path of the TurboGrid installation specified by the
product_versionparameter fromlaunch_argvals, using the correspondingAWP_ROOTxxxenvironment variable.The path of the TurboGrid installation from the
AWP_ROOTxxxenvironment variable for the latest installed Ansys version.
Returns#
- Path
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, turbogrid_location_type=TurboGridLocationType.TURBOGRID_INSTALL, additional_args_str: str | None = None, additional_kw_args: dict | None = None, port: int | None = None, host: str = '127.0.0.1', log_filename_suffix: str = '', **kwargs) PyTurboGrid#
Launch TurboGrid locally in server mode.
Parameters#
- product_versionstr, default:
None Version of TurboGrid to use in the numeric format. For example,
"23.2.0"for 2023 R2. The default isNone, in which case the latest installed version is used.- turbogrid_pathstr, default:
None Path to the
cfxtgcommand for starting TurboGrid. The default isNone, in which case the value for theproduct_versionparameter is used.- log_levelpyturbogrid_core.PyTurboGrid.TurboGridLogLevel, default:
INFO Level of logging information written to the terminal. The default is
INFO. Options areINFO,WARNING,ERROR,CRITICAL, andDEBUG. This setting also affects the level of output that is written to the log files.- additional_args_strstr, default:
None Additional arguments to send to TurboGrid.
- additional_kw_argsdict, default:
None Additional arguments to send to TurboGrid.
- portint, default:
None Port for TurboGrid communications. The default is
None, in which case an available port is automatically selected.- hoststr, default:
127.0.0.1 (this is the local host IP for windows and linux) Host for TurboGrid communications. The default is
127.0.0.1, or the local host- log_filename_suffixstr, default: “”
Suffix for name of the log files written out.
Returns#
- pyturbogrid_core.PyTurboGrid
TurboGrid session.
- product_versionstr, default:
- ansys.turbogrid.core.launcher.launcher.launch_turbogrid_ansys_labs(product_version: str = 'latest', log_level: TurboGridLogLevel = TurboGridLogLevel.INFO) PyTurboGrid#
Launch TurboGrid from within the Ansys Labs environment.
Parameters#
- product_versionstr, default:
latest Version of TurboGrid to launch in the Ansys Labs environment. Only certain versions are supported.
- log_levelpyturbogrid_core.PyTurboGrid.TurboGridLogLevel, default:
INFO Level of logging information written to the terminal. The default is
INFO. Options areINFO,WARNING,ERROR,CRITICAL, andDEBUG. This setting also affects the level of output that is written to the log files.
Returns#
- pyturbogrid_core.PyTurboGrid
TurboGrid session.
- product_versionstr, default:
- ansys.turbogrid.core.launcher.launcher.launch_turbogrid_container(cfxtg_command_name, image_name, container_name, cfx_version, license_file, keep_stopped_containers, container_env_dict) deployed_tg_container#