Install Parallelized Native OpenFOAM® Reader for ParaView on Ubuntu 9.10 

General description and information about the installation can be found on the OpenFOAM® wiki page. This description considers a working OpenFOAM® installation on a properly working Ubuntu-9.10 system.

Why to use this plugin?

The author lists many arguments on the readers wiki page. What was the most important for me is the support of parallel reading of decomposed cases.

Prequisites:

  • libphonon-dev
  • libphonon4
  • libqt4-assistant
  • qt4-dev-tools
  • libqt4-core
  • libqt4-gui
  • qt4-qmake
  • libxt-dev
  • g++
  • gcc
  • cmake-curses-gui
  • libqt4-opengl-dev
  • openmpi-common
  • openmpi-bin
  • libopenmpi-dev
  • python2.5-dev

Download Qt sources

In order to get use of the MPI capabilities of ParaView one has to re-build ParaView with MPI support. This can be easilly done with the OpenFOAM® package as the sources can be found in the ThirdParty-<OF version> directory (e.g. /home/<user>/OpenFOAM/ThirdParty-1.6). One has to download the Qt 4.3.5 sources as it is needed for building ParaView. This Qt version can be downloaded from here.

The downloaded .tar should be extracted and the resulting directory should be moved to the ThirdParty-<OF version> directory. The following commands can be used:

cd $WM_THIRD_PARTY_DIR
mv $ParaView_DIR ${ParaView_DIR}.orig
./makeParaView -mpi

, where $WM_THIRD_PARTY_DIR is e.g. /home/<user>/OpenFOAM/ThirdParty-1.6 . The original ParaView directory (e.g. paraview-3.6.1) is moved to paraview-3.6.1.orig. (Note that the variables above - e.g. $WM_THIRD_PARTY_DIR - are defined in the /home/<user>/OpenFOAM/OpenFOAM-1.6/etc/bashrc file. This file is should be sourced in the users /home/<user>/.bashrc file - considering a working OpenFOAM® installation this is done already. If not then you can find information here under "Installation".

Download and install the reader plugin

Go to the paraview plugins directory:

cd /home/<user>/OpenFOAM/ThirdParty-1.6/paraview-3.6.1/Plugins

The reader can be downloaded with the following command:

svn co https://of-interfaces.svn.sourceforge.net/svnroot/of-interfaces/trunk/vtkPOpenFOAMReader

After execution a new directory is created containing the source files (vtkPOpenFOAMReader-xxx). Go to the plugin source directory (my example):

cd vtkPOpenFOAMReader-r173-20090920

and install the plugin with cmake:

ccmake .

Set the followings:

CMAKE_BUILD_TYPE Release
CMAKE_INSTALL_PREFIX /home/<user>/OpenFOAM/ThirdParty-1.6/paraview-3.6.1/platforms/linuxGcc/bin/plugins
ParaView_DIR /home/<user>/OpenFOAM/ThirdParty-1.6/paraview-3.6.1/platforms/linuxGcc

Then install the plugins:

make
make install

Copy the GUI component files to the ParaView directories:

cp GPL/pqPOpenFOAMPanel.cxx ../../Qt/Components/
cp GPL/pqPOpenFOAMPanel.h ../../Qt/Components/

Edit the CMakeLists.txt file in the /home/<user>/OpenFOAM/ThirdParty-1.6/paraview-3.6.1/Qt/Components directory:

gedit /home/<user>/OpenFOAM/ThirdParty-1.6/paraview-3.6.1/Qt/Components/CMakeLists.txt

Insert pqPOpenFOAMPanel.h to line 158, pqPOpenFOAMPanel.cxx to line 580 and pqPOpenFOAMPanel.h to line 581 (the same is described in /home/bence/OpenFOAM/ThirdParty-1.6/paraview-3.6.1/Plugins/vtkPOpenFOAMReader-r173-20090920/GPL/3.6.1/CMakeLists.txt.diff).