All per-simulation state for the 1D Euler solver.
Immutable simulation parameters are stored in the embedded cfg field
(a copy of the config_t struct); call init_from_config to populate it
and the derived grid scalars n_pt, dx. Allocatable arrays must be
explicitly allocated before use (see @p euler_1d and
and must be bound via init_flux_scheme() and init_recon_scheme() before
any residual call.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(config_t), | public | :: | cfg |
Configuration object (copy of the parsed input). Access physics,
grid bounds, BC types, scheme names, etc. via state%cfg% |
|||
| integer, | public | :: | n_pt | = | 0 |
Per-rank interior count (= decomp%n_local at runtime). For FDM this is a node count (= cfg%n_cell+1 at -np 1); for FVM a cell count (= cfg%n_cell). |
|
| integer, | public | :: | n_pt_global | = | 0 |
Total global interior count across all ranks (= decomp%n_global). FDM: cfg%n_cell+1 (nodes); FVM: cfg%n_cell (cells). Used to normalise the global L2 residual norm in compute_resid_glob. |
|
| type(mesh_1d_t), | public | :: | mesh |
Grid metric layer (node coordinates + dx/dξ Jacobian). Built by init_from_config (global) and allocate_work_arrays (local slice). |
|||
| type(decomp_t), | public | :: | decomp |
Per-rank decomposition descriptor. Populated by solver_runtime at session init (Task 6 of the Phase B plan); read by halo_exchange, boundary_conditions, and any other rank-aware code path. At -np 1 this defaults to a single-rank, self-contained decomposition. |
|||
| type(block_t), | public | :: | blocks(1) |
Per-block discretization metadata (method + cell count). A single
block spans the whole 1D domain today; |
|||
| real(kind=wp), | public | :: | dt | = | 0.0_wp |
Current time step size Δt [s]. Initialised from cfg%dt; updated each step by CFL control or last-step clipping. |
|
| real(kind=wp), | public | :: | resid_glob | = | 0.0_wp |
Global L2 residual norm, updated at the end of every time step. |
|
| logical, | public | :: | is_periodic | = | .false. |
True when periodic BCs are active (set by apply_bcs()). |
|
| procedure(reconstructor_iface), | public, | pointer, nopass | :: | reconstruct | => | null() |
Procedure pointer to the active nonlinear reconstruction scheme. Set by init_recon_scheme(); null until then. |
| procedure(reconstructor_iface), | public, | pointer, nopass | :: | smooth_reconstruct | => | null() |
Procedure pointer to the smooth-region reconstruction used by hybrid mode. For schemes without a dedicated smooth-region companion, this is bound to the same procedure as @p reconstruct. |
| procedure(flux_splitter_iface), | public, | pointer, nopass | :: | flux_split | => | null() |
Procedure pointer to the active flux-splitting scheme (FVS path). Set by init_flux_scheme(); null when a FDS scheme is active. |
| procedure(flux_splitter_both_iface), | public, | pointer, nopass | :: | split_both | => | null() |
Fused flux-splitting procedure that computes F^+ and F^- in one call. Avoids extracting primitives twice per cell in the FVS precompute loop. Set by init_flux_scheme() alongside flux_split; null for FDS schemes. |
| procedure(fds_iface), | public, | pointer, nopass | :: | fds_solver | => | null() |
Procedure pointer to the active FDS approximate Riemann solver. Set by init_flux_scheme(); null when a FVS scheme is active. |
| integer, | public | :: | stencil_width | = | 5 |
Active reconstruction stencil width. Examples: WENO5 = 5, WENO-CU6 = 6, WENO11 = 11. |
|
| integer, | public | :: | stencil_start_offset | = | -3 |
Left-biased stencil start offset relative to the face index. For example, WENO5 uses -3 so the left-biased stencil starts at iface-3 and covers columns iface-3 : iface+1. |
|
| integer, | public | :: | halo_width | = | 3 |
Halo width: number of additional cells on each side of a rank's interior region that must be exchanged from neighbours to drive the reconstruction stencil. Sized by the chosen scheme's stencil metadata (determined by init_recon_scheme). |
|
| logical, | public | :: | use_char_proj | = | .false. |
When .true., spatial_discretization applies K^{-1}/K projection around the reconstruct() call. Set by init_recon_scheme() based on char_proj. |
|
| logical, | public | :: | use_fds | = | .false. |
True when a FDS scheme (AUSM+, HLL, HLLC, Roe) is active. When false the FVS path via flux_split is used. |
|
| real(kind=wp), | public, | allocatable | :: | ub(:,:) |
Conserved variables Q_i (neq × n_pt). |
||
| real(kind=wp), | public, | allocatable | :: | num_flux(:,:) |
Numerical flux at cell faces (neq × (n_pt+1)). |
||
| real(kind=wp), | public, | allocatable | :: | resid(:,:) |
Spatial residual R(Q) (neq × n_pt). |
||
| real(kind=wp), | public, | allocatable | :: | fp(:,:) |
Positive split flux F^+ (neq × n_pt). |
||
| real(kind=wp), | public, | allocatable | :: | fm(:,:) |
Negative split flux F^- (neq × n_pt). |
||
| type(perf_counters_t), | public | :: | perf |
Accumulated wall-clock timers; populated only when cfg%do_timing is .true.. |
|||
| real(kind=wp), | public, | allocatable | :: | scratch1(:,:) |
Scratch array 1 (neq × n_pt): stage save for SSPRK22, TVD-RK3, RK4, SSPRK54. Pre-allocated once to avoid per-step heap allocations in the time loop. |
||
| real(kind=wp), | public, | allocatable | :: | scratch2(:,:) |
Scratch array 2 (neq × n_pt): second stage save for RK4 (k_sum) and SSPRK54 (ub_stage2). |
||
| real(kind=wp), | public, | allocatable | :: | scratch3(:,:) |
Third RK stage-save scratch (ssprk54: holds u3; the L(u3) residual stays in resid, with its final-stage piece accumulated early). |
||
| logical, | public | :: | bdf2_initialized | = | .false. |
True after the first bdf2_step() call (bootstrap complete). |
|
| real(kind=wp), | public, | allocatable | :: | bdf2_ub_prev(:,:) |
Q^{n-1} storage for BDF2. Allocated lazily on first bdf2_step() call. |
||
| real(kind=wp), | public, | allocatable | :: | gather_buf(:,:) |
Rank-0-owned gather buffer for write_solution_file / write_snapshot. Shape (neq, n_pt_global) on rank 0; (neq, 0) on every other rank. Allocated by allocate_work_arrays once decomp is known and reused on every writer call to avoid per-call alloc/dealloc churn. |
Nullify procedure pointer components when the instance is finalised. Allocatable array components are automatically deallocated by Fortran.
Nullify procedure pointer components of a solver_state_t instance.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_state_t), | intent(inout) | :: | self |
The solver state being finalised. |