Update ghost cells of state%ub for the CELL-CENTERED finite-volume path.
Fills the ghost-cell averages ub(:, 1-h : 0) (left) and ub(:, n_local+1 : n_local+h) (right) for the full BC token set. Rank-aware exactly like apply_bcs_fdm: only edge ranks write physical BCs; periodic at -np > 1 is handled by halo_exchange.
Cell-centered vs nodal anchoring — the only two places it matters: * periodic at -np 1: there is NO duplicated endpoint node (unlike the nodal FDM grid where ub(:,1) == ub(:,n_pt)), so the in-process wrap copies whole interior cell averages: ghost(1-k) <- cell(n_local+1-k) and ghost(n_local+k) <- cell(k) (the 1D collapse of boundary_2d::apply_periodic_halos_2d). * reflecting (solid wall): mirrored about the boundary FACE, i.e. ghost(1-k) = mirror(cell k) with normal momentum negated (the 1D collapse of boundary_2d::fill_x_edge).
Every other BC operates on the first/second interior cell as q_wall / q_penult state vectors (anchor-independent), so apply_left_bc_into_halo / apply_right_bc_into_halo and compute_boundary_ghost (and the characteristic / extrapolation helpers they call) are SHARED with the FDM path unchanged: - prescribed (dirichlet/inflow/supersonic_inlet): ghosts preset, no write; - zero-gradient / extrapolation (outflow, neumann, supersonic_outlet, neumann_gradient): copied/extrapolated from the adjacent interior cell; - characteristic (nonreflecting LODI/Thompson, subsonic_inlet/outlet): the relaxation acts on the state vector + gamma/sound speed (not on node positions), so the math carries over verbatim with the first interior cell supplying the wall state. The shared reflecting fill in apply_left_bc_into_halo / apply_right_bc_into_halo is ALREADY face-anchored (ghost(1-k) = mirror(cell k)), matching the cell-centered requirement, so no FVM-specific reflecting code is needed.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_state_t), | intent(inout) | :: | state |
Solver instance state. |