DynaSettings#

class ansys.health.heart.settings.settings.DynaSettings(lsdyna_path: pathlib.Path = 'lsdyna.exe', dynatype: Literal['smp', 'intelmpi', 'platformmpi', 'msmpi'] = 'intelmpi', num_cpus: int = 1, platform: Literal['windows', 'wsl', 'linux'] = 'windows', dyna_options: str = '', mpi_options: str = '')#

Class for collecting, managing, and validating LS-DYNA settings.

This class provides configuration management for LS-DYNA simulations, including executable paths, parallelization settings, platform-specific configurations, and command-line argument generation.

Parameters:
lsdyna_pathpathlib.Path

Path to LS-DYNA executable.

dynatypestr

Type of LS-DYNA executable (smp, intelmpi, platformmpi, msmpi).

num_cpusint

Number of CPUs requested for parallel execution.

platformstr

Platform for LS-DYNA execution (windows, wsl, linux).

dyna_optionsstr

Additional command line options for LS-DYNA.

mpi_optionsstr

Additional MPI options for parallel execution.

Examples

>>> dyna_settings = DynaSettings(
...     lsdyna_path="lsdyna.exe", dynatype="intelmpi", num_cpus=4, platform="windows"
... )
>>> commands = dyna_settings.get_commands("input.k")

Overview#

get_commands

Get command line arguments from the defined settings.

lsdyna_path

Path to LS-DYNA executable.

dynatype

Type of LS-DYNA executable.

num_cpus

Number of CPU’s requested.

platform

Platform LS-DYNA is executed on.

dyna_options

Additional command line options for dyna.

__repr__

Represent self as YAML-formatted string.

Import detail#

from ansys.health.heart.settings.settings import DynaSettings

Attribute detail#

DynaSettings.lsdyna_path: pathlib.Path = 'lsdyna.exe'#

Path to LS-DYNA executable.

DynaSettings.dynatype: str = 'intelmpi'#

Type of LS-DYNA executable.

DynaSettings.num_cpus: int = 1#

Number of CPU’s requested.

DynaSettings.platform: str = 'windows'#

Platform LS-DYNA is executed on.

DynaSettings.dyna_options = ''#

Additional command line options for dyna.

Method detail#

DynaSettings.get_commands(path_to_input: pathlib.Path) list[str]#

Get command line arguments from the defined settings.

Builds platform-specific command line arguments for running LS-DYNA with the configured settings including MPI and parallelization options.

Parameters:
path_to_inputpathlib.Path

Path to the LS-DYNA input file.

Returns:
list[str]

List of command line arguments for executing LS-DYNA.

Raises:
WSLNotFoundError

If WSL platform is specified but wsl.exe is not found.

Examples

>>> dyna_settings = DynaSettings(dynatype="smp", num_cpus=4)
>>> commands = dyna_settings.get_commands(Path("input.k"))
>>> print(commands[0])  # LS-DYNA executable path
DynaSettings.__repr__()#

Represent self as YAML-formatted string.

Returns:
str

YAML representation of the DynaSettings object attributes.