You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mesh.cell_size() is partition-dependent: the per-cell radius comes from a kd-tree over the rank's centroids, so cells at partition boundaries get a different size on each rank count #687
Mesh.cell_size() returns a P0 field filled from self._radii, which _get_mesh_sizes computes as the RMS distance from each cell's vertices to the NEAREST centroid found by a kd-tree over the centroids this rank holds. Near a partition boundary the nearest centroid is a different cell than in serial (the neighbour set is truncated), so the field, and everything scaled by it (the SUPG tau of the Eulerian solvers, the Nitsche penalty gamma mu / h), depends on the partition.
Measured on the Kovasznay-flow test of the SUPG Navier-Stokes solver (feature/navier-stokes-supg, res 8, three steps from the exact solution, solver tolerance 1e-11 so the linear solve is not the cause):
tau built on
np 1 error
np 2 error
difference
a constant h (get_min_radius)
0.0023408316563576
0.0023408316563546
1e-15
mesh.cell_size()
0.0024855792696189
0.0024843274043763
5e-4
The plain Stokes solve and the tau = 0 (Galerkin) step on the same mesh are partition-independent to 1e-12, so the cell-size field is the only rank-dependent input. The scalar SUPG parallel test (test_1077) did not catch it because at its Courant number tau is dominated by the transient term and h barely enters.
The fix is a purely local definition of the size, each cell's vertices against its own centroid, which is identical on any partition and equal to the present value on a regular mesh; on an irregular mesh it is the same quantity without the neighbour's centroid occasionally standing in. Implemented alongside the Navier-Stokes SUPG solver, where it was found.
Underworld development team with AI support from Claude Code
Duplicate of #569 (15 August), which is still open and carries the consequence this one does not: add_nitsche_bc(local_h=True) is the default, so Nitsche answers moved 6.6e-03 between rank counts.
Same defect, and #692 fixes it — measured across rank counts on that branch: the new own-cell field is bit-identical at np=1/2/4 (max abs diff 0.000e+00), while the legacy kd-tree field moves by 3.3e-03 (np2) and 4.1e-03 (np4).
Suggest closing this one in favour of #569, or closing both from #692.
See the consolidated proposal on #694 — this, #569, the get_*_radius() contract and the naming are all one tidy-up rather than four.
Short version: three definitions of "cell radius" are in play (kd-tree neighbour spacing, #692's own-centroid RMS, and PETSc's volume**(1/dim)), the docstrings describe the PETSc one while the code uses the kd-tree one, and the PETSc routine — abandoned years ago as broken — now returns one finite value per cell and is bit-identical across rank counts.
Activity
fix: make stabilization cell sizes local to each cell (underworldcode…
lmoresi commentedon Sep 5, 2026
Duplicate of #569 (15 August), which is still open and carries the consequence this one does not:
add_nitsche_bc(local_h=True)is the default, so Nitsche answers moved 6.6e-03 between rank counts.Same defect, and #692 fixes it — measured across rank counts on that branch: the new own-cell field is bit-identical at np=1/2/4 (max abs diff 0.000e+00), while the legacy kd-tree field moves by 3.3e-03 (np2) and 4.1e-03 (np4).
Suggest closing this one in favour of #569, or closing both from #692.
lmoresi commentedon Sep 6, 2026
See the consolidated proposal on #694 — this, #569, the
get_*_radius()contract and the naming are all one tidy-up rather than four.Short version: three definitions of "cell radius" are in play (kd-tree neighbour spacing, #692's own-centroid RMS, and PETSc's
volume**(1/dim)), the docstrings describe the PETSc one while the code uses the kd-tree one, and the PETSc routine — abandoned years ago as broken — now returns one finite value per cell and is bit-identical across rank counts.fix: make stabilization cell sizes local to each cell (underworldcode…
Make mesh.cell_size() local and partition independent (#692)
Merge origin/development into feature/navier-stokes-supg: take the la…
Parallel tests: a refinement hierarchy for the Navier-Stokes referenc…
Navier-Stokes with Eulerian SUPG momentum transport, and a partition-…
Merge development (#688 Navier-Stokes SUPG, #687 cell size) into feat…
lmoresi commentedon Sep 9, 2026
Fixed by #692 and merged to development via #688 (1d5e8c1): mesh.cell_size() is now cell-local and partition independent.
Guarded by tests/parallel/test_1077 (the field, cell by cell against its own serial answer) and test_1078 (the three radius accessors).