LocalLauncher#

class ansys.pyensight.core.LocalLauncher(ansys_installation: str | None = None, application: str | None = 'ensight', batch: bool = True, **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.

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.

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()

Methods

LocalLauncher.close(session)

Shut down the launched EnSight session.

LocalLauncher.get_cei_install_directory(...)

Get the Ansys distribution CEI directory to use.

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.