-
Notifications
You must be signed in to change notification settings - Fork 42
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
Enable MeshBuilder to set up the Grid #152
Enable MeshBuilder to set up the Grid #152
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! A few minor changes requested.
src/atlas/mesh/MeshBuilder.cc
Outdated
} else { | ||
throw_Exception("In MeshBuilder: can't validate a grid of type " + grid.type() + " from config"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can in principle use the iterator here with random access as last resort. It will work for any grid, but could be slower than the 2 above methods.
auto point = *(grid.lonlat().begin()+global_indices[i]-1);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion, I've added this
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #152 +/- ##
===========================================
+ Coverage 78.01% 78.04% +0.03%
===========================================
Files 817 817
Lines 52464 52588 +124
===========================================
+ Hits 40928 41043 +115
- Misses 11536 11545 +9
☔ View full report in Codecov by Sentry. |
Co-authored-by: Willem Deconinck <wdeconinck@me.com>
Co-authored-by: Willem Deconinck <wdeconinck@me.com>
Co-authored-by: Willem Deconinck <wdeconinck@me.com>
Co-authored-by: Willem Deconinck <wdeconinck@me.com>
Co-authored-by: Willem Deconinck <wdeconinck@me.com>
Co-authored-by: Willem Deconinck <wdeconinck@me.com>
@wdeconinck — Thanks for the feedback, and mostly for the extensive planning discussion in the preceding issue! |
Add a config argument to the MeshBuilder's call operator. This config can be used to request setting the mesh's grid, either as an UnstructuredGrid from the available coordinates in the MeshBuilder, or as a grid of choice according to the config.
This resolves #150 for the most part. Some edge cases are discussed there that I did not code up in this PR (could be added later if needed, though).