spectral_galerkin_heat.runner
StandaloneHeatRunner: self-contained simulation runner.
Owns the time-stepping loop, I/O and telemetry. This is the entry point for running spectral_galerkin_heat from a YAML config file.
Classes
Orchestrates the full simulation lifecycle in standalone mode. |
Functions
|
Prepare the run directory for traceability before the simulation starts. |
Module Contents
- spectral_galerkin_heat.runner.initialize_run_logging(config, yaml_path, out_dir)
Prepare the run directory for traceability before the simulation starts.
Copies the YAML config (and G-code file if present) into out_dir, then writes a human-readable ASCII header to
logs/simulation.log. The header is written directly to the file so it sits above any timestamped log lines produced by the Python logging handlers.Must be called after the output directory tree has been created by
LocalFSIOManager.initialize().- Parameters:
config (Raw YAML config dict as returned by
load_config().)yaml_path (Absolute path to the original YAML configuration file.)
out_dir (Run output directory (
io_manager.base_dir).)
- Return type:
None
- class spectral_galerkin_heat.runner.StandaloneHeatRunner(context, heat_solver, io_manager=None, config=None, yaml_path=None)
Orchestrates the full simulation lifecycle in standalone mode.
Responsibilities
Runs the time-stepping loop (
while t < t_end).Delegates periodic / end-of-run output to the
LocalFSIOManager.Prints ETA / telemetry to the logger.
- param context:
Fully populated simulation parameters.
- type context:
SimulationContext
- param heat_solver:
The solver to run; build one with
spectral_galerkin_heat.solvers.build_solver().- type heat_solver:
HeatSolver
- param io_manager:
Output handler. Defaults to a fresh
LocalFSIOManager.- type io_manager:
LocalFSIOManager, optional
- run()
Executes the main simulation loop.
It initializes the logging mechanism and file outputs, builds the initial state via the solver interface, and proceeds to perform the chronological advancement loop until t_end is reached. Final states are serialized before cleanup.
- Return type:
None
- Parameters:
context (spectral_galerkin_heat.core.parameters.SimulationContext)
heat_solver (spectral_galerkin_heat.solvers.base.HeatSolver)
io_manager (spectral_galerkin_heat.io_utils.spectral_fs_io.LocalFSIOManager | None)
config (dict[str, Any] | None)
yaml_path (str | None)