Implement a new MeshMaterialFilter #3406
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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