-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Halo inflation + restriction on halo size makes it impossible to run some problems #3622
Comments
okie -- there is definitely something wrong there |
bump ran into this again today |
It is not an optimization; rather, to fill in periodic halos, a field must have a grid size larger than the halos (for other boundary conditions, only one is required). For example: @kernel function fill_periodic_west_and_east_halo!(c, ::Val{H}, N) where H
j, k = @index(Global, NTuple)
@unroll for i = 1:H
@inbounds begin
# Put some ifelse condition here to make sure that halos pick from the interior
# and not other halos
c[i, j, k] = c[N+i, j, k] # west
c[N+H+i, j, k] = c[H+i, j, k] # east
end
end
end |
@simone-silvestri we just need to be able to write using Oceananigans
grid = RectilinearGrid(size = (16, 1, 16),
halo = (3, 1, 3),
x = (0, 1),
y = (0, 1),
z = (0, 1),
topology = (Periodic, Periodic, Bounded)) |
One option is the one above, other options that could achieve that results are: |
I like option 3. I could open a PR to tackle this issue if there is consensus in the solution |
But then what would you do for 2 grid points? |
Why not implement both 3 and 2? |
Thinking about it again, I would prefer to stay away from 2 because it results in very implicit behavior. It is nice to be explicit about the scheme used. |
We already do 2 near boundaries |
3 alone doesn't solve the problem, because we still don't know what to do with 2 grid points. |
The question is just what you want to do with things like using Oceananigans
grid = RectilinearGrid(size = (16, 1, 16),
halo = (3, 1, 3),
x = (0, 1),
y = (0, 1),
z = (0, 1),
topology = (Periodic, Periodic, Bounded))
model = NonhydrostaticModel(; grid, advection = WENO(order=5)) and using Oceananigans
grid = RectilinearGrid(size = (16, 2, 16),
halo = (3, 2, 3),
x = (0, 1),
y = (0, 1),
z = (0, 1),
topology = (Periodic, Periodic, Bounded))
model = NonhydrostaticModel(; grid, advection = WENO(order=5)) etc |
I think we want to handle this automatically because for example |
The risk of doing something automatic is that in theory someone could think "oh, I only have 2 grid poits in the y direction, but I still expect to observe WENO advection in that direction". Will someone think that? It doesn't really make sense, with 2 grid points in a direction there won't be advection at all anyways. I don't think this is a big risk. Big risks are like, simulations are dead wrong when they present an illusion that makes them seem ok. |
For example,
errors with
Sad, because I didn't actually ask for a halo (3, 3, 3)! Manually setting things doesn't help:
I guess the restriction on the halo size is supposed to be an optimization, but its not working in this case because I can't even set up my model. @navidcy
The text was updated successfully, but these errors were encountered: