# ParaView Cell Centers possible unstable program behavior

**URL:** https://discourse.paraview.org/t/paraview-cell-centers-possible-unstable-program-behavior/4310
**Category:** ParaView Support
**Created:** [May 12, 2020, 10:04am UTC](https://discourse.paraview.org/t/paraview-cell-centers-possible-unstable-program-behavior/4310 "2020-05-12T10:04:37Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Andrei](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/9fc29f/32.png) [@Andrei](https://discourse.paraview.org/u/Andrei)
#### Post date: [May 12, 2020, 10:04am UTC](https://discourse.paraview.org/t/paraview-cell-centers-possible-unstable-program-behavior/4310/1 "2020-05-12T10:04:37Z")

</div>

I noticed strange behavior of Cell Centers Filter. It sometimes outputs unpredictable non-reproducible random results. I recorded this on video

[/uploads/default/original/2X/b/b25854ec2303023bff4a69ba97e77cd3e2d0859c.mp4](https://discourse.paraview.org/uploads/default/original/2X/b/b25854ec2303023bff4a69ba97e77cd3e2d0859c.mp4)
. The FE mesh at stages in time has the same topology. See row 4 on spreadsheet view at time index 38. It suddenly and unpredictably gives non-reproducible random coordinates 54.7645 and 3.20815. On subsequent calls it gives 67.5137 and 64.4966. This non-reproducible random changes occur in different cells at different time index. It only affects the coordinates

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [May 12, 2020, 2:35pm UTC](https://discourse.paraview.org/t/paraview-cell-centers-possible-unstable-program-behavior/4310/2 "2020-05-12T14:35:34Z")

</div>

That is definitely weird. Perhaps this is a race condition in the cell centers filter.

What kind of data is this? Is this a structured grid or an unstructured grid (or something else)?

---

<div class="post-metadata">

### Author: ![Andrei](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/9fc29f/32.png) [@Andrei](https://discourse.paraview.org/u/Andrei)
#### Post date: [May 12, 2020, 3:02pm UTC](https://discourse.paraview.org/t/paraview-cell-centers-possible-unstable-program-behavior/4310/3 "2020-05-12T15:02:00Z")

</div>

This is a common 2D finite element mesh exported from Z\_Soil geotechnical program. It consists of 100% quad elements

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [May 12, 2020, 5:29pm UTC](https://discourse.paraview.org/t/paraview-cell-centers-possible-unstable-program-behavior/4310/4 "2020-05-12T17:29:59Z")

</div>

If you click on the `Information` tab, what does ParaView say the `Type` of the data is (in the `Statistics` block)?

---

<div class="post-metadata">

### Author: ![Andrei](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/9fc29f/32.png) [@Andrei](https://discourse.paraview.org/u/Andrei)
#### Post date: [May 12, 2020, 8:47pm UTC](https://discourse.paraview.org/t/paraview-cell-centers-possible-unstable-program-behavior/4310/5 "2020-05-12T20:47:24Z")

</div>

Yes, Unstructured Grid

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [May 13, 2020, 4:15pm UTC](https://discourse.paraview.org/t/paraview-cell-centers-possible-unstable-program-behavior/4310/6 "2020-05-13T16:15:28Z")

</div>

@Andrei, I think I found the problem. I believe you revealed a bug in VTK. I won’t go into details, but I’ve reported the bug here: [https://gitlab.kitware.com/paraview/paraview/-/issues/19921](https://gitlab.kitware.com/paraview/paraview/-/issues/19921)

As a workaround, you can add the `Clean to Grid` filter to your data before you run `Cell Centers`. When you run `Cell Centers` on the output of `Clean to Grid`, you no longer get the errors you are seeing.

---

<div class="post-metadata">

### Author: ![Andrei](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/9fc29f/32.png) [@Andrei](https://discourse.paraview.org/u/Andrei)
#### Post date: [May 13, 2020, 6:12pm UTC](https://discourse.paraview.org/t/paraview-cell-centers-possible-unstable-program-behavior/4310/7 "2020-05-13T18:12:37Z")

</div>

Many thanks! The Clean to Grid filter with default settings solves the problem
