-
Notifications
You must be signed in to change notification settings - Fork 548
Implement a new MeshMaterialFilter #3406
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
Implement a new MeshMaterialFilter #3406
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.
Nice @paulromano! I'm looking forward to trying this out. Some potential small refactors suggested here.
Awesome, thanks Patrick, looks like lots of good changes. I've been putting this branch to use to see how the workflow goes. I can probably improve this draft notebook. It does appear possible to do and R2S workflow with this new MeshMaterialFilter. I can't say it was easy and I'm not 100% sure I've done all the processing correctly but I've got something here. I think we could consider adding some utility functions to make some of the stages more compact. |
Co-authored-by: Jonathan Shimwell <[email protected]> Co-authored-by: Patrick Shriwise <[email protected]>
@shimwell @pshriwise Thanks for the reviews on this PR and glad to hear that you are already incorporating it into your workflows Jon. There are a few more pieces that are needed IMO to make the mesh-based R2S workflow correct/seamless including, as you suggested, some utility functions. I have another branch or two I'm working on with exactly that. In any case, all the comments have been addressed other than a few which I've responded directly to about why I haven't incorporated them. Let me know if you have any further requests for changes. |
I don't have any further changes. Looks good from my point of view I clicked resolve on my only remaining comment as you addressed it with the /n I would be keen to evolve the R2S example I made to make use of your utility functions as they arrive. It will be really satisfying to shrink that example down to a more manageable script. |
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 good @paulromano! I'll give this a short cooldown and merge tomorrow.
Description
This PR implements a new
MeshMaterialFilter
that allows tallying specific combinations of mesh elements and materials. In principle, one can already do this by combining aMeshFilter
and aMaterialFilter
. However, in many cases a single mesh element only contains a few materials, which means tallying every single material for each mesh element would be very wasteful. This new filter works in conjunction with theMesh.material_volumes()
method, which returns aMeshMaterialVolumes
object. This filter has afrom_volumes()
classmethod that will create a filter with bins for all mesh element-material combinations that were found from the call tomaterial_volumes()
. So, the workflow is basically:This new filter is one of the last infrastructural pieces needed to carry out mesh-based subvoxel R2S calculations.
Checklist