Python script to export animation images
Hey everyone,
I am new to CFD and having a bit of trouble. My goal is to export the animation from ParaView as a video file or a series of images using some kind of script. The only way that I know how to export images is to manually go and click to export the images. I want to have a script that automatically does this so it would be more efficient. My current version of ParaView is 3.12.0 32-bit. I tried using this link http://paraview.org/Wiki/ParaView/Python_Scripting to setup the python to work with the ParaVeiw, but no success. I could not find the path(s) that were mentioned on the tutorial. Any help is appreciate. Thanks, Mahyar |
So I tried using the Trace option in ParaView but I get the following error:
from paraview.simple import * Traceback (most recent call last): File "<console>", line 1, in <module> File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/simple.py", line 39, in <module> import servermanager File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module> import paraview, re, os, os.path, new, sys, vtk File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module> from vtkCommonPython import * ImportError: No module named vtkCommonPython I cannot find vtkCommonPython anywhere on my system. |
|
Hello! Even though the easiest manner is to use JR22's method, it is sometimes not possible. When I leave work, I only have remote access to a windows machine and through that to the cluster server (yeap, those lovely security restrictions lead to inefficient situations). Therefore, the best way to see the results when I am away is to develop a paraview script to post-process.
So, I find the OP's question for a script meaningful and did not have the time to work on it myself. Does someone have something ready to share or some guidelines? |
Hi
what about "Advanced Paraview Tutorial", by Dave DeMarle, Kitware, Inc. given on the 6th Openfoam workshop? http://openfoam-extend.sourceforge.n...m/training.htm |
I was able to solve the vtkCommonPython error by uninstalling ParaView 3.12 and installing a newer version. Now, I have used the Trace option to get a script from ParaView.
My main goal is to have a script run automatically once it detects the output files from OpenFOAM. It should basically create the vtk files, open them with ParaView, and output a video of the simulation to a specified directory. Currently, I am somewhat stuck on calling Terminal commands in Ubuntu via a python script. First, I have changed my directory using os.chdir(/path/to/files) Then, I used os.system("paraFoam") in order to open ParaView from a directory but it says "sh: 1: paraFoam: not found" |
Quote:
Did you get any success? I am also trying to do the same. If you found the path will you guide me? Regards, CFDUser_ |
Greetings to all!
For future reference, the issue with the missing vtkCommonPython was reported here: http://www.openfoam.org/mantisbt/view.php?id=969 - a fix is also provided there. As for CFDUser's question and Mahyar's issue: if a more detailed script had been provided, it would possibly had been easier to help. Anyway, as far as I can see:
Bruno |
Quote:
Regards, CFDUser_ |
Dear Bruno,
I am wondering if I can post-processing my data using Paraview script. For example, I need to the following action for each time step: Code:
output the velocity components on one slice to CSV file I read the following link: http://www.paraview.org/Wiki/ParaView/Python_Scripting But it is very difficult to understand for me now. Do you have any suggestions? Thank you. OFFO Quote:
|
Hi OFFO,
Quote:
If not, perhaps it's easier if you explain what you've already learned so far in using ParaView Python, so that I can figure out what needs to be explained. Best regards, Bruno |
All times are GMT -4. The time now is 00:17. |