Fix off-by-one in moving_wall_bc ghost fill (stegoton_1d)#757
Conversation
Fill the outermost lower ghost cell (range(num_ghost-1) -> range(num_ghost)). Closes clawpack#717.
|
Heads up on the failing checks: they're the So |
|
Thanks! Yes, please go ahead and push an updated reference solution. |
The moving_wall_bc fix changes the example output, so the stored reference solution is regenerated for all four configs (the tests pass against it).
|
Pushed the regenerated |
Fixes #717.
moving_wall_bcfills the lower ghost cells withfor ibc in range(num_ghost-1),which writes ghost indices
num_ghost-1down to1, so the outermost lower ghostcell (index 0) never gets set.
range(num_ghost)letsibcreachnum_ghost-1,which writes index 0 too.
Quick check of just that loop (ghost cells marked NaN so an unwritten one shows up):
Before the change the outermost ghost cell is left unset; after, all
num_ghostcells are filled (the reflection pairs index
num_ghost-ibc-1with interiornum_ghost+ibc).