Is GetConnectivityArray missing from vtkCellArray class in Python package?

I have an XML unstructured grid with polyhedral elements and would like to read it using Python for post-processing analysis of a simulation. I am using Python 3.7.4 and vtk 8.1.2.

I can read the file with vtkXMLUnstructuredGridReader and successfully read some arrays from CellData and Points. But, when I try to use the function GetConnectivityArray from vtkCellArray class, it seems that it’s missing from the vtk Python package:

import vtk 
import numpy

# open *.vtu file
reader = vtk.vtkXMLUnstructuredGridReader()
output = reader.GetOutput()

cellEnergy   = output.GetCellData().GetArray("cellEnergy")
points = output.GetPoints().GetData()
vtkCells = output.GetCells()
cellConn = output.GetCells().GetConnectivityArray()                                                                                                          


AttributeError: 'vtkCommonDataModelPython.vtkCellArray' object has no attribute 'GetConnectivityArray'

I tried to see if I could find it where vtk is installed with grep below, but it didn’t output anything.

grep -rnwi . -e 'GetConnectivityArray'

Is the function really missing? Or am I doing something wrong?

vtkCellArray underwent a major refactor recently, and the GetConnectivityArray method was added after 8.1.2. It is currently available in the development branch and will be in the next release.

If you need to support v8.1.2, see the discussion about the older legacy API here.

Thank you for clarifying that GetConnectivityArray is not in 8.1.2 release version.

A solution to this problem was found by using PyVista: