I am looking to loop over PartitionedDataSets in a ParatitionedDataSetCollection in paraview.simple. I cannot figure out how. Take the code bellow that uses the example source. How do I get the min and max value of the point variable “Scalars”?
Thanks,
Alexandre
# script-version: 2.0
# Catalyst state generated using paraview version 5.13.3
import paraview
paraview.compatibility.major = 5
paraview.compatibility.minor = 13
#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
# ----------------------------------------------------------------
# setup the data processing pipelines
# ----------------------------------------------------------------
# create a new 'PartitionedDataSetCollection Source'
source = PartitionedDataSetCollectionSource(registrationName='PartitionedDataSetCollectionSource1')
# ----------------------------------------------------------------
# restore active source
SetActiveSource(vTPC1)
# ----------------------------------------------------------------
# ------------------------------------------------------------------------------
# Catalyst options
from paraview import catalyst
options = catalyst.Options()
options.GlobalTrigger = 'Time Step'
options.CatalystLiveTrigger = 'Time Step'
# ------------------------------------------------------------------------------
if __name__ == '__main__':
from paraview.simple import SaveExtractsUsingCatalystOptions
# Code for non in-situ environments; if executing in post-processing
# i.e. non-Catalyst mode, let's generate extracts using Catalyst options
SaveExtractsUsingCatalystOptions(options)
Make sure that this is what you really need because it will bring all the data to the client.
I would recommend to use the datainformation method above or create a programmable filter (which runs on the server so, no data movement) and return only what you need with a table or trivial dataset like IntegrateVariables does.
Does this give the range over all partitions? Because here, we only have one partition, and it is only one level down. What if we have n partitions? What if partitions are nested multiple levels beneath the root node?
It should iterate and give you the actual “global” min/max. The only exception is Catalyst/pvbatsch symmetric where you will get global min/max per rank.
First, you need to call UpdatePipeline() before Getting the information.
Also tracing(Tools>Start Trace) my steps in ParaView I noticed that I had to switch the assembly dropdown to “Hierarchy”. This is the working code