LibUserd#
- class ansys.pyensight.core.libuserd.LibUserd(ansys_installation: str = '', use_docker: bool = False, data_directory: str | None = None, docker_image_name: str | None = None, use_dev: bool = False, product_version: str | None = None, channel: Channel | None = None, pim_instance: Any | None = None, timeout: float = 120.0, pull_image_if_not_available: bool = False)#
LibUserd is the primary interface to the USERD library. All interaction starts at this object.
- Parameters:
- ansys_installation
Optional location to search for an Ansys software installation.
Examples
>>> from ansys.pyensight.core import libuserd >>> l = libuserd.LibUserd() >>> l.initialize() >>> readers = l.query_format(r"D:\data\Axial_001.res") >>> data = readers[0].read_dataset(r"D:\data\Axial_001.res") >>> part = data.parts[0] >>> print(part, part.nodes()) >>> l.shutdown()
Methods
Return the Ansys release number of the library.
Return the Ansys release for the library.
Verify that there is an active gRPC connection established.
LibUserd.download_pyansys_example
(filename)Download an example dataset from the ansys/example-data repository.
LibUserd.element_is_ghost
(element_type)For a given element type (e.g. HEX20), determine if the element type should be considered a "ghost" element.
LibUserd.element_is_nfaced
(element_type)For a given element type, determine if the element type is n-faced or not
LibUserd.element_is_nsided
(element_type)For a given element type, determine if the element type is n-sided or not
LibUserd.element_is_zoo
(element_type)For a given element type (e.g. HEX20), determine if the element type is zoo or not.
Get the PIM file service object if available.
Return a list of the readers that are available.
This call initializes the libuserd system.
The library version number.
Given an exception raised as the result of a gRPC call, return either the input exception or a LibUserdError exception object to differentiate between gRPC issues and libuserd issues.
LibUserd.load_data
(data_file[, result_file, ...])Use the reader to load a dataset and return an instance to the resulting
Reader
interface.Compute the gRPC stream metadata
LibUserd.nodes_per_element
(element_type)For a given element type (e.g. HEX20), return the number of nodes used by the element.
There is a consecutive range of element type enums that are supported by the Part.element_conn() method.
LibUserd.query_format
(name1[, name2])For a given dataset (filename(s)), ask the readers if they should be able to read that data.
Close any active gRPC connection and shut down the EnSight server.
Attributes
The current gRPC port
The current gRPC security token
The pathanme of the detected EnSight server executable used as the gRPC server
A libuserd_pb2_grpc.LibUSERDServiceStub instance bound to a gRPC connection channel