CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[General] Batch: Create pictures of time steps

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 23, 2016, 07:16
Default Batch: Create pictures of time steps
  #1
Member
 
Martin
Join Date: Nov 2011
Posts: 35
Rep Power: 14
wernsen is on a distinguished road
Paraview 5.0.0 64bit Linux

Hello Forum,

I have ENSIGHT data which I want to visualise at different views for all the time steps and so on. For this I have created different layouts which I want to use. Right now my work flow is like that.

Attachment 45393
  1. Open the save state "pvsm"
  2. After opening, Paraview asks which ENSIGHT data to use (this is where I can Change also to other data)
  3. Using my macro to Export all the layout Tabs to create the Pictures
Here is my macro:

Code:
#### import the simple module from the paraview
from paraview.simple import *

animationScene = GetAnimationScene()
animationScene.GoToFirst()
PlayMode = "Snap To TimeSteps"
for t in range(272, 722, 2):
    print t
    for i in range(len(GetRenderViews())) :                                                                                                                                     
        RenderView = GetRenderViews()[i]  
        SetActiveView(RenderView)
        print i   
        WriteImage(path + "/Bilder" + str(i) + " " + str(t) + ".png")
        #if i == 2:                                                                                                                             
        #    WriteImage(path_d_iso + "Droplets_ISO_" + str(t) + ".png")
        #if i == 1:                                                                                                                             
        #    WriteImage(path_d_xy + "Droplets_XY_" + str(t) + ".png")
        #if i == 4:                                                                                                                             
        #    WriteImage(path_d_xz + "Droplets_XZ_" + str(t) + ".png")
        #if i == 2:                                                                                                                             
        #    WriteImage(path_l1_xy + "ISO1_XZ_" + str(t) + ".png")
    animationScene.GoToNext()
The macro is loading the first Timestep. Than it is running though all the layout Tabs range(len(GetRenderViews())) while making Pictures with the write command. Afterwards I wanted to use the I from GetRenderViews()[i] to paste the Picture in the designated Folder. Right now this step is deactivated. The picture making is working very good. But:
  1. It is using screenshot method which makes it difficult to run two or more at the same time
  2. How can I distinquish which GetRenderViews()[i] is which layout/view to save it with a proper Name (It seams that even opening the save state the view-layout Connection has changed)
  3. How would it be possible to use paraview in Batch mode? (adding/exchanging the path for the new ENSIGHT data)
wernsen is offline   Reply With Quote

Old   March 1, 2016, 02:56
Default
  #2
Member
 
Martin
Join Date: Nov 2011
Posts: 35
Rep Power: 14
wernsen is on a distinguished road
Does no one has a clue?

Is there maybe an other way of exporting pictures of all the time steps? I would like to have a template for exporting the different views.
wernsen is offline   Reply With Quote

Old   March 1, 2016, 08:01
Default
  #3
Member
 
Martin
Join Date: Nov 2011
Posts: 35
Rep Power: 14
wernsen is on a distinguished road
with using the .pvbatch in the bin folder of paraview it is now possible to run paraview in the batch mode

.../ParaView-5.0.0/bin/pvbatch --use-offscreen-rendering writeScreen_batch.py

in the writeScreen_batch.py I use servermanager.LoadState(); to load the template for postprocessing the ensight data.

Code:
#### import the simple module from the paraview
from paraview.simple import *
import os

servermanager.LoadState("LayOut_cell.pvsm")

path = "Bilder"

if not os.path.exists(path):
    print "Create Path"
    os.makedirs(path_w_iso)

#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()

animationScene = GetAnimationScene()
animationScene.GoToFirst()
PlayMode = "Snap To TimeSteps"

for t in range(272, 274, 2):
    print t
    for i in range(len(GetRenderViews())) :                                                                                                                                     
        RenderView = GetRenderViews()[i]  
        SetActiveView(RenderView)
        print i  
        Render(); 
    animationScene.GoToNext()
with this it is now possible to run multiple instances of paraview for the postprocessing. the first question is now solved.
wernsen is offline   Reply With Quote

Old   March 2, 2016, 05:04
Default
  #4
Member
 
Martin
Join Date: Nov 2011
Posts: 35
Rep Power: 14
wernsen is on a distinguished road
ok this now seams to work fairly well.

The only thing however is that if I add a new view to the template, the order of views is changed. Is there some how a fixed ID for every view?
wernsen is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field lakeat OpenFOAM Community Contributions 58 December 23, 2021 02:36
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 06:09
How to export time series of variables for one point? mary mor OpenFOAM Post-Processing 8 July 19, 2017 10:54
simpleFoam error - "Floating point exception" mbcx4jc2 OpenFOAM Running, Solving & CFD 12 August 4, 2015 02:20
Where's the singularity/mesh flaw? audrich FLUENT 3 August 4, 2009 01:07


All times are GMT -4. The time now is 06:53.