It is often convenient to group datasets (they are called blocks in this context) into larger ones. The collection of blocks is called a multiblock dataset. Blocks can be processed on different nodes in a parallel simulation or visualization. Blocks with different topology which are not easily merged together, can be grouped and processed as one dataset. Sometimes, a multiblock dataset can have thousands of blocks which makes it difficult to understand how blocks are organized in the dataset. Previous versions of ParaView provided a way color the blocks in a multiblock dataset using the Random Attributes filter and then checking Attributes Constant Per Block property; this generates an attribute array with all elements (cells or points) constant within a block.
This feature may be hard to find, and blocks are colored randomly which may not be desired in all cases. We have added additional ways to color blocks in a multiblock datasets which provide more control over block colors and don’t require additional filters.
vtkCompositeIndex and vtkBlockColors field arrays
ParaView adds a field array and a cell array to any multiblock dataset processed. The field array has one value for an entire block. Both arrays can be used to color the blocks in a multiblock dataset.
vtkCompositeIndex cell array contains, for each block, the block index with all cells in a block having the same value. While the user can color by this array, if the dataset has a large number of blocks, adjacent blocks will have very similar colors. This might prevent a clear picture of how blocks are organized in the dataset.
vtkBlockColors is a field array with one value. For each block, the value is the remainder of blockIndex divided by BlockColorsDistinctValues. BlockColorsDistinctValues is a user configurable value accessible in Edit / Settings… / General (default value is 7). This is an advanced property. If the user colors by this array a categorical color map is automatically selected.
Multiblock Inspector Enhancements
In a previous post we described the Multiblock Inspector, a panel in ParaView which allows users to set the visibility, color and opacity of individual blocks in a multiblock dataset. We enhance this panel to show block colors set through the vtkCompositeIndex and vtkBlockColor arrays. We provide visual feedback for overridden color or opacity. The next image shows a multiblock dataset with 127 blocks, colored using vtkBlockColors array. We set blocks 122 and 1 colors to yellow and opacity to 0.3. Note that we show the overridden color and opacity by enclosing them in a black square.
The text was updated to reflect the fact that vtkCompositeIndex was reverted back to a cell array.