# Piece ID from vtkXMLPUnstructuredGridReader

**URL:** https://discourse.vtk.org/t/piece-id-from-vtkxmlpunstructuredgridreader/2265
**Category:** Support
**Created:** [December 12, 2019, 11:18pm UTC](https://discourse.vtk.org/t/piece-id-from-vtkxmlpunstructuredgridreader/2265 "2019-12-12T23:18:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![banesullivan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/banesullivan/32/7143_2.png) [@banesullivan](https://discourse.vtk.org/u/banesullivan)
#### Post date: [December 12, 2019, 11:18pm UTC](https://discourse.vtk.org/t/piece-id-from-vtkxmlpunstructuredgridreader/2265/1 "2019-12-12T23:18:38Z")

</div>

When using the parallel VTU file reader (`vtkXMLPUnstructuredGridReader`), is there a way to have the reader automatically add an array corresponding to the piece of the mesh? (e.g. integers from 0 to `NumberOfPeices`

I have a workaround by loading each piece and adding a point array of a constant integer to each piece, then appending all of the meshes together, but it would be great if this was available from the `vtkXMLPUnstructuredGridReader` class

---

<div class="post-metadata">

### Author: ![banesullivan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/banesullivan/32/7143_2.png) [@banesullivan](https://discourse.vtk.org/u/banesullivan)
#### Post date: [December 12, 2019, 11:32pm UTC](https://discourse.vtk.org/t/piece-id-from-vtkxmlpunstructuredgridreader/2265/2 "2019-12-12T23:32:48Z")

</div>

If you’re looking for sample data, this issue has a PVTU dataset you can use: [https://github.com/pyvista/pyvista-support/issues/83#issuecomment-565195472](https://github.com/pyvista/pyvista-support/issues/83#issuecomment-565195472)
