<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Hi Shuhao, </p>
<p><br>
</p>
<p>Thank you for your response. Yes, I found the TemporalStatistics filter as well. Could you please let me know how I can save it back as a .vtu file?</p>
<p><br>
</p>
<p>Best Regards,</p>
<p>Parastou</p>
<p><br>
</p>
<div id="x_Signature">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px"><br>
<div><font face="Times New Roman" size="3"></font></div>
<div><br>
</div>
</div>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> ParaView <paraview-bounces@paraview.org> on behalf of Shuhao Wu <shuhao@shuhaowu.com><br>
<b>Sent:</b> Monday, October 23, 2017 4:46:24 PM<br>
<b>To:</b> paraview@paraview.org<br>
<b>Subject:</b> Re: [Paraview] Calculating time-averaged shear stress</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">I believe you're looking for the TemporalStatistics filter. Specifically
<br>
what you want maybe something along the lines of:<br>
<br>
   temporal_statistics = TemporalStatistics(Input=vtk_data)<br>
   temporal_statistics.ComputeAverage = 1<br>
   temporal_statistics.ComputeMinimum = 0<br>
   temporal_statistics.ComputeMaximum = 0<br>
   temporal_statistics.ComputeStandardDeviation = 0<br>
<br>
This should make the computation slightly faster as you don't need to <br>
compute and store the stddev, min, and max.<br>
<br>
Shuhao<br>
<br>
On 2017-10-23 02:36 PM, Eslami, Parastou wrote:<br>
> Hi  Everyone,<br>
> <br>
> <br>
> I'm very new to Paraview and python scripting. I have a series of time dependent .vtu files and would like to<br>
> <br>
>    1.  Read the vtu files for each time step<br>
>    2.  calculate the magnitude of shear stress<br>
>    3.  calculate time-averaged shear stress for all the elements in my geometry<br>
>    4.  output/write a vtu file and load it back to paraview.<br>
> <br>
> I think I have been able to successfully implement steps 1 and 2 (please see bellow)  but am completely clueless on how to do 3 and 4. Could anyone help me with this? I also should mention that I have tried the Temporal Statistics Filter and it seems to be
 working fine, but would like to have a way to do it with pythons scripting as well.<br>
> <br>
> <br>
> Thanks,<br>
> Parastou<br>
> <br>
> <br>
> #### import the simple module from the paraview<br>
> from paraview.simple import *<br>
> import numpy as np<br>
> #### disable automatic camera reset on 'Show'<br>
> paraview.simple._DisableFirstRenderCameraReset()<br>
> <br>
> dumm_vWSS = []<br>
> <br>
> for i in range(4500, 4550, 50):<br>
>      f = "\...\.../all_results_0" + str(i) + ".vtu"<br>
>      print i<br>
>      # create a new 'XML Unstructured Grid Reader'<br>
>      all_results = XMLUnstructuredGridReader(FileName=f)<br>
>      all_results.CellArrayStatus = ['GlobalElementID']<br>
>      all_results.PointArrayStatus = ['GlobalNodeID', 'vinplane_traction', 'vWSS', 'average_speed', 'average_pressure', 'pressure', 'velocity', 'timeDeriv']<br>
>      # create a new 'Calculator'<br>
>      calculator1 = Calculator(Input=all_results)<br>
>      calculator1.Function = ''<br>
>      # Properties modified on calculator1<br>
>      calculator1.ResultArrayName = 'WSS mag'<br>
>      calculator1.Function = 'mag(vWSS)'<br>
>      # get the data points<br>
>      SetActiveSource(calculator1)<br>
>      calculator1.UpdatePipeline()<br>
>      vWSSdata=servermanager.Fetch(calculator1)<br>
>      vWSSPoints     =vWSSdata.GetPoints()<br>
>      vWSSPointData  =vWSSdata.GetPointData()<br>
>      vWSSArrayData=vWSSPointData.GetArray('WSS mag')<br>
>      dumm_vWSS.append(vWSSArrayData)<br>
>      print dumm_vWSS<br>
> <br>
> <br>
> <br>
> Parastou Eslami, PhD<br>
> Post-doctoral Fellow, Harvard University<br>
> Department of Radiology, Massachusetts General Hospital<br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> The information in this e-mail is intended only for the person to whom it is<br>
> addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
> contains patient information, please contact the Partners Compliance HelpLine at<br>
> <a href="http://www.partners.org/complianceline">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
> but does not contain patient information, please contact the sender and properly<br>
> dispose of the e-mail.<br>
> <br>
> <br>
> <br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com">www.kitware.com</a><br>
> <br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">
http://www.kitware.com/opensource/opensource.html</a><br>
> <br>
> Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView">
http://paraview.org/Wiki/ParaView</a><br>
> <br>
> Search the list archives at: <a href="http://markmail.org/search/?q=ParaView">http://markmail.org/search/?q=ParaView</a><br>
> <br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/paraview">http://public.kitware.com/mailman/listinfo/paraview</a><br>
> <br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView">
http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView">http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview">http://public.kitware.com/mailman/listinfo/paraview</a><br>
</div>
</span></font>
</body>
</html>