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
Sessioninstance 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
Sessioninstance to the created gRPC session and returns that instance.- Parameters:
- ansys_installation
str,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. ThePYENSIGHT_ANSYS_INSTALLATIONenvironmental variable is checked first.- application
str,optional App to launch. The default is
ensight, butenvisionis 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.
- timeout
float,optional Number of seconds to try a gRPC connection before giving up. This parameter is defined on the parent
Launcherclass, where the default is120.- 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
Launcherclass, where the default isFalse.- use_sos
int,optional Number of EnSight servers to use for SOS (Server of Server) mode. This parameter is defined on the parent
Launcherclass, where the default isNone, in which case SOS mode is not used.- additional_command_line_options: list, optional
Additional command line options to be used to launch EnSight.
- ansys_installation
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.
Get the Ansys distribution CEI directory to use.
LocalLauncher.launch_webui(version, popen_common)Start an EnSight session using the local EnSight installation.
Release any additional resources allocated during launching.
Attributes
Type of app to launch.
Root directory for HTML files.