-
Notifications
You must be signed in to change notification settings - Fork 441
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
Add integrate_data filter #2790
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2790 +/- ##
=======================================
Coverage 93.91% 93.91%
=======================================
Files 76 76
Lines 16298 16305 +7
=======================================
+ Hits 15306 15313 +7
Misses 992 992 |
I intended to add to the gallery example one that uses a volume, but I ran out of implementation |
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.
Thank you for adding this.
Co-authored-by: Tetsuo Koyama <tkoyama010@gmail.com>
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.
Thanks for adding this!
Extended this example with a simple volume example.
LGTM.
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.
LGTM
Overview
Closes #2789 . Adds ability to integrate data in a dataset including area or volume.
Details
The vtk class vtkIntegrateAttributes includes a
SetDivideAllCellDataByVolume()
method, but I have deliberately chosen not to implement it and in fact have explicitly turned it off. When enabled, only the integrated cell data is divided by the area or volume. This could be confusing, and it is straightforward for the user to implement themselves.The return from this filter is a bit weird at first, an
UnstructuredGrid
with 1 point and 1 cell. I considered returning a dict, e.g.{"data": 99.1, "Area": 2.45}
. But given that we can have name clashes between point and cell data arrays, we'd have to return two dicts. So I have chosen to keep the default vtk behavior, and tried to explain this multiple times in the documentation and examples.