You cannot do it directly. But what you can do is convert the single mesh with RegionID
into a partitioned structure that the ParaView GUI will understand.
There is no direct filter to do it, but it has been discussed before: How to create a collection of blocks (multi block) based on connectivity. The instructions there are a bit out of date, so here is an update.
Create a Programmable Filter
. Set the output data type to vtkPartitionedDataSet
. Set the script to the following:
import vtk
inp = self.GetInputDataObject(0, 0)
out = self.GetOutput()
outData = vtk.vtkPartitionedDataSet()
rangeID = inputs[0].CellData.GetArray('RegionId').GetRange()
outData.SetNumberOfPartitions(int(rangeID[1]) + 1)
for ic in range(int(rangeID[0]), int(rangeID[1]) + 1):
thresh = vtk.vtkThreshold()
thresh.SetInputData(inp)
thresh.SetInputArrayToProcess(0,0,0,
vtk.vtkDataObject.FIELD_ASSOCIATION_CELLS,'RegionId')
thresh.SetLowerThreshold(ic-0.5)
thresh.SetUpperThreshold(ic+0.5)
thresh.Update()
tooutData = thresh.GetOutputDataObject(0)
outData.SetPartition(ic, tooutData)
out.DeepCopy(outData)
This will run internally run the threshold filter on all region ids and then collect them into a vtkPartitionedDataSet
.
Once you have a vtkPartitionedDataSet
, you can use select block (or just hit
b
) in the view and click on a face to select it.
star-blocks.pvsm (670.2 KB)