Provides a single public entry point apply_initial_condition that fills
the conserved-state array state%ub (interior + halo) for the chosen
problem. For boundary conditions that use early-return in apply_bcs
(dirichlet / inflow / supersonic_inlet), this routine also pre-fills the
halo cells with the prescribed boundary state.
Supported problems: 'sod' — Sod shock tube 'shu_osher' — Shu-Osher shock/entropy-wave interaction 'smooth_wave' — Smooth advecting density wave (periodic) 'linear_advection' — Sinusoidal density on uniform background flow (periodic) 'woodward_colella' — Woodward-Colella interacting blast waves 'lax' — Lax shock tube 'from_file' — Read primitives (x, rho, u, p) from an external data file 'udf' — Call a user-defined Fortran subroutine compiled at runtime 'acoustic_pulse' — Gaussian acoustic pulse (quiescent background; NRBC benchmark)
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=c_int), | private, | parameter | :: | host_platform_windows | = | 1_c_int | |
| integer(kind=c_int), | private, | parameter | :: | host_platform_macos | = | 2_c_int | |
| integer(kind=c_int), | private, | parameter | :: | host_platform_linux | = | 3_c_int |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(kind=c_char, len=1), | intent(in) | :: | libpath(*) | |||
| integer(kind=c_int), | intent(in), | value | :: | n | ||
| real(kind=c_double), | intent(in) | :: | x(n) | |||
| real(kind=c_double), | intent(out) | :: | rho(n) | |||
| real(kind=c_double), | intent(out) | :: | rho_u(n) | |||
| real(kind=c_double), | intent(out) | :: | e_arr(n) |
Return the host platform detected by the C portability shim.
Return the preferred runtime-UDF output directory on Windows.
Join a directory and leaf name with a platform-appropriate separator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | dirpath | |||
| character(len=*), | intent(in) | :: | leafname | |||
| character(len=1), | intent(in) | :: | separator |
Wrap a filesystem path for the shell used by execute_command_line.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | raw_path |
Fill state%ub (interior + halo) with the initial condition selected by
cfg%problem_type. Boundary halo cells are also pre-populated for
Dirichlet-style BCs (dirichlet/inflow/supersonic_inlet) which use early
return in apply_bcs.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_state_t), | intent(inout), | target | :: | state |
Solver state (must have ub allocated, schemes bound) |
|
| type(config_t), | intent(in) | :: | cfg |
Runtime configuration |
Convert namelist primitives (rho_left, u_left, p_left / rho_right, ...) to conserved state vectors.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(config_t), | intent(in) | :: | cfg | |||
| real(kind=wp), | intent(in) | :: | gam | |||
| real(kind=wp), | intent(out) | :: | q_l(neq) | |||
| real(kind=wp), | intent(out) | :: | q_r(neq) |
Fill the boundary halo cells with the prescribed Dirichlet states.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_state_t), | intent(inout) | :: | state | |||
| real(kind=wp), | intent(in) | :: | q_l(neq) | |||
| real(kind=wp), | intent(in) | :: | q_r(neq) |
Load the initial condition from a data file containing columns: x rho u p.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_state_t), | intent(inout) | :: | state |
Solver state (must have ub allocated, schemes bound) |
||
| type(config_t), | intent(in) | :: | cfg |
Runtime configuration (uses cfg%ic_file, cfg%ic_interp, cfg%gam) |
Compile a user-defined Fortran source file to a shared library at runtime
and call its ic_udf subroutine to fill the initial state.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_state_t), | intent(inout) | :: | state |
Solver state (must have ub allocated, schemes bound) |
||
| type(config_t), | intent(in) | :: | cfg |
Runtime configuration (uses cfg%ic_udf_src) |