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

Di Cheng chengdi at imech.ac.cn
Thu Apr 23 03:55:28 EDT 2015


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>
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-prope
r-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:  <mailto:chengdi at imech.ac.cn> chengdi at imech.ac.cn

Phone:  <tel:%2B86-10-82544053> +86-10-82544053

Fax:  <tel:%2B86-10-82544034> +86-10-82544034

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20150423/6170ea1b/attachment.html>


More information about the Paraview-developers mailing list