The ansys.mechanical.core library#

Summary#

embedding

Imports for the embedding sub-package.

examples

Initialize the package level imports.

errors

PyMechanical-specific errors.

feature_flags

Mechanical beta feature flags.

ide_config

Convenience CLI to run mechanical.

launcher

Launch Mechanical in batch or UI mode.

logging

Logging module.

mechanical

Connect to Mechanical gRPC server and issues commands.

misc

Contain miscellaneous functions and methods at the module level.

pool

Module for threaded implementations of the Mechanical interface.

run

Convenience CLI to run mechanical.

LocalMechanicalPool

Create a pool of Mechanical instances.

__version__

USER_DATA_PATH

User data directory.

EXAMPLES_PATH

Examples path.

LOG

Create logger for package level use.

HAS_EMBEDDING

Whether or not Mechanical embedding is being used.

LOCAL_PORTS

Manage the package level ports.

BUILDING_GALLERY

Control documentation gallery behavior and embedded-app instance sharing.

Description#

Initialize the package level imports.

Module detail#

core.USER_DATA_PATH#

User data directory.

core.EXAMPLES_PATH#

Examples path.

core.LOG#

Create logger for package level use.

core.HAS_EMBEDDING = True#

Whether or not Mechanical embedding is being used.

core.LOCAL_PORTS: list[int] = []#

Manage the package level ports.

Control documentation gallery behavior and embedded-app instance sharing.

When True:

  • Sphinx enables the example gallery during documentation builds (see doc/source/conf.py).

  • For the embedded App, multiple App() constructions reuse one underlying Mechanical instance so examples can run without exhausting resources.

To opt out of embedded instance sharing for a single App while leaving this flag unchanged (for example when BUILDING_GALLERY is set globally), pass reuse_instance=True to the constructor.