-
Notifications
You must be signed in to change notification settings - Fork 195
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
Advection schemes should depend on the grid
for spacings and float type inference
#3857
Comments
I've been wanting to clean up this interface a bit but haven't gotten to do it. The grid is a kwarg to allow doing stuff like
I think the idea is to move to an interface where every element requires the grid as a positional argument so if this is the idea, we could introduce a keyword argument like |
I'd favor devoting this issue to solving this problem. PS for pure questions, I think it's best to use discussions, and reserve "issues" for things that require a PR to fix. |
Thanks for the explanation @simone-silvestri! @glwagner Yeah I think this issue started off as a question (thus the title) then turned into more of a UI suggestion. I've updated the title to reflect this. Totally support making |
grid
be passed to an advection scheme?grid
for spacings and float type inference
The grid is also a positional argument for WENO at the moment
The question is whether we want a better keyword argument to specify if we use stretched or uniform coefficients. For that, the grid would probably be a required keyword argument and not an optional one. |
What's the point of having |
I think there is not much thought behind it. I support removing the grid from the keyword arguments. |
I thought we were going to discontinue support for stretched coefficients? |
I'm trying to understand how advection schemes are constructed, and I see that you can pass a float type
FT
and agrid
to the constructors.Makes perfect sense that a scheme could depend on
FT
to store any coefficients using the correct data type. It also makes perfect sense for a scheme to depend ongrid
if the coefficients vary spatially.But some constructors take both. For example,
Centered
takes both but doesn't really use thegrid
. It only uses thegrid
, if passed, to overwriteFT
. Well, looks likecompute_reconstruction_coefficients
is commented out.Oceananigans.jl/src/Advection/centered_reconstruction.jl
Lines 39 to 59 in 82099ac
Whereas
WENO
uses thegrid
to compute reconstruction coefficients:Oceananigans.jl/src/Advection/weno_reconstruction.jl
Lines 96 to 119 in 82099ac
In both cases
grid
is an optional argument. But won't the advection scheme be wrong ifgrid
is not passed then? If so, then shouldn't advection schemes just depend on thegrid
(which can be used to inferFT
)?I know some interfaces take
FT
while others takegrid
(X-Ref: #3800) so I'm not sure of the right approach here, but it seems like some advection schemes actually depend on the grid spacings.X-Ref: #3703
The text was updated successfully, but these errors were encountered: