Inconsistent bounds returned for Multi-block/Multi-piece dataset

I’m using Paraview Catalyst 5.8.0 on Linux
I’m trying to get the center of my data set using the following in my Pipeline()

bnds = datasource.GetDataInformation().DataInformation.GetBounds()
print('bnds   :'+str(bnds[0])+', '+str(bnds[1])+', '+str(bnds[2]) +', '+str(bnds[3]) +', '+str(bnds[4]) +', '+str(bnds[5])  )

With the same input data I get the following as an example:
bnds :0.0, 100.0, 0.0, 50.0, 1249.1666259765625, 1666.6666259765625
bnds :0.0, 100.0, 0.0, 50.0, 415.8333435058594, 833.3333129882812
bnds :0.0, 100.0, 0.0, 50.0, 0.0, 416.6666564941406
bnds :0.0, 100.0, 0.0, 50.0, 832.5, 1250.0
bnds :0.0, 100.0, 0.0, 50.0, 0.0, 1666.6666259765625
bnds :0.0, 100.0, 0.0, 50.0, 833.3333129882812, 1666.6666259765625
bnds :0.0, 100.0, 0.0, 50.0, 0.0, 833.3333129882812
bnds :0.0, 100.0, 0.0, 50.0, 0.0, 833.3333129882812
bnds :0.0, 100.0, 0.0, 50.0, 833.3333129882812, 1666.6666259765625
bnds :0.0, 100.0, 0.0, 50.0, 833.3333129882812, 1666.6666259765625

So, there is some kind of pattern, but not correct as I know the data set has bounds in the Z direction of 0 - 2000.

I am doing something a little unusual as I collect all sections of the dataset from multiple mpi ranks onto a single rank and create the VTK multi-piece data set on it. I have found that I need to do a MergeBlocks to consolidate any filtered data, however if I use a GetDataInformation().DataInformation.GetBounds() on a MergeBlocks result I do not get updated bounds information:
e.g. I get the following:
bndsmpi:1e+299, -1e+299, 1e+299, -1e+299, 1e+299, -1e+299

Is there a way to update the bounds information before trying to use it?


Please hold any response as I think there is a problem with my model creation script. Although I requested a z extent of 2000, it seems to have only created 1666.66 etc. So, the upper bounds being returned seems correct in a number of the outputs. I will investigate the data creation problem further.

The MergeBlocks issue I think is because I filter away any PointArray data using a PassArrays filter, so there is no geometry infromation to work with.

hmmm… Ok, the extent in the Z direction are 0-1666.66 by design (there are 2000 cells, which got me confused).

However, I still cannot get the merged data to respond with the full data set extents. Before the merge the data set is split and each extent is a subsection of the whole data. after the MergeBlocks I only get 1e+299 to 1e+299.

        pa  = PassArrays(Input=datasource, PointDataArrays=['GlobalNodeIds'], CellDataArrays=['fields/pressure']) 
        mpa = MergeBlocks(Input=pa)
        bnds = mpa.GetDataInformation().DataInformation.GetBounds()  

The above is the latest effort of getting the correct info. Using the python interface to Paraview obtains the correct values without issue, so i’,m sure it is possible.

any help would be appreciated.

Thanks, Josh

So, my work around is to use MPI4Py to share the local bounds:

    from mpi4py import MPI
    import numpy as np
    import vtk

    gc = vtk.vtkMultiProcessController.GetGlobalController()
    comm = vtk.vtkMPI4PyCommunicator.ConvertToPython(gc.GetCommunicator())
    datasource = coprocessor.CreateProducer(datadescription, 'input')
    bnds = datasource.GetDataInformation().DataInformation.GetBounds()
    z_max = np.zeros(1, dtype='float64')
    local_max = np.zeros(1, dtype='float64')
    local_max[0] = bnds[5]
    comm.Allreduce(local_max, z_max, op=MPI.MAX)

    z_min = np.zeros(1, dtype='float64')
    local_min = np.zeros(1, dtype='float64')
    local_min[0] = bnds[4]
    comm.Allreduce(local_min, z_min, op=MPI.MIN)


I’m sure there is a better way. Irregular datasets will need to share each dimension of the bounds also.
It works for now though.