How can I extract a surface from the inside of a tetrahedral mesh with global connectivity?


I have a tetrahedral mesh for CFD simulation. I want to add a boundary condition inside the geometry (eg. add a boundary condition in the valve region of a cardiac outflow tract). I used Select Cell Through and then Extract Selection then Extract Surface and saved it as a vtkPolyData file. However, when I checked the connectivity in the file, I found that the node(/element?) ID in the connectivity has changed, so the simulation cannot find the global element number. How can I extract the surface with the original global connectivity?
See the screenshots below for more information.

I think this should be the connectivity and the three numbers in each column correspond to the global node ID for each node in a triangular element? But I don’t think the node ID is the original node ID since the extracted surface shouldn’t contain the first node (node ID 0).


Hi @Gening_Dong

You may want ot generate ids first using GenerateGlobalIds filter.


Hi @mwestphal

Thanks for the suggestion. However it may not help. I used Generate ID first, then Extract Selection and then Extract Surface but I got nearly the same result.
What else can I do?

Screenshot 2022-10-31 133550

Please share your dataset.

Hi @mwestphal , the link below contains the full geometry (tetrahedral mesh) and the extracted surface .

The extracted surface does contains the Original cell ids as cell data, so I dont see the issue there.

Hi @mwestphal, thanks for the reply!
The extracted surface indeed contains the original cell/node IDs. However, what I’m confused about is that under the Polygons section, it doesn’t contain the original node IDs. My understanding of this POLYGONS section should be the connectivity array, so n1, n2, … ,nn are the number of nodes for each element, followed by i11, i12, i1n1, which are the global node IDs for each node in the triangular element. Did I get it wrong?

POLYGONS nPolygons size
n1 i11 i12 … i1n1
n2 i21 i22 … i2n2

nn in1 in2 … innn

If you mean the polygon section in the written out .vtk file, then of course, the id are the new ones, thats just how VTK works, the id of the point and cells are related to that specific dataset.

But if you need to do some post processing related to the old IDs, you can access them as they are present as cell data.

What are you trying to do ?

Thanks for the clarification. I totally mistook it.
I’m trying to define the extracted surface as a “midplane” similar to an inlet/outlet face and apply specific boundary conditions to it. So I have to make sure the new dataset is related to the old IDs so that the solver can recognize them.

You have to tell your solver to use the cell data then.

Thank you for the suggestion!
Just a little more clarification. For example, the dataset is shown as following. So the first cell in the dataset has an old cell ID 34, and the three nodes in that cell has an old node ID 12, 45, 89, respectively. Am I understanding it correctly?

POLYGONS nPolygons size
3 0 1 3
3 2 1 4

SCALARS float 1
34 25

SCALARS float 1
12 45 67 89 94

Am I understanding it correctly?


I get it now. Thanks so much for the help!

1 Like