FluidNumerics / SELF

Spectral Element Library in Fortran
BSD 3-Clause "New" or "Revised" License
64 stars 7 forks source link

Trailing zeros in the names of output files #36

Open siddharthabishnu opened 2 years ago

siddharthabishnu commented 2 years ago

Visualization softwares like VisIt or Paraview do not load the output files in the correct order if there are trailing zeros in the file names. Since the timestamp in the output files of SELF are formatted as DDDDHHMMSSmmm (0-padded day, hour, minute, second, millisecond), any output interval being an integral number of seconds will result in this issue. To eliminate the trailing zeros, one can either modify the relevant lines of code specifying the output file names in SELF, or rename the output files during post-processing (e.g. by using a bash script) before loading these files in VisIt or Paraview for visualization.

fluidnumerics-joe commented 2 years ago

Thanks @siddharthabishnu for opening this issue. I think that changing the file names in SELF to have a zero padded "file counter", rather than the timestamp, would be better. To keep track of time, in the tecplot files, I think we can add SOLUTIONTIME to the header for each zone.

In the HDF5 files, we can also do something similar, and add a simulation time attribute to each file.

siddharthabishnu commented 2 years ago

@fluidnumerics-joe, I do believe that will take care of the issue. In my codes, I typically name the output files to contain the time step counter formatted in Fortran as Ix.x where x is the number of digits being padded (only) with leading zeros, instead of the timestamp, and since it's always in ascending order, I have never encountered this issue. But then again, I do not provide the simulation time, like you have been doing. But as long as you do it somewhere e.g. in the header of the output files, it's good enough.