fluent_adapter#
Resilient-mode adapter for Fluent solver sessions.
This module holds every Fluent-specific detail used by resilient mode: the
session’s error state and health check, Fluent’s read-only settings exception,
the clean stop of an interrupted solve, case and data files as checkpoints, and
launch_fluent for standby sessions.
Classes:
Resilient-mode adapter for Fluent solver sessions. |
- class ansys.fluent.core.resilient.fluent_adapter.FluentAdapter#
Bases:
ResilientAdapterResilient-mode adapter for Fluent solver sessions.
Methods:
can_checkpoint(session)Return whether a case is loaded.
checkpoint_artifacts(file_path, *, include_data)Return the case file and, with data, the companion data file.
Return Fluent's read-only settings exception class.
fatal_details(session)Return the details of Fluent's fatal error, if any.
invalidate_settings_cache(session)Drop the cached settings root of a solver session.
is_fatal(session)Return whether Fluent reported a fatal error for the session.
is_interrupt(err)Return whether
erris the clean stop of an interrupted solve.is_server_healthy(session)Return whether the Fluent server answers its health check.
launch(**kwargs)Launch a Fluent session with
launch_fluent.read_checkpoint(session, file_path, *, ...)Read the case (and data) written by
write_checkpoint().register_exit_callback(session, callback)Run
callbackwhen the session's Fluent connection is finalized.shares_client_filesystem(session)Return whether Fluent runs locally, outside a container.
standby_launcher(session)Return a launcher that repeats the launch of a local or container session.
write_checkpoint(session, file_path, *, ...)Write the case, and the data when it exists, to
file_path.Attributes:
File suffix of a checkpoint artifact.
Commands for which the clean-stop sentinel is a benign interrupt.
Command names that cannot be undone by setting values (a checkpoint is written before them when
auto_checkpointis enabled).Commands that are recorded but never replayed onto a standby session.
Command-name prefixes that are recorded but never replayed (for example commands that only write output files).
Dotted prefixes a user may prepend to a settings path.
Product name used in messages.
Attribute holding the server-side name of a settings object.
- can_checkpoint(session)#
Return whether a case is loaded.
- checkpoint_artifacts(file_path, *, include_data)#
Return the case file and, with data, the companion data file.
- error_classes()#
Return Fluent’s read-only settings exception class.
- fatal_details(session)#
Return the details of Fluent’s fatal error, if any.
-
interruptible_commands:
frozenset[str] = frozenset({'calculate', 'dual_time_iterate', 'iterate'})# Commands for which the clean-stop sentinel is a benign interrupt.
- invalidate_settings_cache(session)#
Drop the cached settings root of a solver session.
-
irreversible_commands:
frozenset[str] = frozenset({'calculate', 'dual_time_iterate', 'iterate', 'read', 'read_case', 'read_case_data', 'read_data', 'read_mesh', 'replace', 'replace_mesh'})# Command names that cannot be undone by setting values (a checkpoint is written before them when
auto_checkpointis enabled).
- is_fatal(session)#
Return whether Fluent reported a fatal error for the session.
- is_interrupt(err)#
Return whether
erris the clean stop of an interrupted solve.Fluent ends an interrupted
iterateorcalculatewithRuntimeError("()").
- is_server_healthy(session)#
Return whether the Fluent server answers its health check.
- launch(**kwargs)#
Launch a Fluent session with
launch_fluent.
-
non_replayable_commands:
frozenset[str] = frozenset({'interrupt'})# Commands that are recorded but never replayed onto a standby session.
-
non_replayable_prefixes:
tuple[str,...] = ('write', 'export', 'save', 'print', 'display')# Command-name prefixes that are recorded but never replayed (for example commands that only write output files).
-
path_prefixes:
tuple[str,...] = ('solver.settings.', 'settings.')# Dotted prefixes a user may prepend to a settings path.
- read_checkpoint(session, file_path, *, include_data)#
Read the case (and data) written by
write_checkpoint().The case and the data are read separately: after a floating point exception, Fluent reads the case of a combined case and data read but skips the data.
- Raises:
RuntimeErrorIf Fluent did not load the data.
- register_exit_callback(session, callback)#
Run
callbackwhen the session’s Fluent connection is finalized.
Return whether Fluent runs locally, outside a container.
- standby_launcher(session)#
Return a launcher that repeats the launch of a local or container session.
Sessions launched by PyFluent on the client machine, directly or in a container, are supported. A container standby is another container started with the same arguments, so it mounts the same host folder. For PIM, remote, or file-transfer sessions, pass
PoolConfig(launch_kwargs=...).
- write_checkpoint(session, file_path, *, include_data)#
Write the case, and the data when it exists, to
file_path.