ndiffusion.cell_centroids

ndiffusion.cell_centroids(mesh: ndiffusion._core.UnstructuredMesh2D) → tuple[numpy.ndarray[float64], numpy.ndarray[float64]]

Return (cx, cy) cell centroids, each of length n_cells.

Area centroids from the shoelace formulae, so any simple polygon works - the same centroids the FVM solvers use internally, so painting materials by centroid position agrees with the solve.