Incorrect writing of vtkGhostType-array in PVTU files

This is regarding PR #2846 where the "vtkGhostType"-array was introduced.

Currently, all ghost cells are set to "1" while non-ghost cells are set to "0". Since VTK/ParaView ignore cells with vtkGhostType > 0, loading PVTUs will currently result in elements apparently missing at the boundaries of mesh parts: ghosts

Instead, VTK expects the array to work a little different. Here's a minimal example: pvtu

The first part A of the PVTU is orange, the second part B is blue. The pink cells are the overlapping region existing in both parts.

What VTK, ParaView (and especially the vtkRemoveGhosts-filter) expect, is that

  • all cells for A have a vtkGhostType-value of "0"
  • the blue cells of B have a vtkGhostType-value of "0"
  • the pink cells of B have a vtkGhostType-value of "1"

I have a working minimal example (the one shown in the screenshot) if anyone is interested. I believe I previously sent this to @wenqing and @endJunction but I can send it again if you like.

Can we - for the moment - remove the changes added in #2846 ? I would argue that the current implementation is actually worse than not having the vtkGhostType at all. Currently you need to somehow trick ParaView into not ignoriering ghost cells, otherwise results are displayed wrong.
A quick-and-dirty solution would be to simply change the name of the new array. Anything except "vtkGhostType" will be ignored by ParaView and can be handled like any other array.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information