spectral_galerkin_heat.solvers.base =================================== .. py:module:: spectral_galerkin_heat.solvers.base .. autoapi-nested-parse:: Abstract interface for Heat Equation Solvers. Classes ------- .. autoapisummary:: spectral_galerkin_heat.solvers.base.HeatSolver Module Contents --------------- .. py:class:: HeatSolver Bases: :py:obj:`abc.ABC` Abstract interface for a Heat Equation Solver. Encapsulates the physics engine and numerical methods for solving the transient heat equation with phase change and evaporation. **Contract:** - Call ``initialize`` once before ``step``. - Call ``step`` repeatedly to advance time. - Call ``finalize`` to release resources (GPU memory, etc.). - Do not modify returned state objects; call ``step`` to evolve. .. py:method:: initialize(context) :abstractmethod: Initialize (or re-initialize) the solver with the given context. Stores the context internally, allocates fields and spectral coefficients, and returns the initial state object. :param context: Full simulation parameters (geometry, material, etc.). :type context: SimulationContext :returns: The initial state object (implementation-dependent). :rtype: Any .. py:method:: step(t, dt) :abstractmethod: Advance the simulation by one time step `dt`. :param t: Current simulation time. :type t: float :param dt: Time step size. :type dt: float :returns: new_state : Any The evolved state object. metrics : dict Dictionary of scalar diagnostics (e.g., {'P_laser': 50.0, 'T_max': 2000.0}). :rtype: tuple .. py:method:: finalize() :abstractmethod: Clean up resources (GPU memory, thread pools) if necessary.