# Selecting Cells on Patch Surface

**URL:** https://discourse.paraview.org/t/selecting-cells-on-patch-surface/4365
**Category:** ParaView Support
**Created:** [May 19, 2020, 3:54am UTC](https://discourse.paraview.org/t/selecting-cells-on-patch-surface/4365 "2020-05-19T03:54:50Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![carl](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/ee7513/32.png) [@carl](https://discourse.paraview.org/u/carl)
#### Post date: [May 19, 2020, 3:54am UTC](https://discourse.paraview.org/t/selecting-cells-on-patch-surface/4365/1 "2020-05-19T03:54:50Z")

</div>

Hi,  
I have created a pipe line to define some cell clusters. (pipe line in image)

I want to remove any cell clusters where a cluster member is on a selected patch (the patch is shown as a pink wire frame in the image). Meaning that the regionID=0 (navey blue “L” shaped region) should be removed from the selected data.

I am trying to obtain a list of all cells on the patch, then I could obtain the region IDs present and remove these from my analysis. However, I can’t work out how to obtain all cells on a patch, I’ve not found an Extract XXXX filter that does this. Note this is imported as a multi-block domain, and then merged during my pipeline.

I’m sure there are other ways to do this but can’t work them out. eg. obtain lists of all cell ID numbers on the surface, then scan all clusters, and if an ID matches remove the cluster. Again I’m stuck in how to obtain a list of the cell IDS.

I’m happy for any answer to be filter based or use python scripting.

 ![remove Patch IDs](https://discourse.paraview.org/uploads/default/original/2X/8/8fb8ddfd14a00a3876ae7e4b17f6283f0ec19dd5.jpeg)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 19, 2020, 3:56am UTC](https://discourse.paraview.org/t/selecting-cells-on-patch-surface/4365/2 "2020-05-19T03:56:36Z")

</div>

Sound like you should be able to select the cells you want to remove or keep in Edit -\> FindData.

Once they are selected, Extract Selection should de the job.

---

<div class="post-metadata">

### Author: ![carl](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/ee7513/32.png) [@carl](https://discourse.paraview.org/u/carl)
#### Post date: [May 19, 2020, 4:34pm UTC](https://discourse.paraview.org/t/selecting-cells-on-patch-surface/4365/3 "2020-05-19T16:34:06Z")

</div>

Mathieu,  
Thanks for the help, what you propose should work, however when I try and select the cells with Find Data I get an error. This is for a simple case where i import my multi-block data and then try to select the cells on the Block ID associated with my patch (Block ID = 7).

What am I doing something wrong?

 ![image](https://discourse.paraview.org/uploads/default/original/2X/8/8dd3ef53312e90706e4e066d37c1a2cf1aa582a4.png)

 ![image](https://discourse.paraview.org/uploads/default/original/2X/9/9b5a263597fe2f52e79d0c2fa2ad6be096d84f22.png)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 20, 2020, 4:38am UTC](https://discourse.paraview.org/t/selecting-cells-on-patch-surface/4365/4 "2020-05-20T04:38:10Z")

</div>

Please use ParaView from : [https://www.paraview.org/download/](https://www.paraview.org/download/)

And share a dataset to reproduce the issue please.

---

<div class="post-metadata">

### Author: ![carl](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/ee7513/32.png) [@carl](https://discourse.paraview.org/u/carl)
#### Post date: [May 20, 2020, 6:17pm UTC](https://discourse.paraview.org/t/selecting-cells-on-patch-surface/4365/5 "2020-05-20T18:17:04Z")

</div>

Mathieu,  
I tried to install paraview on ubuntu run on windows. I get some graphics driver errors which I’ve not been able to solve.

Therefore I tried installing paraview on windows. Eventually I will want to run it on Linux, but at the point I need to do this I should have more support to resolve the driver/environment variable issues i’m having.

I’m having some issues with the windows installation. I had assumed that scripts which worked on the linux (paraFoam) would also work on the windows install, but i’m having problems.

a) a script (“TEST.py”) ran on the linux install now gives the error on the windows install:  
SyntaxError: invalid syntax

> > > File “”, line 152  
> > > spreadSheetView1.BlockSize = 1024L  
> > > ^  
> > > SyntaxError: invalid syntax

b) If I reduce the “TEST.py” script to just importing the data (lines 1-23). When I view the imported data in the GUI the screen turns to this as soon as I hit the view (eye icon). Making it impossible to use any of the menus. I get exactly the same result no matter what size I set the view to (renderView1.ViewSize = [800, 400])

> Blockquote  
> \*\*I’ve got the windows graphics issue resolved with an update of the graphics card driver \*\*  
> **[Weird display resolution](https://discourse.paraview.org/t/weird-display-resolution/3035)**

 ![image](https://discourse.paraview.org/uploads/default/original/2X/f/f8cec6cd52e80f669aa117158cea3462ded2a7be.png)

On the positive side it seems that the python selection module is not importing correctly. Its just hard for me to visually confirm my script is working with the GUI issue.

---

<div class="post-metadata">

### Author: ![carl](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/ee7513/32.png) [@carl](https://discourse.paraview.org/u/carl)
#### Post date: [May 20, 2020, 6:23pm UTC](https://discourse.paraview.org/t/selecting-cells-on-patch-surface/4365/6 "2020-05-20T18:23:38Z")

</div>

Here is the data and the script I’ve been using

[Data.zip](https://discourse.paraview.org/uploads/short-url/4uK0MBR3iwyZbQaUFy0u2Xh31Qq.zip) (1.9 MB)

[TEST.py](https://discourse.paraview.org/uploads/short-url/7XMARwrpeTPMn4wETNLWTIe6jEc.py) (4.7 KB)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 21, 2020, 2:25am UTC](https://discourse.paraview.org/t/selecting-cells-on-patch-surface/4365/7 "2020-05-21T02:25:41Z")

</div>

Classic intel driver bug.  
[https://gitlab.kitware.com/paraview/paraview/-/issues/19364](https://gitlab.kitware.com/paraview/paraview/-/issues/19364)

Four solutions :

- Use another GPU (eg: nvidia instead of intel)
- Downgrade your intel driver before 26.20.100.6708
- Upgrage your intel driver after 26.20.100.7528
- use mesa instead : [How to run ParaView (including the binary release) using Mesa on Windows](https://discourse.paraview.org/t/how-to-run-paraview-including-the-binary-release-using-mesa-on-windows/4321/2)

---

<div class="post-metadata">

### Author: ![carl](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/ee7513/32.png) [@carl](https://discourse.paraview.org/u/carl)
#### Post date: [May 21, 2020, 3:13am UTC](https://discourse.paraview.org/t/selecting-cells-on-patch-surface/4365/8 "2020-05-21T03:13:44Z")

</div>

Now on the latest windows release i get this error:

```
 File "C:\Program Files\ParaView 5.8.0-Windows-Python3.7-msvc2015-64bit\bin\Lib\site-packages\paraview\detail\python_selector.py", line 79, in execute
    maskArray = calculator.compute(inputs, query, ns=elocals)
  File "C:\Program Files\ParaView 5.8.0-Windows-Python3.7-msvc2015-64bit\bin\Lib\site-packages\paraview\detail\calculator.py", line 146, in compute
    retVal = eval(subEx, globals(), mylocals)
  File "<string>", line 0
    
    ^
SyntaxError: unexpected EOF while parsing

```

 ![image](https://discourse.paraview.org/uploads/default/original/2X/e/e75e1adbd21a934d3429342b89743e9aa7b9a73c.png)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 21, 2020, 3:34am UTC](https://discourse.paraview.org/t/selecting-cells-on-patch-surface/4365/9 "2020-05-21T03:34:52Z")

</div>

Your query is not complete, however it looks like the block selection is not working anyway.

You should be able to work around it using a connectivity filter though.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 21, 2020, 3:40am UTC](https://discourse.paraview.org/t/selecting-cells-on-patch-surface/4365/10 "2020-05-21T03:40:29Z")

</div>

[https://gitlab.kitware.com/paraview/paraview/-/issues/19944](https://gitlab.kitware.com/paraview/paraview/-/issues/19944)

---

<div class="post-metadata">

### Author: ![carl](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/ee7513/32.png) [@carl](https://discourse.paraview.org/u/carl)
#### Post date: [May 21, 2020, 3:53am UTC](https://discourse.paraview.org/t/selecting-cells-on-patch-surface/4365/11 "2020-05-21T03:53:04Z")

</div>

Mathieu,  
Thanks for digging into this.  
Its not clear to me how I can work around this with the connectivity filter. My data is multi-block. Once merged I can select the connectivity filter. However I’m not able to select the Block ID. Do you have any further pointers on how to get around this with the connectivity filter?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 21, 2020, 3:57am UTC](https://discourse.paraview.org/t/selecting-cells-on-patch-surface/4365/12 "2020-05-21T03:57:09Z")

</div>

- Open your file and select the options, apply
- MergeBlocks, uncheck MergePoints, apply
- Connectivity, Appy
- Select using the “RegionID” array in the find data dialog

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 21, 2020, 3:59am UTC](https://discourse.paraview.org/t/selecting-cells-on-patch-surface/4365/13 "2020-05-21T03:59:38Z")

</div>

Another work around is to use the MultiBlockInspector directly :

- View -\> MultiBlockInspector
- Click on the block you want to extract

Another workaround is to use the select block feature :

- Click on the select block button : ![2020-05-21-115929_28x30_scrot](https://discourse.paraview.org/uploads/default/original/2X/c/cbb6cafe2f822dfb65d29346868cc8cd81b50399.png)
- Click on the block you want to select in the render view

---

<div class="post-metadata">

### Author: ![carl](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/ee7513/32.png) [@carl](https://discourse.paraview.org/u/carl)
#### Post date: [May 25, 2020, 4:00am UTC](https://discourse.paraview.org/t/selecting-cells-on-patch-surface/4365/14 "2020-05-25T04:00:18Z")

</div>

Does anyone have any idea how to extract the 3D cells forming the patch surface? I can get the 2D cells, but not the 3D on a surface.

Alternatively, how do I obtain a the 3D cell, which a specified 2D cell is part of?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 25, 2020, 4:10am UTC](https://discourse.paraview.org/t/selecting-cells-on-patch-surface/4365/15 "2020-05-25T04:10:33Z")

</div>

There is no direct way to do that, but if you know where your surface is, you can just use Select Cells on.
