|
[Sponsors] |
[OpenFOAM] How to output images using command automatically? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 19, 2009, 21:30 |
How to output images using command automatically?
|
#1 |
Senior Member
Daniel WEI (老魏)
Join Date: Mar 2009
Location: Beijing, China
Posts: 689
Blog Entries: 9
Rep Power: 21 |
Dear all,
Other than File->Save screenshot, I want to output images of U, epsilon, etc., automatically using shell script or other methods, do you know how to achieve this goal? Thank you! DW
__________________
~ Daniel WEI ------------- Boeing Research & Technology - China Beijing, China |
|
April 20, 2009, 07:29 |
|
#2 |
Member
Michael Roth
Join Date: Mar 2009
Location: Guelph, Ontario, Canada
Posts: 50
Rep Power: 17 |
Have you considered using Python to call ParaView? Perhaps something along the lines of http://www.cmake.org/pipermail/parav...ly/005427.html
Michael |
|
April 20, 2009, 09:42 |
|
#3 |
Senior Member
Daniel WEI (老魏)
Join Date: Mar 2009
Location: Beijing, China
Posts: 689
Blog Entries: 9
Rep Power: 21 |
Thank you, Michael! But I really don't understand the python script and I think I have no energy to delve into it, and I am looking forward to pyFoam to have that function. It would be very nice if Mr. Gschaider will help us on this.
With Regards, Daniel
__________________
~ Daniel WEI ------------- Boeing Research & Technology - China Beijing, China |
|
April 21, 2009, 07:19 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Hi Daniel!
Quote:
Code:
pyFoamPVSnapshot.py -h Usage ===== pyFoamPVSnapshot.py [options] <case> Generates snapshots of an OpenFOAM-case and a predefined paraview State-File using the PV3FoamReader that comes with OpenFOAM. The state-file can be generated using a different case (the script adjusts it before using) but the original case has to have a similar structure to the current one. Also exactly one PV3Reader has to be used in the state-file (this requirement is fullfilled if the StateFile was generated using paraFoam) In TextSources the string "%(casename)s" gets replaced by the casename. Additional replacements can be specified Bernhard PS: There seems to be slight problem with the 3.3-version that is distributed with OpenFOAM. But it works with 3.4 |
||
April 21, 2009, 08:55 |
|
#5 |
Senior Member
Daniel WEI (老魏)
Join Date: Mar 2009
Location: Beijing, China
Posts: 689
Blog Entries: 9
Rep Power: 21 |
Hi Bernhard, say hi to Mr. Gschaider, when you meet him.
But what is state-file, can you give me an example?
__________________
~ Daniel WEI ------------- Boeing Research & Technology - China Beijing, China |
|
April 21, 2009, 11:34 |
|
#6 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
I usually avoid that. People look at me funny when I talk aloud to him.
The state file is the file that you produce with "Save State" in the paraview-file menu. With "Load State" it allows you exactly return to the state you had (all the filters etc). Play around with these two menu-entries and you'll see what I mean BTW: I added on the PyFoam-Wiki-page some information that explains how to set up a OF-installation so that PVSnapshot works Bernhard |
|
May 14, 2009, 04:59 |
|
#7 |
New Member
Sumeet Kumar
Join Date: Mar 2009
Posts: 21
Rep Power: 17 |
Hi All,
I am using pyFoamPVSnapshot utility available in pyFoam. I have :- pyFoam 0.5.2 python 2.5.4 paraview 3.4 on Opensuse 10.3 x86_64 machine I installed paraview 3.4 with QT4.3.5. The pyFoamPVLoadState script works fine but on running the snapshot script, with the provided inputs. I received following error messages :- > pyFoamPVSnapshot.py --state-file=U.pvsm --latest-time --file-prefix=vel . Snapshot 0 for t= 1000 vtkPainterPolyDataMapper : [ ...........] Segmentation fault Please advice Regards Sumeet Last edited by crazysumi; May 14, 2009 at 08:35. |
|
May 19, 2009, 17:59 |
|
#8 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Some questions: Does this happen with every StateFile or just with a specific one? Is the paraView compiled with MESA enabled? Do you feel comfortable with enabling core dumps with "ulimit -c <some value>" and getting a stack-trace with gdb (if not, don't bother it would take too long guiding you through this)? Bernhard |
||
May 20, 2009, 01:29 |
|
#9 |
New Member
Sumeet Kumar
Join Date: Mar 2009
Posts: 21
Rep Power: 17 |
Hi Bernhard,
It happens with every state-file generated in paraFoam (for PV3FoamReader). I checked the script, MESA was not enabled in script. However, I enabled the INCLUDE_PYTHON and set the path for python libs in the script. "Do you feel comfortable with enabling core dumps with "ulimit -c <some value>" and getting a stack-trace with gdb.." I don't know how to do it. Recently I started a bit different way of doing the same thing using pvpython shell. I created some state files by reading thru Parafoam, and paraview for VTK, ensight files. On loading state files using the shell, it is not able to recognize "PV3FoamReader" as a source. Howerver, state files for VTK, Ensight files are well read and loaded and images can be written. Is there any way to include PV3Foamreader as a source to pvpython shell. Thanks, Sumeet |
|
May 20, 2009, 10:23 |
|
#10 | |||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
view.UseOffscreenRenderingForScreenshots=True in PyFoam.Applications.PVSnapshot.py and replace it with False (thus disabling MESA for sure) Quote:
Quote:
Bernhard |
||||
August 18, 2010, 08:57 |
|
#11 |
Senior Member
Join Date: Dec 2009
Posts: 112
Rep Power: 16 |
Hi There (and special greetings to Bernhard, again ),
i am using OF1.6 now and pyFoamPVSnapshot.py ist not working...as mentioned above.. So I installed paraview3.4.0 with my ubuntu package-manager. pyFoamPVSnapshot.py does not care about me having done this, it still refuses to work. So how can I make pyFoamPVSnapshot.py use a certain paraview-version when i have installed more than one? Thx! |
|
August 18, 2010, 11:28 |
|
#12 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Loading the PV3-Plugin is a bit of a due to problems in the Python-code of Paraview and probably never will be supported for the OF1.6/PV3.6-combo and for the OF1.7/PV3.8-combo subject to research. What is supported since the last version of PyFoam is the native OF reader (plugin for 3.6, built-in since 3.8). PVSnapshot looks at the state-file and tries to load the OF-reader that you used. There still may be a problem if the reader is a plugin Bernhard |
||
August 19, 2010, 06:53 |
|
#13 | |
Senior Member
Join Date: Dec 2009
Posts: 112
Rep Power: 16 |
Quote:
so this means that there is no good solution to OF1.6 ? Would it help to install OF1.6 and OF1.5( use the nice pyFoam stuff with of 1.5...) ? Best |
||
August 19, 2010, 13:11 |
|
#14 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Alternative would be to install 1.7/3.8 and use a state-file where you used the native reader. That works for me (PV3Reader needs some modifications due to the new path were it is located) Bernhard |
||
July 18, 2019, 13:39 |
|
#15 |
Senior Member
Amin
Join Date: Oct 2013
Location: Germany
Posts: 397
Rep Power: 14 |
hi Bernhard, Is it possible to save the PNGs with transparent background? the paraview's background, from which the state file is being saved, always comes with a color; to my knowledge transparent background is only available under File>save screenshot, is the same option available through pyFoamPVSnapshot.py ? thanks |
|
July 19, 2019, 03:28 |
|
#16 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
I must have a look whether the PYthon-API supports it. But I don't have it inmplemented ... yet
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
July 19, 2019, 10:06 |
|
#17 |
Senior Member
Amin
Join Date: Oct 2013
Location: Germany
Posts: 397
Rep Power: 14 |
||
July 19, 2019, 18:24 |
|
#18 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Seems like I already implemented it in January and forgot about it The reason why you don't see it is that there wasn't a release in the meantime. So the problem shifts to "when I find time for a release"
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
July 20, 2019, 05:13 |
|
#19 | |
Senior Member
Amin
Join Date: Oct 2013
Location: Germany
Posts: 397
Rep Power: 14 |
Quote:
yes, I'm familiar with that feeling, kind of a deja vu hope you'll get sometime and share the new features thanks |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] outputTime in Swak function | immortality | OpenFOAM Community Contributions | 20 | October 6, 2022 12:08 |
writing execFlowFunctionObjects | immortality | OpenFOAM Post-Processing | 30 | September 15, 2013 06:16 |
RNG diverged during the analysis the flow over a multi element airfoil, why? | s.m | OpenFOAM Running, Solving & CFD | 0 | August 5, 2013 08:39 |
mixerVesselAMI2D's mass is not balancing | sharonyue | OpenFOAM Running, Solving & CFD | 6 | June 10, 2013 09:34 |
lift and drag on ship superstructures | vaina74 | OpenFOAM Running, Solving & CFD | 3 | June 8, 2010 12:30 |