PointData vs 0D CellData

Dear all,

I am working on a custom filter that works with PointData only. Hence I am using a CellDataToPointData operation if the input is CellData.
If I were to keep CellData across the entire custom fitler, I would have to double the amount of code to account for CellData operations through the entire custom filter.

However, I have discovered the existence of 0D Cell Data vertices thanks to the VTK_VERTEX and VTK_POLY_VERTEX VTKCell types (1 and 2 respectively)

What is the philosophical difference between 0D CellData and PointData ?
For example, does the choice between the two affects the way gradients are computed (via a gradient filter) or the way data are integrated (via vtkIntegrateAttributes) ?

Would it be wiser to write a custom filter only with CellData functions and perform a PointData to 0D CellData VTK_POLY_VERTEX operation if the input is PointData, rather than a PointData custom filter ?

Thanks a lot,
Sincerely yours

Hi @Bodacious,

Point/cell association and cell dimension are separate concepts:

  • Point data has one tuple per point.
  • Cell data has one tuple per cell, regardless of dimension.
  • A VTK_VERTEX is a 0D cell containing one point, so its cell data can correspond one-to-one with that point.
  • VTK_POLY_VERTEX is a single cell containing multiple points, so its cell data does not map one-to-one to individual points.
  • Creating 100 separate vertex cells would provide a one-to-one mapping.

For numerical operations, consider both the association and topology:

  • vtkGradientFilter requires neighboring points or cells for gradient reconstruction.
  • vtkIntegrateAttributes integrates over cells and uses their geometric dimensions.
  • vtkCellDataToPointData is appropriate when point-associated values are required, but it interpolates cell values onto points.

For your custom filter, choose the association based on what the computation represents:

  • Use point data for values defined at points.
  • Use cell data for values defined over cells.
  • Use cell data for per-vertex values only if each vertex is a separate cell.

If the operation involves neighborhoods, interpolation, gradients, or integration, the appropriate association also depends on the required topology.

Could you describe what your custom filter computes? That would help determine the correct input and output association.