build_mesh_cellcentered_1d Subroutine

public subroutine build_mesh_cellcentered_1d(mesh, n_cell, x_left, x_right, halo_width)

Build cell-centered coordinates and widths for the FVM path.

For a uniform domain [x_left, x_right] divided into n_cell cells: - dx = (x_right - x_left) / n_cell - interior cell centers: x_cell(i) = x_left + (i - 0.5) * dx (i = 1..n_cell) - ghost centers extrapolated by dx: x_cell(i) = x_left + (i - 0.5) * dx (the same formula applies for halo indices 1-h..0 and n_cell+1..n_cell+h) - dx_cell(i) = dx for all i in 1-halo_width:n_cell+halo_width

Both arrays are allocated with lower bound 1 - halo_width.

Arguments

Type IntentOptional Attributes Name
type(mesh_1d_t), intent(inout) :: mesh

Mesh object to populate (x_cell and dx_cell are set).

integer, intent(in) :: n_cell

Number of interior cells.

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

Left domain boundary coordinate.

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

Left domain boundary coordinate. Right domain boundary coordinate.

integer, intent(in) :: halo_width

Number of ghost-cell layers on each side (h >= 1).