Hi all,

I have sorted out my bottleneck/time processing speed issue. I'm sure the 
following method\script is well known to many python/paraview users.
I had to include

delete (source_name) and del source_ name, once each source was no longer 
needed. This was particularly useful when running loops around several filters.
Example: delete(T1), del T1

I also included the clip filter several times to reduce the size of the 
mesh\data file.

C1 = Clip(Input = T1)
C1.ClipType = "Plane"
C1.ClipType.Origin = [0.0, 0.0, ZMin[0]]
C1.ClipType.Normal = [0.0, 0.0, 1.0]

Regards
Christian



Dr. Christian Thomas
Postdoctoral Research Associate

Department of Mathematics
Room 737, Huxley Building
180, Queen’s Gate
Imperial College London
SW7 2AZ

[email protected]<mailto:[email protected]>







Begin forwarded message:

Subject: Paraview/Python script speed extracting data
Date: 20 February 2015 13:05:48 GMT
To: <[email protected]<mailto:[email protected]>>

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










_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview

Reply via email to