<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div>Hi all,</div>
<div><br>
</div>
<div>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. </div>
<div>I had to include </div>
<div><br>
</div>
<div>delete (source_name) and del source_ name, once each source was no longer needed. This was particularly useful when running loops around several filters.</div>
<div>Example: delete(T1), del T1</div>
<div><br>
</div>
<div>I also included the clip filter several times to reduce the size of the mesh\data file. </div>
<div><br>
</div>
<div>
<div>C1 = Clip(Input = T1)</div>
<div>C1.ClipType = "Plane"</div>
<div>C1.ClipType.Origin = [0.0, 0.0, ZMin[0]]</div>
<div>C1.ClipType.Normal = [0.0, 0.0, 1.0]</div>
</div>
<div><br>
</div>
<div>Regards</div>
<div>Christian</div>
<div><br>
</div>
<div><br>
</div>
<br>
<div apple-content-edited="true">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Dr. Christian Thomas<br>
Postdoctoral Research Associate<br>
<br>
Department of Mathematics<br>
Room 737, Huxley Building</div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
180, Queen’s Gate<br>
Imperial College London</div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
SW7 2AZ<br>
<br>
<a href="mailto:c.thomas@imperial.ac.uk">c.thomas@imperial.ac.uk</a><br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
</div>
<div><br>
<div>Begin forwarded message:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;">
<span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1.0);"><b>Subject:
</b></span><span style="font-family:'Helvetica'; font-size:medium;"><b>Paraview/Python script speed extracting data</b><br>
</span></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;">
<span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1.0);"><b>Date:
</b></span><span style="font-family:'Helvetica'; font-size:medium;">20 February 2015 13:05:48 GMT<br>
</span></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;">
<span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1.0);"><b>To:
</b></span><span style="font-family:'Helvetica'; font-size:medium;"><<a href="mailto:paraview@paraview.org">paraview@paraview.org</a>><br>
</span></div>
<br>
<div>Hi<br>
<br>
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.
<br>
(I realise this could just be down to the size of my initial input, for small data files Mesh - 15MB, solution - 50MB).<br>
<br>
The script is below. Any suggestions would be greatly appreciated.<br>
<br>
Regards<br>
Christian<br>
<br>
<br>
<br>
<span class="Apple-tab-span" style="white-space:pre"></span>TBR = TAUMeshReader( FileName=Dir+'Mesh' )<br>
<span class="Apple-tab-span" style="white-space:pre"></span>TBR.SurfaceMeshOnly = 0<br>
<span class="Apple-tab-span" style="white-space:pre"></span>TBR.SolutionFileName = Dir+'solution'<br>
<span class="Apple-tab-span" style="white-space:pre"></span>MB = MergeBlocks(Input = TBR)<br>
<span class="Apple-tab-span" style="white-space:pre"></span>T1 = Transform(Input = MB)<br>
<span class="Apple-tab-span" style="white-space:pre"></span>T1.Transform.Rotate = [-float(Rot/2.0), 0.0, Sweep]<br>
<span class="Apple-tab-span" style="white-space:pre"></span>ISO = IsoVolume(Input = T1)<span class="Apple-tab-span" style="white-space:pre">
</span><br>
<span class="Apple-tab-span" style="white-space:pre"></span>ISO.ThresholdRange = [MIN_Tot_Pre, BLE_Tot_Pre]<br>
<span class="Apple-tab-span" style="white-space:pre"></span>ISO.InputScalars = ['POINTS','total_pressure']<br>
<span class="Apple-tab-span" style="white-space:pre"></span>SL = Slice(Input = T1)<br>
<span class="Apple-tab-span" style="white-space:pre"></span>SL.SliceType="Plane"<br>
<span class="Apple-tab-span" style="white-space:pre"></span>SL.SliceOffsetValues = n<br>
<span class="Apple-tab-span" style="white-space:pre"></span>SL.SliceType.Origin = Inboard<br>
<span class="Apple-tab-span" style="white-space:pre"></span>SL.SliceType.Normal = Normal<br>
<span class="Apple-tab-span" style="white-space:pre"></span>Con = Contour(Input = SL)<br>
<span class="Apple-tab-span" style="white-space:pre"></span>Con.PointMergeMethod = "Uniform Binning"<br>
<span class="Apple-tab-span" style="white-space:pre"></span>Con.ContourBy = ['POINTS', 'total_pressure']<br>
<span class="Apple-tab-span" style="white-space:pre"></span>Con.Isosurfaces = [BLE_Tot_Pre]<br>
<span class="Apple-tab-span" style="white-space:pre"></span>Pass = PassArrays(Con)<br>
<span class="Apple-tab-span" style="white-space:pre"></span>Pass.PointDataArrays = ['wall_distance']<br>
<span class="Apple-tab-span" style="white-space:pre"></span>h=CreateWriter(Dir+'Edge.csv',Pass)<br>
<span class="Apple-tab-span" style="white-space:pre"></span>h.FieldAssociation = "Points"<br>
<span class="Apple-tab-span" style="white-space:pre"></span>h.Precision = 15<br>
<span class="Apple-tab-span" style="white-space:pre"></span>h.UpdatePipeline()<br>
<br>
<span class="Apple-tab-span" style="white-space:pre"></span>….read Edge.csv file for further analysis<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
</blockquote>
</div>
<br>
</body>
</html>