[Paraview-developers] Is it possible to implement a POD filter in paraview using python?

Andy Bauer andy.bauer at kitware.com
Thu Apr 23 09:26:09 EDT 2015


The best way would be to implement this in C++ but it's also doable in
Python.

If you want to do it in Python I'd suggest reading through Berk Geveci's
blog posts on Python and VTK (http://www.kitware.com/blog/home/user/53).
The one most relevant is probably http://www.kitware.com/blog/home/post/783
but the others give good background.

Regards,
Andy

On Thu, Apr 23, 2015 at 3:55 AM, Di Cheng <chengdi at imech.ac.cn> wrote:

> Hi, everyone.
>
>
>
> 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
> http://web.mit.edu/kwillcox/Public/Web/BTTanMS.pdf
>
> The algorithm can be summarized as:
> 0. get timestepvalues of interest as t_i, i=1..N
> 1. load field P of two timesteps such as as P_i=P(t_i),P_j=P(t_j)
> 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.
>
> 3. get the eigen values lambda_i and corresponding right egien vector
> eV_ii of matrix {R_ij}
> 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.
> 5. reconstruct Pr_m field using first m POD bases:
> Pr_m = sum(lambda_i * psi_i, i = 1.. m)
>
> 6.output the lambda_i, psi_i and Pr_m
>
> 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 “*c1.UpdatePipeline(t_1);
> c2.UpdatePipeline(t_2);” * to load two timesteps at one time to avoid
> this problem. I do not know if this method works.
>
> 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.
>
> 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++).
>
> So, could anyone help me to finish it or tell me it is not possible?
>
> Thanks
>
> p.s. I just posted a Request a New Feature in
> http://paraview.uservoice.com/forums/11350-general/suggestions/7671768-proper-orthogonal-decomposition-analysis-filter
>
> Di CHENG (Ph.D. candidate)
>
> Supersonic Combustion Group
>
> State Key Laboratory of High Temperature Gas Dynamics
>
> Institute of Mechanics, Chinese Academy of Sciences
> ADDRESS: No.15 Beisihuanxi Road, Beijing (100190)
> P. R. China
> E-mail: chengdi at imech.ac.cn
>
> Phone: +86-10-82544053
>
> Fax: +86-10-82544034
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at:
> http://markmail.org/search/?q=Paraview-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20150423/689df16a/attachment-0001.html>


More information about the Paraview-developers mailing list