build_mesh_cellcentered_global Subroutine

public subroutine build_mesh_cellcentered_global(mesh, n_cell)

Build the replicated GLOBAL cell-centered mesh for a NON-UNIFORM FVM grid.

The cell-centered twin of the nodal arrays built by build_mesh_global: where that routine fills x_global/jac_global, this fills x_cell_global and dx_cell_global. For an FVM file grid the grid_file nodes ARE the cell faces, and build_mesh_global has already loaded those n_cell+1 faces into mesh % x_global. This routine derives, for each interior cell i = 1..n_cell: - center x_cell_global(i) = 0.5 * (face(i) + face(i+1)) - width dx_cell_global(i) = face(i+1) - face(i) and is the authoritative source of non-uniform cell geometry, later sliced per rank by build_mesh_cellcentered_local.

It is intentionally NOT called on the uniform FVM path: there the local builder recomputes cell centers/widths analytically from x_left/x_right so the uniform result stays bit-for-bit identical to the original formula.

Arguments

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

Mesh object; x_global (faces) must already be populated.

integer, intent(in) :: n_cell

Number of interior cells (= number of faces - 1).