Implement a new MeshMaterialFilter#3406
Conversation
pshriwise
left a comment
There was a problem hiding this comment.
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 <drshimwell@gmail.com> Co-authored-by: Patrick Shriwise <pshriwise@gmail.com>
|
@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. |
pshriwise
left a comment
There was a problem hiding this comment.
Looks good @paulromano! I'll give this a short cooldown and merge tomorrow.
Description
This PR implements a new
MeshMaterialFilterthat allows tallying specific combinations of mesh elements and materials. In principle, one can already do this by combining aMeshFilterand 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 aMeshMaterialVolumesobject. 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