get_q_at_face Function

private function get_q_at_face(state, idx) result(q)

Return Q at grid cell idx, reading directly from the halo'd state%ub.

Indices in [1-h, n_local+h] read the appropriate halo or interior cell. For periodic single-rank runs apply_bcs has already written the wrap into the halo cells; for multi-rank runs halo_exchange handles it. Indices that fall outside that range (e.g. iface + 1 == n_local + 2 when h == 1) are clamped to the nearest halo cell as a defensive fallback.

Arguments

Type IntentOptional Attributes Name
type(solver_state_t), intent(in) :: state

Solver state.

integer, intent(in) :: idx

Cell index (may lie outside [1, n_pt]).

Return Value real(kind=wp), (neq)