Skip to content
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

GaussianMask doesn't work with Flat directions #3728

Open
glwagner opened this issue Aug 25, 2024 · 0 comments
Open

GaussianMask doesn't work with Flat directions #3728

glwagner opened this issue Aug 25, 2024 · 0 comments
Labels
bug 🐞 Even a perfect program still has bugs

Comments

@glwagner
Copy link
Member

glwagner commented Aug 25, 2024

MWE:

using Oceananigans

grid = RectilinearGrid(size = (10, 10),
                       x = (0, 1),
                       z = (0, 1),
                       topology = (Periodic, Flat, Bounded))

mask = GaussianMask{:x}(center=1, width=0.1)
sponge = Relaxation(rate=1; mask)

model = HydrostaticFreeSurfaceModel(; grid, forcing = (; u=sponge))

simulation = Simulation(model; Δt=1, stop_iteration=1)
run!(simulation)

The fix is a little involved because we can't distinguish between the arguments (y, z) and (x, y) by function arguments alone. Thus the mask itself needs to have grid information.

This and other bug are the extended consequences of changing node to drop flat dimensions (#3355, with discussion on #3285). I still think the price was worth it for betting scripting, but it has come with a pretty significant trade-off in terms of under the hood code complexity...

@glwagner glwagner added the bug 🐞 Even a perfect program still has bugs label Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Even a perfect program still has bugs
Projects
None yet
Development

No branches or pull requests

1 participant