# find the boundary point indices in multiblock mesh

**URL:** https://discourse.paraview.org/t/find-the-boundary-point-indices-in-multiblock-mesh/9016
**Category:** ParaView Support
**Tags:** vtk
**Created:** [February 19, 2022, 8:00pm UTC](https://discourse.paraview.org/t/find-the-boundary-point-indices-in-multiblock-mesh/9016 "2022-02-19T20:00:29Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![bigfooted](https://discourse.paraview.org/user_avatar/discourse.paraview.org/bigfooted/32/6347_2.png) [@bigfooted](https://discourse.paraview.org/u/bigfooted)
#### Post date: [February 19, 2022, 8:00pm UTC](https://discourse.paraview.org/t/find-the-boundary-point-indices-in-multiblock-mesh/9016/1 "2022-02-19T20:00:29Z")

</div>

Hi,

I am working with paraview multiblock files. Basically I have a couple of vtu files describing 2D flow fields, one is flow.vtu and the others are boundary\_xx.vtu. The points on the boundary are also in the flow file. Now I would like to write a file with a list of all the points and connectivities, and append a list of indices (and connectivities) of the points that are one the boundaries.  
I could not find an obvious way to get this information, the closest I could find was this example on finding cell intersections, but I’m not sure if this is the direction to go for this problem:  
[https://kitware.github.io/vtk-examples/site/Cxx/VisualizationAlgorithms/FindCellIntersections/](https://kitware.github.io/vtk-examples/site/Cxx/VisualizationAlgorithms/FindCellIntersections/)

---

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas.vuaille/32/5873_2.png) [@nicolas.vuaille](https://discourse.paraview.org/u/nicolas.vuaille)
#### Post date: [February 21, 2022, 9:44am UTC](https://discourse.paraview.org/t/find-the-boundary-point-indices-in-multiblock-mesh/9016/2 "2022-02-21T09:44:47Z")

</div>

> [@bigfooted](#):
>
> a file with a list of all the points and connectivities

You can try the `MergeBlock` filter, it will outputs a single mesh that you can save as a vtu.

> append a list of indices (and connectivities)

In point associated array you should have one value per points. So to list indices of boundary points, you will probably have to use a dummy value for inner indices.

I do not have the full pipeline but some piece you may want to look at:

- `BlockScalars` to identify points of each block
- `MergeBlock` to create one mesh
- `GenerateIds` to get point ids as an associated array for further manip
- `Python Calculator` to extract PointIds when relevant (depending on BlockScalars), probably using the `numpy.where` method.

---

<div class="post-metadata">

### Author: ![bigfooted](https://discourse.paraview.org/user_avatar/discourse.paraview.org/bigfooted/32/6347_2.png) [@bigfooted](https://discourse.paraview.org/u/bigfooted)
#### Post date: [March 6, 2022, 10:31pm UTC](https://discourse.paraview.org/t/find-the-boundary-point-indices-in-multiblock-mesh/9016/3 "2022-03-06T22:31:14Z")

</div>

Hi Nicolas,  
Thanks for these pointers. I see what mergeblock and generateIds do, but BlockScalars just gives me a field with values of zero for some reason. The only thing that I do is couple a BlockScalars to my .vtm multiblock input.  
My test data is here :[https://github.com/bigfooted/su2cases/tree/master/validation/square](https://github.com/bigfooted/su2cases/tree/master/validation/square)  
It’s just a 2D square with an inlet, outlet, top and bottom wall.  
The strategy is I think that I should end up with a field where the points have values corresponding to the vtkblockcolors or something similar, and then I can match the values to the keys from the multiblock (using a programmable filter?)

---

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas.vuaille/32/5873_2.png) [@nicolas.vuaille](https://discourse.paraview.org/u/nicolas.vuaille)
#### Post date: [March 7, 2022, 10:55am UTC](https://discourse.paraview.org/t/find-the-boundary-point-indices-in-multiblock-mesh/9016/4 "2022-03-07T10:55:40Z")

</div>

It seems to be harder than I first though 😑

Use the MergeBlock to get only one mesh and one list of points.

Then I think you should use programmable filter to browse each point and check if it is in a boundary cell (i.e. a cell of type Line) and then fill an array to store this info.

---

<div class="post-metadata">

### Author: ![bigfooted](https://discourse.paraview.org/user_avatar/discourse.paraview.org/bigfooted/32/6347_2.png) [@bigfooted](https://discourse.paraview.org/u/bigfooted)
#### Post date: [March 7, 2022, 12:20pm UTC](https://discourse.paraview.org/t/find-the-boundary-point-indices-in-multiblock-mesh/9016/5 "2022-03-07T12:20:01Z")

</div>

Thanks, but is there then still a way to distinguish between the different boundaries(i.e. know which keys belong to them) and keep their connectivity?  
My current pure-python method is basically going directly through the list of boundary files, and compares their coordinates with the coordinates in the “Internal” block. The problem then is that I lose the connectivity and I also have to reconstruct this information. I’d think that there is an easy paraview way to find the subset of “Internal” that corresponds with the points in “Inlet”, basically returning the indices/points/connectivities in “Internal”.

---

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas.vuaille/32/5873_2.png) [@nicolas.vuaille](https://discourse.paraview.org/u/nicolas.vuaille)
#### Post date: [March 7, 2022, 1:35pm UTC](https://discourse.paraview.org/t/find-the-boundary-point-indices-in-multiblock-mesh/9016/6 "2022-03-07T13:35:59Z")

</div>

I finally have something in pure ParaView (no python),  
[boundary.pvsm](https://discourse.paraview.org/uploads/short-url/xagUgeRWD4S5FkWBRsxWeAwbXhR.pvsm) (861.8 KB)

The main idea of this state is to associate a value to each extracted boundaries with the `Connectivity` and then merge this info in the main mesh with `Resample With DataSet`.

### details

- `ExtractBlocks` to extract Internal mesh from original data

then

- `Extract Blocks` to extract boundaries from original data
- `Merge Block` without `MergePoints` option to convert to a single mesh
- `Connectivity` to associated an id to each boundary
- `Calculator` adds 1 to avoid `0`
- `ResampleWithDataSet` with Internal mesh as destination.

---

<div class="post-metadata">

### Author: ![bigfooted](https://discourse.paraview.org/user_avatar/discourse.paraview.org/bigfooted/32/6347_2.png) [@bigfooted](https://discourse.paraview.org/u/bigfooted)
#### Post date: [March 7, 2022, 2:44pm UTC](https://discourse.paraview.org/t/find-the-boundary-point-indices-in-multiblock-mesh/9016/7 "2022-03-07T14:44:12Z")

</div>

Hello, Nicolas, This works like a charm! The values 1,2,3,4 for the regionID, will they always be assigned in the order of the keys in the vtkmultiblockdataset? That will allow an easy connection to the original boundary names. Thanks again!

---

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas.vuaille/32/5873_2.png) [@nicolas.vuaille](https://discourse.paraview.org/u/nicolas.vuaille)
#### Post date: [March 7, 2022, 2:48pm UTC](https://discourse.paraview.org/t/find-the-boundary-point-indices-in-multiblock-mesh/9016/8 "2022-03-07T14:48:13Z")

</div>

Not sure if the values are in a known order…
