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.X
swarm = uw.swarm.Swarm(mesh)
swarm.local_size # -1
swarm.advection(sympy.Matrix([[-y, x]]), 0.01) # ValueError: negative dimensions are not allowed
🤖 Generated with Claude Code
https://claude.ai/code/session_018T2VHUGaZiQVJ95qQ4DiSL
A
uw.swarm.Swarmthat has had no particles added on any rank reportsswarm.local_size == -1(the DMSwarm size before any population), andswarm.advection(V_fn, dt)then dies inside numpy withValueError: 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:
🤖 Generated with Claude Code
https://claude.ai/code/session_018T2VHUGaZiQVJ95qQ4DiSL