[Paraview] Pause in batch script

Berk Geveci berklist at nycap.rr.com
Thu Jul 15 08:21:28 EDT 2004


Hi.

The most important thing you need to know is that all ParaView scripts
are Tcl scripts (and support Tk). You can do anything you can do in Tcl
in them. Here is an example .pvs script:

set shouldCont 1
while {1} {
    if { $shouldCont } {
# do something here
        update
    } else {
        break
    }
}

As you can see, this script continuously update the GUI (the update Tk
call) if shouldCont is set to false. This means that while this script
is running, the user will be able to interact with ParaView. To exit
the script, the user has to set shouldCont to 0 in the command prompt.
The simpler thing to do would be to create a pop-up window that has
an exit button. 
Inside the while loop, you can do whatever Tcl allows you to do. You can
check if a file has been modified and update ParaView accordingly, you
can even create a socket connection to some server to communicate. One
word of caution: changing ParaView state while the user is interacting
may lead to instability. For example, modifying a source while the
user is changing parameters might have unexpected side effects.

-Berk

On Wed, 2004-07-14 at 08:33, Nicholas Pedersen wrote:
> 
> 
> Hi,
> 
> I would like ParaView to act as visualizer for a transient CFD simulation
> 'on-the-run', that is ParaView should load results files in Ensgiht format
> as soon as they appear in a specified data directory.
> 
> For this means I could follow at least two different approaches:
> a) write a batch script that calls Paraview once but includes a 'pause'
> function waiting for new files to appear before proceeding. How do I
> accomplish this file testing _inside_ a *.pvs script?
> 
> b) make the file testing outside paraview and then launch a *.pvs script
> telling Paraview to update the plot. How do l invoke a *.pvs script on an
> _existing_ Paraview session?
> 
> Regards,
> 
> Nicholas
> 
> ---------------------------------------------------------------------------------------------------------
> 
> Nicholas Pedersen, Ph.D.            Email: nipedersen at grundfos.com
> Development Engineer                 Tel: +45 8750 4767 (direct)
> Fluid Dynamic Engineering          Fax: +45 8750 1491
> Grundfos Management A/S
> Poul Due Jensens Vej 7
> DK-8850 Bjerringbro
> ---------------------------------------------------------------------------------------------------------
> 
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview
-- 
Berk Geveci <berklist at nycap.rr.com>



More information about the ParaView mailing list