-
Notifications
You must be signed in to change notification settings - Fork 1
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
Extend data access API #169
Conversation
add parameter index and only get averaged of the variable at position index
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.
Looks sensible to me. Just note that changing the public API requires a breaking release. That's OK, of course.
Alternatively, you could consider to only extend the API, e.g., by adding a new trixi_load_cell_average
or trixi_load_cell_averages_single
function. That has the advantage that you can still decide to introduce a breaking change later. It has the downside, that you need more tests.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #169 +/- ##
==========================================
+ Coverage 81.75% 83.92% +2.16%
==========================================
Files 21 21
Lines 773 877 +104
Branches 52 52
==========================================
+ Hits 632 736 +104
Misses 137 137
Partials 4 4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
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.
Looks mostly good to me, but I think there are some structural decisions to be made (or maybe they have been made but I am just not aware 😬)
…i into more-data-access
Say I want to stay as close to Trixi.jl as possible and have read |
IMHO only when talking about mesh-related operations that are independent of the solver. For example, querying the number of cells is usually not something you need, since you are rather interested in the actual elements (i.e., cells with solver data attached to it), which might or might not have a one-to-one relation with the cells. From the top of my head, I don't see many occasions where the word "cell" would come up as part of an API name. |
Great! Thanks for your hints! This is now totally cell-free. And totally breaking. |
Co-authored-by: Michael Schlottke-Lakemper <[email protected]>
New
trixi_ndofs(int handle);
trixi_ndofsglobal(int handle);
trixi_ndofselement(int handle);
trixi_nnodes(int handle);
trixi_load_primitive_vars(int handle, int variable_id, double * data);
trixi_load_node_reference_coordinates(int handle, double* node_coords);
trixi_load_node_weights(int handle, double* node_weights);
Breaking changes
trixi_nelementsglobal(int handle);
(wastrixi_nelements_global(int handle);
)trixi_load_element_averaged_primitive_vars(int handle, int variable_id, double * data);
(wastrixi_load_cell_averages(double * data, int handle);
Conventions
Adopt https://trixi-framework.github.io/Trixi.jl/stable/conventions/#Cells-vs.-elements-vs.-nodes. For libtrixi, avoid "cell" in favor of "element".
Related #43