Can I load one file sequences from separate folders?

We have a network file system where the maximum number of files per folder is quite limited so we have to do things like this:
folder1: result0.vtp - result100.vtp
folder2: result101.vtp - result200.vtp

My current quick and dirty solution is to create a folder where the number of files is unlimited and create symlinks to all result*.vtp files so Paraview can load all of them at once.

My questions are:
Can I load these files into one file sequence through the paraview GUI? It seems that only sequences within one folder is supported.

Can I load these files into one file sequence through the python interface?

Thanks!

I don’t think there is any direct way to get the GUI to load all those files at once. However, you should be able to do it through the Python interface.

The Python command to open a vtp file is XMLUnstructuredGridReader. If you set the FileName argument to a list of files, that list of files will be treated as a time sequence of files. So the relevant Python would look something like this.

result = XMLUnstructuredGridReader(FileName=[
    '/path/to/folder1/result0.vtp',
    '/path/to/folder1/result2.vtp',
    '/path/to/folder1/result3.vtp',
    # ...
    '/path/to/folder2/result101.vtp',
    '/path/to/folder2/result102.vtp',
    '/path/to/folder2/result103.vtp',
    # ...
])

An alternate approach is to create a pvd file that points to all the files that you created. It would look something like this.

<VTKFile type="Collection" version="1.0" byte_order="LittleEndian" header_type="UInt64">
  <Collection>
    <DataSet timestep="0" part="0" file="folder1/result0.vtp"/>
    <DataSet timestep="1" part="0" file="folder1/result1.vtp"/>
    <DataSet timestep="2" part="0" file="folder1/result2.vtp"/>
    <!-- ... -->
    <DataSet timestep="101" part="0" file="folder2/result101.vtp"/>
    <DataSet timestep="102" part="0" file="folder2/result102.vtp"/>
    <DataSet timestep="103" part="0" file="folder2/result103.vtp"/>
    <!-- ... -->
  </Collection>
</VTKFile>

That solution is not any more elegant than using ln -s, but at least it won’t break on your file system.

2 Likes

Thank you! This solves my problem.