morphogen.dynamics.openradioss

OpenRadioss on this machine: where it is installed (find_openradioss()), the environment its programs need, its runs (run_openradioss(): the Starter, then the Engine, their progress followed in their listings, stopped at a checkpoint of morphogen.stopping), the conversion of its outputs (anim_to_vtk for the animations, th_to_csv for the time histories) and the installation of a release that the OpenRadioss project publishes on GitHub (install_openradioss()).

OpenRadioss (https://github.com/OpenRadioss/OpenRadioss, AGPL-3.0) is a separate program: morphoGen writes its inputs, runs its executables and reads their outputs, and neither ships nor links it. An installation is the folder of a release (its exec, hm_cfg_files and extlib folders), found from, in order: the path given, the environment variables MORPHOGEN_OPENRADIOSS and OPENRADIOSS_PATH (that of OpenRadioss’s documentation), the folder where install_openradioss() puts it (~/morphogen/openradioss), and a Starter on the PATH.

morphogen.dynamics.openradioss.ENVIRONMENT = ('MORPHOGEN_OPENRADIOSS', 'OPENRADIOSS_PATH')

The environment variables of the folder of an installation, in order

morphogen.dynamics.openradioss.REPOSITORY = 'OpenRadioss/OpenRadioss'

The repository of OpenRadioss, whose releases install_openradioss() installs

morphogen.dynamics.openradioss.RELEASE_FILE = 'morphogen_release.json'

The file that records the release installed in its folder

morphogen.dynamics.openradioss.ASSETS = {('Darwin', 'arm64'): ('macos', 'mac', 'darwin'), ('Darwin', 'x86_64'): ('macos', 'mac', 'darwin'), ('Linux', 'aarch64'): ('linuxa64', 'linux_arm64', 'aarch64', 'arm64'), ('Linux', 'arm64'): ('linuxa64', 'linux_arm64', 'aarch64', 'arm64'), ('Linux', 'x86_64'): ('linux64',), ('Windows', 'AMD64'): ('win64',), ('Windows', 'x86_64'): ('win64',)}

The words of the names of the archives of the releases, by system and machine

morphogen.dynamics.openradioss.default_home() → Path[source]

The folder where install_openradioss() installs OpenRadioss by default.

class morphogen.dynamics.openradioss.OpenRadioss(root: Path, starter: Path, engine: Path, engine_mpi: Path | None = None, anim_to_vtk: Path | None = None, th_to_csv: Path | None = None, suffix: str = '', release: dict = <factory>)[source]

Bases: object

An installation of OpenRadioss: its folder (root), the Starter, the Engine (and its MPI version), the converters of its outputs when it has them, the suffix of the names of its executables (linux64_gf, win64…) and the release installed (when install_openradioss() installed it).

property version: str | None
library_folders() → list[Path][source]

The folders of the shared libraries of its programs (the reader of the inputs, H3D, the runtimes of the compilers), for the platform of the executables.

environment(threads: int | None = None, base: dict | None = None) → dict[source]

The environment of its programs: OPENRADIOSS_PATH, RAD_CFG_PATH (the configuration of the reader of the inputs), RAD_H3D_PATH, the stack of the OpenMP threads, their number, and the folders of its libraries on the search path of the system.

describe() → dict[source]

Its folder, executables and release, for the page and the command line.

morphogen.dynamics.openradioss.find_openradioss(path=None) → OpenRadioss[source]

The installation of OpenRadioss at path (its folder, its exec folder or its Starter), else the first found in the places of the module; raises FileNotFoundError, saying how to install it, when there is none.

morphogen.dynamics.openradioss.has_openradioss(path=None) → bool[source]

Whether an installation of OpenRadioss is found.

class morphogen.dynamics.openradioss.RadiossRun(directory: ~pathlib.Path, name: str, frames: list[~pathlib.Path], history: ~pathlib.Path | None, listings: dict[str, ~pathlib.Path], elapsed: float = 0.0, warnings: list[str] = <factory>)[source]

Bases: object

A run of OpenRadioss in its directory: its animations converted to legacy VTK files (frames, in their order), its time history converted to CSV (history, None without th_to_csv), its listings and the time it took (s).

morphogen.dynamics.openradioss.run_openradioss(directory, name: str | None = None, *, threads: int | None = None, mpi: int | None = None, installation=None, progress: Callable | None = None, convert: bool = True, timeout: float | None = None) → RadiossRun[source]

Run the inputs written in directory (morphogen.io.write_radioss()): the Starter, then the Engine with threads OpenMP threads (all the cores by default) or on mpi processes (mpiexec and the Engine built with MPI), then the conversion of the animations and of the time history (convert).

progress(fraction, message) is called as the run advances (the time of the last cycle printed in the listing of the Engine); a stop asked by morphogen.stopping kills the programs. Raises RuntimeError when a program fails (the errors of its listing); its logs stay in the directory.

morphogen.dynamics.openradioss.animation_files(directory, name: str) → list[Path][source]

The animation files of a run (<name>A001, <name>A002…), in order.

morphogen.dynamics.openradioss.convert_outputs(run: RadiossRun, installation=None, *, env=None, progress=None) → RadiossRun[source]

Convert the outputs of a run: each animation to a legacy VTK file (anim_to_vtk, <name>A001.vtk…) and the time history to CSV (th_to_csv); the outputs already converted are kept. A converter missing from the installation is skipped with a warning of the run.

morphogen.dynamics.openradioss.release_info(tag: str | None = None, *, api: str = 'https://api.github.com', timeout: float = 60) → dict[source]

The release tag of OpenRadioss on GitHub (the latest by default): its name, tag and archives (assets: name, size, URL).

morphogen.dynamics.openradioss.release_asset(release: dict, system: str | None = None, machine: str | None = None) → dict[source]

The archive of a release (release_info()) for this system and machine.

morphogen.dynamics.openradioss.install_openradioss(target=None, *, tag: str | None = None, api: str = 'https://api.github.com', progress: Callable | None = None, timeout: float = 120, system: str | None = None, machine: str | None = None) → OpenRadioss[source]

Download the release tag of OpenRadioss (the latest by default) for this system from GitHub and unpack it into target (~/morphogen/openradioss by default), which replaces an earlier installation there; returns the installation. Releases are published for Linux (x86-64, ARM) and Windows; elsewhere OpenRadioss is built from its sources. progress(fraction, message) follows the download.