PARAVIS development

PARAVIS user documentation

1.Introduction

2.Building environment

3.VTK library

4.Building of PARAVIS

5.Starting SALOME with PARAVIS

6.Commands accessible in Python console

7.Trace management

8.PARAVIS GUI specific

Introduction

This document describes features of ParaView Python extractor using in PARAVIS module of SALOME platform. In general building of PARAVIEW module is not too much differ from usual process of any other SALOME module building, and result Python API extracted for using in SALOME Python console is similar to the server manager API of ParaView. But there are some features what is desirable to understand for effective using of extractor.

Building environment

In addition to standard SALOME environment following environment variables has to be defined for PARAVIS building and testing:

  1. PVHOME – points to installation directory of ParaView.

  2. PVVERSION – defines a number of installed ParaView version.

  3. PATH="${PVHOME}/bin:${PATH}"

  4. LD_LIBRARY_PATH=”${PVHOME}/bin:${PVHOME}/lib/paraview-${PVVERSION}:${LD_LIBRARY_PATH}"

  5. PYTHONPATH="${PVHOME}/bin:${PVHOME}/lib/paraview-${PVVERSION}:${PYTHONPATH}"

  6. TESTDIR – points to a directory which contains test script files. Usually it is PARAVIS_SRC/test.

  7. PVDATA – points to ParaViewData directory.

Also it is necessary to check that PARAVIS_SRC directory contains following files and they are up-to-date:

  1. src/Paraview/lex.yy.c

  2. src/Paraview/vtkParse.tab.c

  3. src/Paraview/vtkParse.h

VTK library

SALOME already uses VTK library for visualization and post-processing purposes. PARAVIS also uses VTK library supplied with ParaView. In order to avoid problem with using of different versions of VTK library in different components of SALOME platform it is necessary to use the same version supplied with ParaView for all components and modules of SALOME.

For this purposes a new option “--with-paraview” has been defined for configure script. This option configures building procedure to use VTK from ParaView. It means that GUI package and all modules has to be configured with this option.

Building of PARAVIS


  1. Call build_configure script in sources directory:

    > build configure

  2. Launch configure script from a build directory.

    > ../PARAVIS_SRC/configure --prefix=$PARAVIS_ROOT_DIR

  3. Call make command in build directory.

    > make

  4. Call make install command in build directory.

    > make install

Starting SALOME with PARAVIS

> runSalome –modules="PARAVIS"

If it is necessary then other SALOME modules can be added to “modules” list separated by comma.

Commands accessible in Python console

Loading ParaView Python API for PARAVIS can be done with help of command:

> from pvsimple import *

This command makes accessible the same Python API what provided by simple.py module in ParaView (see ParaView documentation).

Trace management

Last version of ParaView is supplied with trace functionality. PARAVIS also supports this feature. But in contrary to ParaView, which can start/stop trace in any moment, in PARAVIS trace is activating or deactivating for whole session.

Trace functionality can be switched on/off in SALOME preferences dialog box in PARAVIS tab (main menu | Preferences...). It contains check box “Deactivate Trace”. By default the trace is activated. Change of check box state makes effect only for next session.

User can get the trace with help of two commands (after pvsimple import):

  1. PrintTrace() - prints the trace content directly into Python console window.

  2. SaveTrace(fileName) - saves the trace into a given disk file.

Also trace is using for “Dump Study” functionality. But if the tracing is switched off then “Dump Study” doesn't saves PARAVIS module state.

SALOME study save

On SALOME study saving PARAVIS module data is also saved in the study. This data is saved in form of ParaView state file. ParaView state file could have references on external files imported during PARAVIS working session. These referenced files can be saved with the current study depending on preference “Paraview state saving type” defined in PARAVIS preferences dialog box. This preference can have three possible state:

  1. “Save referenced files only for built-in server”. In case if this option is active then referenced files will be saved in study together with ParaView state only if in PARAVIS was used built-in ParaView server. In case of remote ParaView server the state will be saved as it is without referenced files.

  2. “Always save referenced files if they are accessible”. In this case referenced files will be saved with ParaView state for any type of ParaView server but only in case if they are accessible across local file system.

  3. “Never save referenced files”. In this case referenced files will be never saved with ParaView state.

It is necessary to be aware that if referenced files are not saved in study then there is no guarantee that the saved study will be opened correctly on other station or if the referenced files will be moved or deleted.

PARAVIS GUI specific

In fact PARAVIS is a ParaView GUI integrated into SALOME environment. General architecture of ParaView is very different from general architecture of SALOME. If SALOME is an application which is able to open several documents (studies) within one application session because it has multi-document architecture, then ParaView has a single document architecture what means that it can have only one document (data structure) opened within one session.

This leads to the fact that PARAVIS module can be opened only once within SALOME application session. It can be opened only in a first desktop appeared after SALOME launch. Other desktops, even they opened with study containing PARAVIS data, can not load PARAVIS module.