Tip Build A Paraview3 Plugin

From OpenFOAMWiki
Revision as of 22:12, 30 May 2007 by Bgschaid (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

In current Versions of Paraview3 there is no support for OpenFOAM (although the VTK can read OF-Files). To add that:

  1. Download Paraview3-Sources and compile them (that's the hard part)
  • Create a directory (OFPlugin or so). In that directory add the files
    • CMakeLists.txt:
FIND_PACKAGE(ParaView REQUIRED)
INCLUDE(${PARAVIEW_USE_FILE})
ADD_PARAVIEW_PLUGIN(OpenFOAMGUIPlugin "1.0" 
                    GUI_RESOURCES foamReader.qrc )
    • foamReader.qrc:
 
<RCC>
    <qresource prefix="/ParaViewResources" >
        <file>foamReader.xml</file>
    </qresource>
</RCC>
    • foamReader.xml:
 
<ParaViewReaders>
  <Reader name="OpenFOAMReader"
          extensions="controlDict foam"
          file_description="OpenFOAM Files">
  </Reader>
</ParaViewReaders>
  • In that directory do
ccmake .
  • Specify the path where you compiled paraview and generate the Makefiles
  • A simple make should produce a dynamic library (the Plugin)

Now to use that plugin:

  • start paraview
  • go to the Tools-Menu - Plugin Manager
  • Load the dynamic library you generated as a Client-Plugin
  • now the file open-Dialog knows about OpenFOAM (the file to "open" is the controlDict)

Notes:

  • Caution: currently the Reader can't deal with gzipped files. Make sure everything in your cases is unzipped. Otherwise paraview might hang (and crash) while opening the case
  • The good people of Kitware intend to enable the OF-Reader by default (then all this won't be necessary)