[Paraview] Paraview/Python script speed extracting data

Thomas, Christian c.thomas at imperial.ac.uk
Fri Feb 20 08:05:50 EST 2015


Hi

I'm writing a python script that uses several paraview filters. I then extract data from the final filter for further analysis in python. However, I'm having a problem with the speed of the data extraction (can take several minutes). I have tried writing to a file (createwriter) and then reading the file. I have also tried servermanager.Fetch() and GetPoints… Although I am able to get data with both methods, they are both very slow. I was wondering if there was anything obvious in my paraview/python script that was slowing the process or if anyone has a suggestion at how I may speed things up. 
(I realise this could just be down to the size of my initial input, for small data files Mesh - 15MB, solution - 50MB).

The script is below. Any suggestions would be greatly appreciated.

Regards
Christian



	TBR = TAUMeshReader( FileName=Dir+'Mesh' )
	TBR.SurfaceMeshOnly = 0
	TBR.SolutionFileName = Dir+'solution'
	MB = MergeBlocks(Input = TBR)
	T1 = Transform(Input = MB)
	T1.Transform.Rotate = [-float(Rot/2.0), 0.0, Sweep]
	ISO = IsoVolume(Input = T1)	
	ISO.ThresholdRange = [MIN_Tot_Pre, BLE_Tot_Pre]
	ISO.InputScalars = ['POINTS','total_pressure']
	SL = Slice(Input = T1)
	SL.SliceType="Plane"
	SL.SliceOffsetValues = n
	SL.SliceType.Origin = Inboard
	SL.SliceType.Normal = Normal
	Con = Contour(Input = SL)
	Con.PointMergeMethod = "Uniform Binning"
	Con.ContourBy = ['POINTS', 'total_pressure']
	Con.Isosurfaces = [BLE_Tot_Pre]
	Pass = PassArrays(Con)
	Pass.PointDataArrays = ['wall_distance']
	h=CreateWriter(Dir+'Edge.csv',Pass)
	h.FieldAssociation = "Points"
	h.Precision = 15
	h.UpdatePipeline()

	….read Edge.csv file for further analysis











More information about the ParaView mailing list