-
Notifications
You must be signed in to change notification settings - Fork 0
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
Traits #1
Comments
struct NorthSouth <: OrderedGrid end
struct SouthNorth <: OrderedGrid end
struct Unordered <: GridOrder end This is not a problem to define if helpful for any algorithms here. Oceananigan's grids are "[east:west, south:north]" (in column-major), I believe, whereas SpeedyWeather uses "[east:west, north:south]" so a SpeedyWeather uses consistently the RING SCHEME (top panel) for all grids. But I reckon the cubed sphere would also likely employ something similar to the NESTED SCHEME outlined here. As far as I understand it, making assumptions about the order could provide performance potential as only a smaller subset of polygons would need to be intersected as you know that all others are far away and therefore wouldn't intersect anymore. |
@danlooo might be interested in this from the DGGS.jl perspective. |
# Are the polygons all quadrilaterals?
struct Quad end
struct NotQuad end
isquad(::MyGrid) = Quad()
isquad(::MyOtherGrid) = NotQuad() Yes, all grids of SpeedyWeather and Oceananigans consist of only quadrilaterals. But I was wondering whether for the sake of generality we should just do a |
also maybe https://github.com/eth-cscs/ImplicitGlobalGrid.jl devs might be interested |
About Also, matrices probably don't work in the general case. We can always allow high level methods to override for performance optimizations, or create new traits to describe whether the grids are |
Yes, one can not tessellate the globe using only hexagons, there will always be 12 pentagons, requiring grids of mixed shape (e.g. ISEA4H discrete global grid system or Uber H3). |
For the multi-matrix case, I was thinking we could use a flattened vector to store values, with some accelerator index based on which "face set" the series of indices is in. Kind of like spatial chunking :D - Gael has a similar structure I believe, though Simone's grid (ClimaOcean) is simply representable as a matrix. But GridInterface probably doesn't need to know about that, beyond the implementing methods having some acceleration. |
@gaelforget this is an example of traits for the interface
Theyre not meant to be representative of the actual traits, just an example of the structure that we can use for more appropriate things
The text was updated successfully, but these errors were encountered: