!> @file block.f90 !> @brief Per-block discretization descriptor for the 1D solver. !! !! Defines @p block_t, a small DATA-ONLY record that tags a contiguous run of !! the 1D domain with the spatial-discretization method that governs it !! ('fdm' or 'fvm') and the cell count it spans. The solver state owns a fixed !! one-element array `blocks(1)`; later phases generalise to multiple blocks. !! !! @note `block_t` deliberately carries no mesh, solution arrays, or procedure !! pointers. Method dispatch for state-typed operations (e.g. the !! residual) is done by internal `select case (trim(blocks(1) % method))` !! at the call site, not by procedure pointers stored here: a state-typed !! pointer inside the state would create a circular module dependency !! (`solver_state -> block_t -> interface -> solver_state`). The grid and !! solution arrays stay on @p solver_state_t. !! !! The module is named @p block_mod (not `block`) because `block` is a Fortran !! keyword; this mirrors the repo's `cortex_run_attached.f90` / !! `cortex_run_attached_mod` naming. module block_mod use option_registry, only: method_fdm implicit none private !> Discretization descriptor for one block of the 1D domain. type, public :: block_t !> Spatial-discretization method token: 'fdm' (default) or 'fvm'. !! Mirrors `config_t % method`; see option_registry method_* tokens. character(len=8) :: method = method_fdm !> Number of cells this block spans (mirrors `config_t % n_cell`). integer :: n_cell = 0 end type block_t end module block_mod