spatial_discretization Module



Functions

private function eval_face_sensor(state, iface, q_stencil) result(s)

Evaluate the hybrid shock sensor for face iface.

Read more…

Arguments

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

Solver state (solution arrays and config).

integer, intent(in) :: iface

Face index in [1, n_pt+1].

real(kind=wp), intent(in) :: q_stencil(:,:)

Return Value real(kind=wp)

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

Return Q at grid cell idx with ghost-state fallback at boundaries.

Read more…

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)


Subroutines

public subroutine compute_resid(state)

Compute the spatial residual R(Q) = -1/dx * (F_{i+1/2} - F_{i-1/2}).

Read more…

Arguments

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

Solver instance state.

private pure subroutine fill_stencil(field, n_pts, pt_start, pt_step, ghost_lo, ghost_hi, periodic, stencil)

Fill a reconstruction stencil from field, applying ghost states at domain boundaries.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: field(:,:)
integer, intent(in) :: n_pts

Number of active grid points.

integer, intent(in) :: pt_start

Number of active grid points. Grid index for stencil position i = 1.

integer, intent(in) :: pt_step

Number of active grid points. Grid index for stencil position i = 1. Index stride per position: +1 (left-biased) or -1 (right-biased).

real(kind=wp), intent(in) :: ghost_lo(:)
real(kind=wp), intent(in) :: ghost_hi(:)
logical, intent(in) :: periodic

If .true., wrap out-of-bounds indices periodically.

real(kind=wp), intent(out) :: stencil(:,:)

private subroutine reconstruct_with_proj(recon, stencil, r_mat, r_inv, proj, flux_out)

Reconstruct a face flux or state with optional characteristic projection.

Read more…

Arguments

Type IntentOptional Attributes Name
procedure(reconstructor_iface) :: recon

Active reconstruction procedure pointer.

real(kind=wp), intent(in) :: stencil(:,:)
real(kind=wp), intent(in) :: r_mat(:,:)
real(kind=wp), intent(in) :: r_inv(:,:)
logical, intent(in) :: proj

Enable characteristic-space projection.

real(kind=wp), intent(out) :: flux_out(:)