简体   繁体   中英

Python Paraview

How to extract data from server to the client in Paraview parallel running mode

my script is: def getNumberOfBlocks(px):
data1 = servermanager.Fetch(px,0)

data2 = servermanager.Fetch(px,1)
group = vtk.vtkMultiBlockDataGroupFilter()
group.AddInputConnection(group.GetOutputPortn())
group.AddInputConnection(group.GetOutputPort())
group.Update()
group.AddInputConnection(transformer2.GetOutputPort())
data3 = group.GetOutputPort()

data = vtk.vtkMultiBlockDataGroupFilter.SafeDownCast(data3)
return data.GetNumberOfBlocks()

px is a proxy from where i am getting data. there are two port , i need to fetch the data from these port all at a time.

thanks for help.

I'm a little confused by your script - won't it always return 3?

If you just want to get the number of blocks and px is of type vtkSMSourceProxy , you can use the following:

def getNumberOfBlocks(px):
  di = GetDataInformation()
  cdi = di.GetCompositeDataInformation()
  return cdi.GetNumberOfChildren()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM