# How to define different sections in an Unstructured Grid?

**URL:** https://discourse.vtk.org/t/how-to-define-different-sections-in-an-unstructured-grid/8076
**Category:** Support
**Tags:** file-formats
**Created:** [March 17, 2022, 1:45pm UTC](https://discourse.vtk.org/t/how-to-define-different-sections-in-an-unstructured-grid/8076 "2022-03-17T13:45:19Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jaeg1710](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/j/a4c791/32.png) [@jaeg1710](https://discourse.vtk.org/u/jaeg1710)
#### Post date: [March 17, 2022, 1:45pm UTC](https://discourse.vtk.org/t/how-to-define-different-sections-in-an-unstructured-grid/8076/1 "2022-03-17T13:45:19Z")

</div>

Hello,

i have a mesh from my finite-elements-analysis which consists of two sections. Now i am trying to write a separate .vtk file for each section so i can view them in paraview. Problem is the two section share the same points.

For example i have a “four-node-shell-element” which is defined by the four points 11, 32, 33, 12 from my point data (connectivity indices, see code below). So 4 points would be enough to define this cell but because it refers to the points 11, 32, 33 and 12 i have to write all of my 65 points in each file.

is it possible to only write out the four points which are needed so i can get rid of the other points which i dont really need to define this section? Maybe there is a way to label the points and refer to these labels?

Thanks in advance!

```auto
# vtk DataFile Version 2.0
PART-1-1.SET-2.Section-ASSEMBLY_PART-1-1_SET-2 Part_Assem_Test
ASCII
DATASET UNSTRUCTURED_GRID
POINTS 65 float
0.0 0.0 0.0
0.0 17.5 20.0
0.0 2.5 20.0
0.0 2.5 16.0
0.0 -12.5 20.0
0.0 -12.5 0.0
0.0 17.5 0.0
-23.75 -12.5 20.0
-23.75 17.5 20.0
-23.75 17.5 0.0
-23.75 -12.5 0.0
16.6125 2.5 16.0
16.6125 2.5 20.0
0.0 12.5 20.0
0.0 7.5 20.0
0.0 -5.0 20.0
0.0 -12.5 10.0
0.0 -2.5 0.0
0.0 7.5 0.0
0.0 17.5 10.0
-11.875 -12.5 20.0
-11.875 -12.5 0.0
-11.875 17.5 0.0
-11.875 17.5 20.0
-23.75 -5.0 20.0
-23.75 2.5 20.0
-23.75 7.5 20.0
-23.75 12.5 20.0
-23.75 17.5 10.0
-23.75 7.5 0.0
-23.75 -2.5 0.0
-23.75 -12.5 10.0
8.30625 2.5 16.0
8.30625 2.5 20.0
0.0 -0.5471415 15.876659
0.0 7.0482764 17.072838
0.0 4.8145814 12.102894
0.0 -3.0692494 9.584609
0.0 6.2121415 7.2255087
0.0 10.448217 14.62696
0.0 0.00067551393 12.428836
-23.75 2.5 16.0
-23.75 -0.5471415 15.876659
-23.75 7.0482764 17.072838
-23.75 4.8145814 12.102894
-23.75 -3.0692494 9.584609
-23.75 6.2121415 7.2255087
-23.75 10.448217 14.62696
-23.75 0.00067551393 12.428836
-11.875 -12.5 10.0
-11.875 7.5 0.0
-11.875 -2.5 0.0
-11.875 17.5 10.0
-11.875 -5.0 20.0
-11.875 2.5 20.0
-11.875 7.5 20.0
-11.875 12.5 20.0
-11.875 2.5 16.0
-11.875 -0.5471415 15.876659
-11.875 7.0482764 17.072838
-11.875 4.8145814 12.102894
-11.875 -3.0692494 9.584609
-11.875 6.2121415 7.2255087
-11.875 10.448217 14.62696
-11.875 0.00067551393 12.428836
CELLS 2 10
4 11 32 33 12
4 32 3 2 33
CELL_TYPES 2
9
9

```

---

<div class="post-metadata">

### Author: ![jaeg1710](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/j/a4c791/32.png) [@jaeg1710](https://discourse.vtk.org/u/jaeg1710)
#### Post date: [March 17, 2022, 1:47pm UTC](https://discourse.vtk.org/t/how-to-define-different-sections-in-an-unstructured-grid/8076/2 "2022-03-17T13:47:43Z")

</div>

or maybe there is another file format which can do this?

---

<div class="post-metadata">

### Author: ![Christos\_Tsolakis](https://discourse.vtk.org/user_avatar/discourse.vtk.org/christos_tsolakis/32/2076_2.png) [@Christos\_Tsolakis](https://discourse.vtk.org/u/Christos_Tsolakis)
#### Post date: [March 17, 2022, 1:59pm UTC](https://discourse.vtk.org/t/how-to-define-different-sections-in-an-unstructured-grid/8076/3 "2022-03-17T13:59:43Z")

</div>

> Maybe there is a way to label the points and refer to these labels?

You can add labels using the `POINT_DATA` section of the file see [here](https://kitware.github.io/vtk-examples/site/VTKFileFormats/#legacy-file-examples)

in your case it could be like this:

```auto
POINT_DATA 65
SCALARS labels int 1
LOOKUP_TABLE default
0 
0
.
.
. [1 for indices 2 3 11 12 32 33, 0 elsewhere]

```

---

<div class="post-metadata">

### Author: ![will.schroeder](https://discourse.vtk.org/user_avatar/discourse.vtk.org/will.schroeder/32/233_2.png) [@will.schroeder](https://discourse.vtk.org/u/will.schroeder)
#### Post date: [March 17, 2022, 2:13pm UTC](https://discourse.vtk.org/t/how-to-define-different-sections-in-an-unstructured-grid/8076/4 "2022-03-17T14:13:22Z")

</div>

You may find that vtkStaticCleanUnstructuredGrid (in newer versions of VTK) is helpful. It can be set up to remove unused points. Of course, a side effect is that it ends up renumbering the points. However, I think the filter outputs a point map output which indicates from which input points the output points originated from.
