-
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
interpolate
doesn't work with Nothing
locations
#3356
Comments
Functions like Oceananigans.jl/src/Fields/interpolate.jl Lines 109 to 113 in d0b7ec8
|
Oceananigans.jl/src/Fields/interpolate.jl Line 111 in d0b7ec8
Shouldn't this be |
Is there some kind of performance benefit of Oceananigans.jl/src/Fields/interpolate.jl Lines 63 to 67 in d0b7ec8
compared to Oceananigans.jl/src/Fields/interpolate.jl Lines 75 to 81 in d0b7ec8
? Why do we have both? |
I'm not sure if we've tested but I've assumed there is a performance benefit to the simpler version for regularly spaced grids rather than using the binary search. It would probably be sensible to change the differentiation between the methods to just |
@simone-silvestri have you ever benchmarked this? |
I have never tried benchmarking this. maybe the gain in performance is negligible. I guess it will depend on the number of particles and the size of the grid. |
The function
interpolate
is currently mostly used for Lagrangian particle advection:Oceananigans.jl/src/Fields/interpolate.jl
Lines 186 to 198 in d0b7ec8
However, it's also potentially useful for many other things. Right now though it doesn't work (or make sense) for fields with
Nothing
locations:gives
It doesn't really make sense to have to pass a
z
location intointerpolate
. I think we should refactor this function to read something likeinterpolate(to_node, from_field, from_location, from_grid)
Then
to_node
can be a tuple of appropriate length for thefrom_location
andfrom_grid
topology.The text was updated successfully, but these errors were encountered: