Dear all,
I am trying to use Python to get the structure of a vtkMultiBlockDataSet
which lives on a server that I connect to using pvserver.
The structure of the Multiblock is:
# Multiblock
# |- Meshes (Multiblock)
# | |- mesh1 (PolyMesh)
# | |- mesh2 (PolyMesh)
# | |- mesh3 (PolyMesh)
# | |- mesh4 (PolyMesh)
# | |- mesh5 (PolyMesh)
# | |- mesh6 (PolyMesh)
# | |- mesh7 (PolyMesh)
# | |- mesh8 (PolyMesh)
# |- empty (remains empty)
# |- Particles (PolyMesh)
# |- Domain (Rectilinear)
here’s a short exploratory script:
all_src = GetSources()
pvd_src = all_src[('file.pvd', '10990')]
pvd_smp = pvd_src.SMProxy
print(pvd_smp.GetNumberOfOutputPorts()) # <- 1
out_port = pvd_smp.GetOutputPort(0)
print(out_port.GetDataClassName()) # <- vtkMultiBlockDataSet
info = out_port.GetDataInformation()
print(info.GetCompositeDataSetName()) # <- 'Meshes'
print(info.GetNumberOfDataSets()) # <- 9
print(info.GetDataInformationForCompositeIndex(9).GetCompositeDataSetName()) # <- mesh8
Note, there are 9 data sets only in the Meshes block (including itself), so I would actually expect there to be at least 11 (with Particles
and Domain
). I can also iterate over these data sets which confirms that the two are missing as the dataset with the higest index is mesh8
.
So I need actually two things which I can’t seem to achieve:
- I need to get the 3rd Multiblock and verify that it’s name is ‘Particles’
- I need to get the number of points that are in the ‘Particle’ PolyMesh.
I guess the second thing will be ok once I actually get access to that data set and using something like GetPointDataInformation()
.
Thanks in advance for your help,
Arno