Does anyone have a satisfactory solution to consistently grouping plotfiles in paraview?
I am aware of @jmusser 's post on this from six years ago, but assume/hope this is no longer the best approach. Visualization of time series with Paraview · Issue #496 · AMReX-Codes/amrex
I also haven’t had any luck creating .series files Amrvis — amrex 25.06-dev documentation.
Let’s assume you have 10 plot files (plt00000, plt00100, … plt00900).
Start by loading the plt00000 plot file in ParaView and setup your scene. Next you have to manually setup the animation time series (View → Animation View).
Setup the end time to be the number of steps-1, and the number of frames to be the number of steps. Using the above example, these are 9 and 10.
Add a Python track and double-click to bring up the text editor.
Below is an example script with some comments. You’ll need modify it to account for your plot file base (here it’s plt) and the path to the directory containing the plot file directories.
from paraview.simple import *
def start_cue(self):
# Modules used
import os, glob
# Make these global so that the tick() function can access them
global reader, filenames
# Find the reader object. Match the name in the pipeline browser
reader = FindSource("plt00000")
# Go to the directory where the plt files are. Adjust as needed
os.chdir("/nfs/scr/1/jmusser/asure-reactor/runs/2024/1204/new/Plot_Files")
# Get the names of all plt files and sort them.
# Make sure nothing else start with plt in that dir
#filenames = sorted(glob.glob("plt*"), key=len)
reader.FileNames = sorted(glob.glob("plt*"), key=len)
def tick(self):
# Clock time will be a float matching
# the time displayed in the animation bar
reader.UpdatePipeline(time=self.GetClockTime())
def end_cue(self): pass