neofoam.framework.initialization¶
Populate a Context before any
operation runs.
NeoFOAM solvers can’t start their main loop until fields, operators, models, and the mesh are constructed and wired together. This package owns that pre-run work and splits it into three layers:
Steps & helpers — the unit of deferred initialization is an
InitStep: a name, its dependencies, and a factory callable. The four helpers (field(),operator(),model(),lazy()) apply the canonical name prefix and category;InitializerBuildercollects them via a fluent API.Execution —
execute_initialization()validates the step graph, sorts topologically, runs each step in order, and routes the results into the Context. Seeexecution.Three-stage pipeline — for solvers that need to LOAD → RESOLVE → BUILD,
StagedInitSpec(decorator-driven registration) plusStagedInitRunner(execution) orchestrate the three stages and hand off toexecute_initialization()at the end. Seestaged.
Dependency injection of resolved values into solver callbacks is
expressed with Depends; routing is open for extension via
CategoryRouter (register a custom handler, pass it to
execute_initialization()).
See Three-stage initialization for the design rationale and stage semantics.