Cannot replace __CatalystChannel__ field data in all Catalyst output
When Catalyst writes out files, it includes a field data called __CatalystChannel__
. Whenever Paraview loads a file with this field data, the name of the data in the Pipeline Browser will be set to the value of __CatalystChannel__
. For example, the default channel name in Catalyst is input
, so if a VTK file having this field data is loaded, its name will be set to input
in the Pipeline Browser.
Instead, I would like files written by Catalyst to be named by their problem name when loaded in Paraview. To do this, I tried modifying the Catalyst script so it overwrites the __CatalystChannel__
field data with the problem name. Below is some example code doing this:
title = 'my_custom_channel_name'
arr = grid.GetFieldData().GetAbstractArray("__CatalystChannel__");
arr.SetValue(0, title)
The problem is that this works for only the first timestep that Catalyst writes. After the first timestep, all subsequent timesteps will have __CatalystChannel__
= input
. If you load the entire timestep series in Paraview, this is generally ok. The issue is when Paraview is already set to another timestep after timestep 0 when the data is loaded, then the Pipeline Browser will say input
. Or if only one timestep is loaded other than timestep 0, then it will say input
.
To reproduce, I have uploaded two scripts, wavelet_miniapp.py
and catalyst_script.py
.
wavelet_miniapp.py catalyst_script.py
To run:
pvpython wavelet_miniapp.py -t 5 -s catalyst_script.py
The output will be five wavelet timesteps. If you individually load the first timestep, the Pipeline Browser will say 'my_custom_channel_name'. If you load any other timestep, the Pipeline Browser will say input
.
Is there some way to have all timesteps have the value of __CatalystChannel__
that I want? I'm also open to other approaches to get the Pipeline Browser to automatically name the loaded dataset by the problem name.