solver_controller#
Module to control a CFX-Solver instance.
Classes:
|
Provides basic operations for a local CFX-Solver session. |
- class ansys.cfx.core.solver_controller.SolverController(**kwargs)#
Bases:
objectProvides basic operations for a local CFX-Solver session.
Classes:
RunState(*values)Enumerates over CFX-Solver run states.
Methods:
__init__(**kwargs)Set up a CFX-Solver session.
get_results_file_name([use_engine_path])Get the name of the results file associated with the current session.
Get the CFX-Solver run state.
Check if a CFX-Solver run is in progress.
Start a CFX-Solver run.
stop_run([wait_for_run])Stop the CFX-Solver run currently in progress.
wait_for_run([interval, timeout])Wait for a CFX-Solver run in progress to complete.
- class RunState(*values)#
Bases:
EnumEnumerates over CFX-Solver run states.
Attributes:
- DEFINED = 1#
- ERROR = 4#
- FINISHED = 3#
- IN_PROGRESS = 2#
- NONE = 0#
- __init__(**kwargs)#
Set up a CFX-Solver session.
- Parameters:
- processed_args
dict Contains arguments initially passed to a
Solver.from_install()function.
- processed_args
- Raises:
RuntimeErrorIf the provided arguments in
process_argsare not consistent or any necessary files do not exist.
- get_results_file_name(use_engine_path: bool = False) str | None#
Get the name of the results file associated with the current session.
- get_run_state() RunState#
Get the CFX-Solver run state.
- Returns:
RunStateCurrent CFX-Solver run state.
- is_running() bool#
Check if a CFX-Solver run is in progress.
- Returns:
- bool
Trueif a CFX-Solver run is in progress.
- start_run() None#
Start a CFX-Solver run.
This command can also be used to restart from an existing results file if the Solver session has previously completed a successful run or if the Solver session was started with a ‘results_file_name` argument.
Execution control is read from the CFX-Solver input file.
- Raises:
RuntimeErrorIf the run cannot be successfully started.
- stop_run(wait_for_run=True) None#
Stop the CFX-Solver run currently in progress.
If a run is not currently in progress, the command does nothing.
- wait_for_run(interval=10, timeout=86400) None#
Wait for a CFX-Solver run in progress to complete.
Note that run completion is indicated by the removal of the working directory and/or the presence of the results file or results error file. Some CFX-Solver failures may not trigger the “run complete” condition. In this case, the
wait_for_run()function raises an exception after the specified timeout.- Parameters:
- Raises:
RuntimeErrorIf the run has not stopped within the specified timeout.