<div dir="ltr"><div><div><div>The best way would be to implement this in C++ but it's also doable in Python. <br><br></div>If you want to do it in Python I'd suggest reading through Berk Geveci's blog posts on Python and VTK (<a href="http://www.kitware.com/blog/home/user/53">http://www.kitware.com/blog/home/user/53</a>). The one most relevant is probably <a href="http://www.kitware.com/blog/home/post/783">http://www.kitware.com/blog/home/post/783</a> but the others give good background. <br><br></div>Regards,<br></div>Andy<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 23, 2015 at 3:55 AM, Di Cheng <span dir="ltr"><<a href="mailto:chengdi@imech.ac.cn" target="_blank">chengdi@imech.ac.cn</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="#0563C1" vlink="#954F72" lang="ZH-CN"><div><p style="margin:0cm;margin-bottom:.0001pt;line-height:14.7pt;background:white;vertical-align:baseline"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#292c33" lang="EN-US">Hi, everyone.<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt;line-height:14.7pt;background:white;vertical-align:baseline"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#292c33" lang="EN-US"><u></u> <u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt;line-height:14.7pt;background:white;vertical-align:baseline"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#292c33" lang="EN-US">I am interested in using proper orthogonal decomposition to analyze unsteady flow field data obtained from CFD in paraview. I tried to implement it using python. But I am not sure if there is a better way to implement the POD algorithm described in chapter 3.2 of<a href="http://web.mit.edu/kwillcox/Public/Web/BTTanMS.pdf" target="_blank"><span style="font-family:"inherit",serif;color:#007dbf;border:none windowtext 1.0pt;padding:0cm">http://web.mit.edu/kwillcox/Public/Web/BTTanMS.pdf</span></a> <u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:16.8pt;margin-left:0cm;line-height:14.7pt;background:white;vertical-align:baseline;font-stretch:inherit;text-align:start;word-spacing:0px"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#292c33" lang="EN-US">The algorithm can be summarized as:<span> </span><br>0. get timestepvalues of interest as t_i, i=1..N<span> </span><br>1. load field P of two timesteps such as as P_i=P(t_i),P_j=P(t_j)<span> </span><br>2. calculate the correlation R_ij = inner_product(P_i,P_j)/N, the definition of inner product could be integration of P_i*P_j over the volume.<span> </span><br>3. get the eigen values lambda_i and corresponding right egien vector eV_ii of matrix {R_ij}<span> </span><br>4. construct the i-th POD basis psi_i = sum(dot(eV_ij,P_j),j=1..N), usually, only the first m bases are used.<span> </span><br>5. reconstruct Pr_m field using first m POD bases:<span> </span><br>Pr_m = sum(lambda_i * psi_i, i = 1.. m)<u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:16.8pt;margin-left:0cm;line-height:14.7pt;background:white;vertical-align:baseline"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#292c33" lang="EN-US">6.output the lambda_i, psi_i and Pr_m<u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:16.8pt;margin-left:0cm;line-height:14.7pt;background:white;vertical-align:baseline"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#292c33" lang="EN-US">The algorithm is simple but the problem is to avoid loading the very large 3D dataset of all timesteps into memory. I tried to use “<i>c1.UpdatePipeline(t_1); c2.UpdatePipeline(t_2);” </i> to load two timesteps at one time to avoid this problem. I do not know if this method works.<u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:16.8pt;margin-left:0cm;line-height:14.7pt;background:white;vertical-align:baseline"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#292c33" lang="EN-US">Then I tried to implement the following algorithm using python. A pipeline is used to calculate the inner product via Programmable Filter and Integrate Variables. And I can get the correlation matrix and eigen values and eigen vectors. <u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:16.8pt;margin-left:0cm;line-height:14.7pt;background:white;vertical-align:baseline"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#292c33" lang="EN-US">The final step is the most difficult part in python. I do not know how to implement it in python. I did not implement it yet. I do not want to use Fetch method to collect all data to the master node. But the functionality of python shell seems limited and accessing the cells’ structure is difficult. I want to know how TemporalAverge filter works but I cannot identify where it is in the source code. (I am not familiar with software development using C++).<u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:16.8pt;margin-left:0cm;line-height:14.7pt;background:white;vertical-align:baseline"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#292c33" lang="EN-US">So, could anyone help me to finish it or tell me it is not possible?<u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:16.8pt;margin-left:0cm;line-height:14.7pt;background:white;vertical-align:baseline;font-stretch:inherit;text-align:start;word-spacing:0px"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#292c33" lang="EN-US">Thanks<u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:16.8pt;margin-left:0cm;line-height:14.7pt;background:white;vertical-align:baseline"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#292c33" lang="EN-US">p.s. I just posted a Request a New Feature in <a href="http://paraview.uservoice.com/forums/11350-general/suggestions/7671768-proper-orthogonal-decomposition-analysis-filter" target="_blank">http://paraview.uservoice.com/forums/11350-general/suggestions/7671768-proper-orthogonal-decomposition-analysis-filter</a><u></u><u></u></span></p><p class="MsoNormal" style="text-align:left;background:white" align="left"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#222222" lang="EN-US">Di CHENG (Ph.D. candidate)<u></u><u></u></span></p><p class="MsoNormal" style="text-align:left;background:white" align="left"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#222222" lang="EN-US">Supersonic Combustion Group<u></u><u></u></span></p><p class="MsoNormal" style="text-align:left;background:white" align="left"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#222222" lang="EN-US">State Key Laboratory of High Temperature Gas Dynamics<u></u><u></u></span></p><p class="MsoNormal" style="text-align:left;background:white" align="left"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#222222" lang="EN-US">Institute of Mechanics, Chinese Academy of Sciences<br>ADDRESS: No.15 Beisihuanxi Road, Beijing (100190)<br>P. R. China<br>E-mail: <a href="mailto:chengdi@imech.ac.cn" target="_blank"><span style="color:#222222;background:#ffffcc">chengdi@imech.ac.cn</span></a><u></u><u></u></span></p><p class="MsoNormal" style="text-align:left;background:white" align="left"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#222222" lang="EN-US">Phone: <a href="tel:%2B86-10-82544053" target="_blank"><span style="color:#1155cc">+86-10-82544053</span></a><u></u><u></u></span></p><p class="MsoNormal" style="text-align:left;background:white" align="left"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#222222" lang="EN-US">Fax: <a href="tel:%2B86-10-82544034" target="_blank"><span style="color:#1155cc">+86-10-82544034</span></a><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p></div></div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=Paraview-developers" target="_blank">http://markmail.org/search/?q=Paraview-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview-developers" target="_blank">http://public.kitware.com/mailman/listinfo/paraview-developers</a><br>
<br></blockquote></div><br></div>