CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums

paraview-python

Register Blogs Community New Posts Updated Threads Search

Rate this Entry

paraview-python

Posted November 9, 2016 at 06:14 by kindle
Updated November 9, 2016 at 10:50 by kindle

Requirement : paraview not the wrapper paraFoam of Openfoam [maybe because it is partially compiled].

1. start paraview
2. tools - start trace
3. openfile (with *.foam)
4. ...
5. save image etc.
6. stop trace and a window will pop out with python script
7. creat pythonScript.py
8. run with pvpython (executable in paraview) or add on first line like #!/opt/ParaView-4.1.0-Linux-64bit/bin/pvpython
9. chmod +x pythonScript.py ; execute pythonScript.py
10. hope it will work and check output images

Not all works !

Quote:
Originally Posted by wyldckat View Post
Hi Eloïse,

Unfortunately not all macros generated by the Trace feature in ParaView will work out-of-the-box. Try this script instead:
Code:
from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()

solid_vtk = LegacyVTKReader( FileNames=['D:\\PostProcessing\\solid.vtk'] )
Render()
Although... it's weird... because at first it didn't work as well, but after a couple of tries with the original code, it works fine. Perhaps it has a few issues with expecting that the base Python code to be already in memory!?

Best regards,
Bruno
Posted in Post-processing
Views 904 Comments 0 Edit Tags Email Blog Entry
« Prev     Main     Next »
Total Comments 0

Comments

 

All times are GMT -4. The time now is 12:45.