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, reading directly from the halo'd state%ub.

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), dispatching on the block's method.

Read more…

Arguments

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

Solver instance state.

private subroutine compute_resid_fdm(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 subroutine compute_resid_fvm_1d(state)

Compute the cell-centered finite-volume residual R_i = -1/dx_i * (F_{i+1/2} - F_{i-1/2}) on a block of cell averages.

Read more…

Arguments

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

Solver instance state.

private pure subroutine fill_stencil(field, h, pt_start, pt_step, stencil)

Fill a reconstruction stencil from a halo'd field.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: field(:,1-h:)

Halo'd source array. The dummy's column lower bound is explicitly set to 1-h so that stencil indices like iface + stencil_start_offset that fall into the halo range map to the correct cell.

integer, intent(in) :: h

Halo width (= state%decomp%halo_width).

integer, intent(in) :: pt_start

Grid index for stencil position i = 1.

integer, intent(in) :: pt_step

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

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(:)