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
Advecting a swarm that was never populated fails with 'negative dimensions are not allowed' (DMSwarm local size -1) #702
A uw.swarm.Swarm that has had no particles added on any rank reports swarm.local_size == -1 (the DMSwarm size before any population), and swarm.advection(V_fn, dt) then dies inside numpy with ValueError: negative dimensions are not allowed. In serial as in parallel. An empty rank of a populated swarm (size 0) is handled since #680; the never-populated swarm is not the same case and deserves a clear error naming the cause. Found while resolving #693 (a driver advected its tracer swarm before the first release).
Reproduction:
mesh=uw.meshing.UnstructuredSimplexBox(minCoords=(0,0), maxCoords=(1,1), cellSize=0.25)
x, y=mesh.Xswarm=uw.swarm.Swarm(mesh)
swarm.local_size# -1swarm.advection(sympy.Matrix([[-y, x]]), 0.01) # ValueError: negative dimensions are not allowed
Fixed in 15da74b on #688: Swarm.advection raises RuntimeError('This swarm has never been populated ...') when the DMSwarm size is still -1; tests/test_0116_swarm_never_populated.py covers it with the populated swarm as the control. Reopen if #688 does not land.
Activity
Swarm.advection: a clear error for a swarm that was never populated (#…
lmoresi commentedon Sep 7, 2026
Fixed in 15da74b on #688:
Swarm.advectionraisesRuntimeError('This swarm has never been populated ...')when the DMSwarm size is still -1;tests/test_0116_swarm_never_populated.pycovers it with the populated swarm as the control. Reopen if #688 does not land.🤖 Generated with Claude Code
https://claude.ai/code/session_018T2VHUGaZiQVJ95qQ4DiSL
Navier-Stokes with Eulerian SUPG momentum transport, and a partition-…