Skip to content

In situ postprocessing with ParaView Catalyst

Yvan Fournier edited this page Jul 19, 2021 · 3 revisions

code_saturne can generate postprocessing output directly with ParaView Catalyst, provided support for this tool is specified at build time (see installation documentation).

Basic principles

To define in-situ postprocessing output, the following steps are required:

  • produce an initial output using a post-hoc output format (EnSight, MED, or CGNS)
  • define your visualization in ParaView
  • export a catalyst Python script from ParaView
    • modify that script if necessary or desired
  • copy the script to a case's DATA directory
  • define an output writer using the "catalyst" format (or change the format of an existing one)
  • run the computation

Detailed steps

ParaView 5.9 or later

  1. Under ParaView, after loading the input file, it is recommended to rename the input node in the pipeline, to use the name that will be chosen for the catalyst output writer.

  2. Under ParaView, use Extractors to define data or images to extract.

  3. Under ParaView, use File -> Save Catalyst State to generate a Python co-processing script.

  4. Copy or move the exported script to the case's DATA directory.

  5. In code_saturne, define a writer with a name matching the ParaView input's name, and associate the same meshes as were associated with the writer used for initial output.

ParaView 5.5 to 5.8

  1. Under ParaView, after loading the input file, it is recommended to rename the input node in the pipeline, to use the name that will be chosen for the catalyst output writer.

Renaming the Input

  1. Under ParaView, use Catalyst -> Define Exports and select data or images to extract.

Note that the exports definition dialog often takes up quite a bit of vertical space in the ParaView GUI, but rather than closing it, it can be moved to a tab along with the Information and Properties tabs.

Defining Exports

To avoid generating all images or extract outputs directly in the execution directory, is is possible to add a prefix such as postprocessing to the file names in the exports definition. The generated scripts also allows defining a root path for outputs. Whichever solution is chosen, the directory must exist or be created when the code runs.

  1. Under ParaView, export state.

Catalyst Script Export

  1. Copy or move the exported script to the case's DATA directory.

  2. In code_saturne, define a writer with a name matching the ParaView input's name (here code_saturne_writer_name), and associate the same meshes as were associated with the writer used for initial output.

Adding a  Catalyst Output Writer

Associating Meshes to a Writer

Remarks

  • we generally use a full ParaView build for Catalyst output. If using lighter Catalyst editions, filters defined in the script but not available in the given edition will fail.

  • multiple scripts may be used. When running, code_saturne checks all Python files in its execution directory (i.e. all Python files copied from the case's DATA directory), and tries to use them with Catalyst writers. The script names are not important (only the names of the inputs must match the writer names).

Troubleshooting

  • If you encounter issues due to missing dynamic libraries, make sure the code_saturne.cfg (post-install configuration) sources a file exporting the required library paths, or add the matching paths to LD_LIBRARY_PATH in your run script.

  • If the script fails due to unknown attributes in the Python script, it is probably due to the fact that plugins were loaded when generating the script, and are not loaded in the Catalyst install

    • In most cases (if the plugins were only loaded, not used in the visualization pipeline), the lines causing the error may simply be removed from the script.
    • An alternative is to force the loading of the scripts using PV_PLUGIN_PATH. Setting that path to the ParaView install's library path will load all plugins (using more memory but avoiding this type of issue).

If running under SALOME desktop

Note that if using PARAVIS under the Salome platform, the trace must be deactivated under Salome File->Preferences, to avoid conflicts with the catalyst export script generation, which uses the same underlying mechanism:

Deactivating the trace under SALOME