# vtkPolyData parallel processing

**URL:** https://discourse.vtk.org/t/vtkpolydata-parallel-processing/10457
**Category:** Support
**Tags:** code
**Created:** [January 14, 2023, 10:49pm UTC](https://discourse.vtk.org/t/vtkpolydata-parallel-processing/10457 "2023-01-14T22:49:18Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)
#### Post date: [January 14, 2023, 10:49pm UTC](https://discourse.vtk.org/t/vtkpolydata-parallel-processing/10457/1 "2023-01-14T22:49:18Z")

</div>

I am currently in a situation where I have vtkPolyData containing many points, but only a subset of these points are vertices in a mesh and have normals associated.

I would like to like to perform some heavy operations on the points with vertices and would like to slice it up. If my dataset was a vtkMultiBlockDataSet, I would know how to do this (spatial streaming). In addition, I also need operate backwards in time. I can do this using a vtkTemporalDataSetCache.

I would like to have a multiblock ‘polydata’ set, where I can compute normals and afterwards treat the result as blocks each containing a subset of the (point, normal) pairs.

What is the easiest approach to split a vtkPolyData into a number of blocks each containing points and normals?

Thanks in advance

---

<div class="post-metadata">

### Author: ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)
#### Post date: [January 16, 2023, 5:27pm UTC](https://discourse.vtk.org/t/vtkpolydata-parallel-processing/10457/2 "2023-01-16T17:27:11Z")

</div>

I have decided to implement my surface as a vtkStructuredGrid for the x and y coordinates and two arrays, the depth (z) and a validity flag. Next implement a triangulation algorithm working on these input.

The output is a vtkStructured grid and then I have implemented a generic module for converting a vtkStructured grid into vtkMultiBlockDataSet. Finally, I can use the experimental vtkThreadedCompositeDataPipeline for executing in parallel each block set.

The algorithm working on the block set is quite heavy since it must be applied to all previous data for something called space-exclusion.

The pipeline is then

xy-grid + depth and validity → Triangulation → TemporalDataSetCache → SpaceExclusion.

For this pipeline, the vtkThreadedCompositeDataPipeline is used.

Question: How many (if any) modules can take advantage of the vtkThreadedCompositeDataPipeline.

Thanks in advance

---

<div class="post-metadata">

### Author: ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)
#### Post date: [January 16, 2023, 10:28pm UTC](https://discourse.vtk.org/t/vtkpolydata-parallel-processing/10457/3 "2023-01-16T22:28:09Z")

</div>

Ahh. I believe ghost points / cells is what I need. I will search for a functionaly for partioning a mesh into multiple cells, with points marked as ghost and real points

---

<div class="post-metadata">

### Author: ![Yohann\_Bearzi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/yohann_bearzi/32/671_2.png) [@Yohann\_Bearzi](https://discourse.vtk.org/u/Yohann_Bearzi)
#### Post date: [January 18, 2023, 9:31pm UTC](https://discourse.vtk.org/t/vtkpolydata-parallel-processing/10457/4 "2023-01-18T21:31:18Z")

</div>

Hi Jens,

If you have a recent version of VTK (I believe at least 9.1), there is a filter that will generate ghost points and ghost cells on a `vtkPolyData`. Look for `vtkGhostCellsGenerator`. It takes as input a collection of datasets and generates the ghosts.

I would advise using `vtkPartitionedDataSet` instead of `vtkMultiBlockDataSet`. It’s on the way of deprecation and there are ambiguities in this collection format that might make some filters not behave like you intend them to. You can refer to [here](https://vtk.org/doc/nightly/html/md__builds_gitlab-kitware-sciviz-ci_Documentation_Doxygen_DataAssembly.html).

---

<div class="post-metadata">

### Author: ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)
#### Post date: [January 22, 2023, 6:59pm UTC](https://discourse.vtk.org/t/vtkpolydata-parallel-processing/10457/5 "2023-01-22T18:59:18Z")

</div>

Thanks for the input. I will continue using vtkPartitionedDataSet
