LocalLauncher#

class ansys.pyensight.core.LocalLauncher(ansys_installation: str | None = None, application: str | None = 'ensight', batch: bool = True, grpc_use_tcp_sockets: bool | None = False, grpc_allow_network_connections: bool | None = False, grpc_disable_tls: bool | None = False, grpc_uds_pathname: str | None = None, **kwargs)#

Creates a Session instance by launching a local copy of EnSight.

This class allows you to launch locally a copy of EnSight that supports the gRPC interface. It creates and binds a Session instance to the created gRPC session and returns that instance.

Parameters:
ansys_installationstr, optional

Path to the local Ansys installation, including the version directory. The default is None, in which case common locations are scanned to detect the latest local Ansys installation. The PYENSIGHT_ANSYS_INSTALLATION environmental variable is checked first.

applicationstr, optional

App to launch. The default is ensight, but envision is also an option.

batchbool, optional

Whether to run EnSight (or EnVision) in batch mode. The default is True, in which case the full GUI is not presented.

grpc_use_tcp_sockets

If using gRPC, and if True, then allow TCP Socket based connections instead of only local connections.

grpc_allow_network_connections

If using gRPC and using TCP Socket based connections, listen on all networks.

grpc_disable_tls

If using gRPC and using TCP Socket based connections, disable TLS.

grpc_uds_pathname

If using gRPC and using Unix Domain Socket based connections, explicitly set the pathname to the shared UDS file instead of using the default.

timeoutfloat, optional

Number of seconds to try a gRPC connection before giving up. This parameter is defined on the parent Launcher class, where the default is 120.

use_eglbool, optional

Whether to use EGL hardware for accelerated graphics. The platform must be able to support this hardware. This parameter is defined on the parent Launcher class, where the default is False.

use_sosint, optional

Number of EnSight servers to use for SOS (Server of Server) mode. This parameter is defined on the parent Launcher class, where the default is None, in which case SOS mode is not used.

additional_command_line_options: list, optional

Additional command line options to be used to launch EnSight.

Examples

>>> from ansys.pyensight.core import LocalLauncher
>>> # Create one EnSight session
>>> session1 = LocalLauncher(ansys_installation='/ansys_inc/v232').start()
>>> # Create a second session (a new LocalLauncher instance is required)
>>> session2 = LocalLauncher(ansys_installation='/ansys_inc/v232').start()

WARNING: Overriding the default values for these options: grpc_use_tcp_sockets, grpc_allow_network_connections, and grpc_disable_tls can possibly permit control of this computer and any data which resides on it. Modification of this configuration is not recommended. Please see the documentation for your installed product for additional information.

Methods

LocalLauncher.close(session)

Shut down the launched EnSight session.

LocalLauncher.get_cei_install_directory(...)

Get the Ansys distribution CEI directory to use.

LocalLauncher.launch_webui(version, popen_common)

LocalLauncher.start()

Start an EnSight session using the local EnSight installation.

LocalLauncher.stop()

Release any additional resources allocated during launching.

Attributes

LocalLauncher.application

Type of app to launch.

LocalLauncher.session_directory

Root directory for HTML files.