Commit 07d61f7
committed
Fix swarm advection (order=2) crash after adding particles (underworldcode#108)
add_particles_with_coordinates() called PETSc's dm.migrate() directly
without invalidating the SwarmVariable _canonical_data caches. The RK2
advection buffer (_X0) retained a stale numpy array with the old particle
count, causing a shape mismatch on the next advection call.
Add cache invalidation after migrate, mirroring the existing pattern in
_recalculate_owner_and_migrate().
Underworld development team with AI support from Claude Code (https://claude.com/claude-code)1 parent 2c64215 commit 07d61f7
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3380 | 3380 | | |
3381 | 3381 | | |
3382 | 3382 | | |
| 3383 | + | |
| 3384 | + | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
3383 | 3390 | | |
3384 | 3391 | | |
3385 | 3392 | | |
| |||
0 commit comments