-
Notifications
You must be signed in to change notification settings - Fork 45
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
Grid getter in FunctionSpace #260
Comments
I've just updated the title and description a bit. |
I think this would be a good change and one I had been considering for a while. But also as you pointed out these could be created except for the Spectral.
|
Thanks for your comment, I wasn't aware that those types may need to construct a Grid too. @mo-jonasganderton is also interested in adding this functionality and has some ideas on how to improve the PR. We can let you know when it's ready for review. |
Is your feature request related to a problem? Please describe.
I'm working on something where it would be helpful for a FunctionSpace to be able to return a Grid.
If I understand correctly, all FunctionSpaces (excluding Spectral) should have a Grid underlying them in some way, whether that's directly ((Block)StructuredColumns), via the Mesh (Cell/Edge/NodeColumns), or implicitly via a list of Points (PointCloud).
Describe the solution you'd like
Could we have a getter in FunctionSpace, with implementations in each of the individual types except Spectral? This should be simple for the xColumns FunctionSpaces. PointCloud is trickier - I think we could generate a Grid on the fly using iterate() and return that, or return a Grid that was copied on construction of the PointCloud if it was constructed with one.
Describe alternatives you've considered
At the moment, I think I'd have to dynamic_cast to get the FunctionSpace of particualr type from the base FunctionSpace, then get Grids in the same way as described above.
Additional context
My use case is that we are implementing a simple parallel NetCDF I/O system for FieldSets in JEDI-OOPS. The first step before writing is to redistribute the data (using Redistribution) to a FunctionSpace on the same Grid as the native Fields (hence the need to obtain the grid) but who's Distribution is simply putting ~equal numbers of points onto each PE in order of Atlas's global index. The data is then written to the file in that order so that the files are agnostic to the number of PEs/domain decomposition of the native Fields. For reading the data back in, we do the reverse.
Organisation
Met Office
The text was updated successfully, but these errors were encountered: