[Paraview] pvbatch and paraview to extract images and data.
0252525
s00060942p at gmail.com
Thu Mar 22 12:48:24 EDT 2012
Dear All,
I have been recently experimenting with OpenFOAM and paraview, in
particular pvbatch. In particular, I am interested in exporting images and
data from paraview, using pvbatch.
To this end, I do the following:
[1] Run OpenFOAM and generate the required "state file" in paraview (say
pressure.pvsm)
[2] Run "pvbatch extract.py", where my extract.py looks as follows:
from paraview.simple import *
servermanager.LoadState("/home/jameswh/OpenFOAM/ram-2.1.0/run/tutorials/incompressible/icoFoam/cavity/pressure.pvsm")
GetActiveSource()
SetActiveView(GetRenderView())
Render()
WriteImage("/home/ram/image1.png")
and it works fine. However, I have two fundamental problems:
[1] If I change my input to OpenFOAM, and run the above (extract.py), the
images are not scaled to the correct units (pressure). How can I
automatically rescale the results value? So, say for case 1 run, my min and
max are 5 and 10, for case 2 run, my min and max and 10 and 20. However,
since Iam using the pvsm from case 1, my images in case 2 also show 5 and
10, rather than 10 and 20. I found the "properties" tag in the *.pvsm file,
and I notice that the values are "hard coded" How can I say "scale values
automatically"? I hope my question is clear.
[2] Secondly, I would like to write out values using "Save Data", and I am
looking for an equivalent of "save data" in pvbatch. I tried doing a python
trace, but, when I do a Save Data, it does not seem to track/trace anything.
If anyone has encountered the above problems, and possibly have a solution,
Id be glad if you could point me in the right direction.
Thank you for your time.
regards,
James WH
Research Fellow in Engineering,
Oxford.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20120322/c02b68f2/attachment.htm>
More information about the ParaView
mailing list