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

LibUserd.ansys_release_number()

Return the Ansys release number of the library.

LibUserd.ansys_release_string()

Return the Ansys release for the library.

LibUserd.connect_check()

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.

LibUserd.file_service()

Get the PIM file service object if available.

LibUserd.get_all_readers()

Return a list of the readers that are available.

LibUserd.initialize()

This call initializes the libuserd system.

LibUserd.library_version()

The library version number.

LibUserd.libuserd_exception(e)

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.

LibUserd.metadata()

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.

LibUserd.number_of_simple_element_types()

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.

LibUserd.shutdown()

Close any active gRPC connection and shut down the EnSight server.

Attributes

LibUserd.grpc_port

The current gRPC port

LibUserd.security_token

The current gRPC security token

LibUserd.server_pathname

The pathanme of the detected EnSight server executable used as the gRPC server

LibUserd.stub

A libuserd_pb2_grpc.LibUSERDServiceStub instance bound to a gRPC connection channel