How to set DATA_TIME_STEPS when using .series file and TemporalParticlesToPathlines

Hello,

I have a data set of points over time, and would like to plot them as pathlines using the TemporalParticlesToPathlines. When I do so, I get the error message:

> ERROR: In /Users/kitware/dashboards/buildbot-slave/8275bd07/build/superbuild/paraview/src/VTK/Filters/General/vtkTemporalPathLineFilter.cxx, line 338
vtkTemporalPathLineFilter (0x7fa189d091f0): The input dataset did not have a valid DATA_TIME_STEPS information key

How would I set the variable DATA_TIME_STEPS? I’m using the gui, not a script, at the moment.

The data are output as silo files, and I read them with a .series file, as described on the forum here. Paraview correctly plots their positions as points at any given time step, and If I add an “AnnotateTimeFilter” the current time of the simulation is displayed.

Thank you,
Alex

I think this is an internal VTK error so make sure you are loading a temporal file series.

Dear Yoshino, I have created a .series file, and believe this turns it into a temporal file series, though I’m not sure precisely what that means internally in terms of data structures. Time is specified for each frame from in the .series, and the time is correctly plotted, so paraview does know what time corresponds to what frame. Additionally I do not have vtk data, so am not sure what I would do to the silo data to make it interact better with whatever vtk functions are under the hood.

Is there a way to manually specify the physical time between frames in the GUI? Perhaps that would help.

Thank you,

I have partially fixed this by converting the silo files to vtu files using visit. Now, the particles plot but time is not correctly set, the timestep has become 1.0, likely a default value.

For an arbitrary dataset then, is there a way to specify its physical time or the timestep between frames?

Did you mean to organize file series chronologically? Paraview manages that by the file name suffix.

No, the files are organized correctly.

What I mean is to add time data, the physical time that this step corresponds to, to each step. So step 0 is t=0s, step 1 is t=0.01, and so forth. This is so the time is read correctly by AnnotateTimeFilter.

After some experiments with various formats, I have found a solution that seems to work.

  1. Export .silo files with Visit to vtu. This produces a file for each step that Paraview can read and produce pathlines from without any difficulty.
  2. Write a .pvd file to list the time information, as described at the bottom of this page, and open the .pvd file so Paraview reads with the time information.

The pvd format was more effective than the .series format for my use case, as it also allowed me to re-combine domains that had been decomposed by my solver.

Dear kaiser
I have also encountered this problem. Could you tell me more about “write A. PVD file to list the time information”? Should I just create a. PVD file? Copy content from “Page”?

Thank you,

Yes, the pvd is a plain text file formatted as the example. I imagine there are many ways to write such an xml file, but I copied the header and overall format and wrote a short python function to output it as plain text. Quick and effective, if not the most direct since I’m not using an xml library. Code for the function is below.

def write_pvd(basename, dt, nsteps, extension, nprocs_sim=1):

    prefix = '''<?xml version="1.0"?>
    <VTKFile type="Collection" version="0.1"
             byte_order="LittleEndian"
             compressor="vtkZLibDataCompressor">
      <Collection>
    '''

    suffix = '''  </Collection>
    </VTKFile>
    '''

    initialized = False

    for n in range(nsteps):
        for proc in range(nprocs_sim):

            if not initialized:

                filename_out = basename + '.pvd'
                print("filename_out = ", filename_out)

                f_write = open(filename_out, 'w')
                f_write.write(prefix)
                initialized = True

            tmp_str = '    <DataSet timestep="'
            tmp_str += '{:.14f}'.format(dt * n)
            tmp_str += '" group="" part="'
            tmp_str += str(proc) + '"'

            tmp_str += ' file="'
            if nprocs_sim > 1:
                tmp_str += basename + str(n).zfill(4) + '/' # sorted into directories 
            tmp_str += basename + str(n).zfill(4) + '.' 
            if nprocs_sim > 1:
                tmp_str += str(proc) + '.'        
            tmp_str += extension
            tmp_str += '"/>\n'

            f_write.write(tmp_str)

    f_write.write(suffix)
    f_write.close()

Thank you for your quick reply, which is very helpful to me. I will try it as you said.