Can surface scalar data be stored on a vtkUnstructuredGrid?

Dear VTK experts,

Is it possible to visualize scalar attributes on the faces of a vtkUnstructuredGrid, which also contains scalar attributes at each cell? Currently, I am outputting two separate files for storing the unstructured grid (.vtu file) and the corresponding surface data (.vtp file).

This method is not ideal because the points information is identical for both the .vtu and .vtp files, and only needs to be outputted once. Additionally, when visualizing in paraview, the .vtp file must be read into the pipeline after the .vtu file in order for the surface data to be properly displayed.

Given that the 2D face cells reference the same 3D points as the unstructured grid cells, could both sets of data be combined into a single file?

Thank you,
Victor

I’m afraid that VTK has no concept of face data.

I suppose you could duplicate the cell data on each of your “face” in your surface data.

Hi Mathieu,
What do you mean by duplicating cell data on each “face”? For example, if I wanted to attach a scalar value to a hexahedron, would that scalar value be stored on the faces instead - each of the 6 faces would have the same scalar value corresponding to the hexahedron cell?
Thank you,
Victor

Yes, you would first need to transform your hexahedron into 6 squares.