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

paraView in shell mode (python script running)

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By MartinB

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 17, 2012, 12:08
Default paraView in shell mode (python script running)
  #1
New Member
 
Andrzej Prusiński
Join Date: Jul 2011
Posts: 10
Rep Power: 14
Prosiaczek is on a distinguished road
Dear all,

I'm looking for a method that helps me to run my *.py file under paraView without starting its GUI. Maybe you know how to solve it?

Roughly speaking, I try to automatize a process of meshing (in snappyHexMesh). Instead of running paraFoam after each process, I would like to produce some predefined screenshots, so I could compare it later by myself.

Until now, I've made a small script thanks to the macro tracking option (in paraView's GUI) and saved it into makro.py file and I know how to run it using Python shell when GUI is available, but since I will work remotely on a server which is equipped with extremely low bandwith I need another way to produce those pictures. Just to stress the problem is the fact that I need about 15 min only to run GUI via Xterm (Cygwin), not mentioning that I need to load the mesh and probably rotate it or cut it... which takes another 15 (or more) minutes.

I would appreciate any help. Thanks in advance.
Prosiaczek is offline   Reply With Quote

Old   March 17, 2012, 15:19
Default
  #2
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
Hi Andrzej,

you can start Python scripts for Paraview with the "pvbatch" command via ssh.

Depending on the Paraview installation on the server side it might be necessary to compile Paraview there with OSMesa (CPU based offscreen rendering) and Python enabled. The Paraview directory to the location of "pvbatch" must be known by the servers system, of course.

An easy way to to create the scripts is to use your macro as a starting point. Especially the camera settings are useful. Then add more Python code as necessary, a good source of knowledge can be found here:
http://paraview.org/Wiki/ParaView/Python_Scripting

Martin
lakeat likes this.
MartinB is offline   Reply With Quote

Old   March 19, 2012, 08:54
Default
  #3
Senior Member
 
Elvis
Join Date: Mar 2009
Location: Sindelfingen, Germany
Posts: 620
Blog Entries: 6
Rep Power: 24
elvis will become famous soon enough
Hi,

as all visualisation is based on "VTK" you might also take a look at mayavi2 as well =>scripting
http://github.enthought.com/mayavi/m...e-to-scripting
http://github.enthought.com/mayavi/mayavi/mlab.html
http://github.enthought.com/mayavi/mayavi/index.html
foamToVTK can convert you shm to vtk-files that can be viewed by mayavi or visit
elvis is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Running FLUENT in batch mode for Windows OS Jake Lee FLUENT 7 June 29, 2016 09:38
script file for running fluent on linux cluster Worth FLUENT 2 February 9, 2012 12:31
Running Job in Batch mode (EFD) Nick Sessions FloEFD, FloWorks & FloTHERM 0 April 16, 2008 17:44
problem with running UDF in batch mode James FLUENT 0 June 6, 2006 07:49
Running script files without opening grafic inter Jim CFX 0 March 21, 2006 07:57


All times are GMT -4. The time now is 04:02.