How to define different sections in an Unstructured Grid?

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!

# 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

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

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

in your case it could be like this:

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

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.