Time in VTK files
Dear DualSPHysics users and developers,
I am running a case with multiple file saving times therefore it is important to be able to have the time in the vtk files for post-processing purposes. I couldn't find an option to save the Part Time neither by using the PartVTK4 or by having DualSPHysics save VTK files in addition to binary files.
I checked out the "ToVTK4" source file included in the beta distribution and there doesn't seem to be a straight-forward way to do it.
I would appreciate any help or suggestions anyone might have.
Thanks and regards,
Jabir
I am running a case with multiple file saving times therefore it is important to be able to have the time in the vtk files for post-processing purposes. I couldn't find an option to save the Part Time neither by using the PartVTK4 or by having DualSPHysics save VTK files in addition to binary files.
I checked out the "ToVTK4" source file included in the beta distribution and there doesn't seem to be a straight-forward way to do it.
I would appreciate any help or suggestions anyone might have.
Thanks and regards,
Jabir
Comments
let us check this in case there is a bug
Regards
Thanks for your reply, but that field in the VTK files is the same as the part number, or number of file and not proper time. I tried adding it as a variable like the example mentioned in the documentation but unfortunately it was added to each particle, which increasaed the size of vtk files by about 20% (even though I assigned a singular value to be written, and not an array).
Regards
please can you email us with your XML and script to dualsphysics@gmail.com and we will check it ASAP
PartVTK with -savecsv creates a CSV file where the time is CORRECT (try it)
Using option -savestatscsv it creates a CSV where time is also CORRECT
In ToVTK4: code line 139 of main.cpp
you can see how the variable with time "timestep" is properly loaded:
if(!cp)timestep=pd.Get_TimeStep();
If you want that VTK files gives you the time, that is not possible since that info is not available in those VTK files.
In fact, we believe that VTK format can not include that. More info here:
https://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf
Regards
Many thanks for your reply.
Actually, time data can be included in VTK files as part of the "Field Data" and it is the case with some CFD codes.
However, I have found the following work-around by saving the data from ParaView as VTU files, then editing the values of the Time Field in the ASCII PVD file generated with the VTU files, which will result in displaying the correct time in ParaView for each file. This feature also allows compressing the legacy VTK files generated by DualSPHysics and saving space, although a bit time consuming.
Best regards,
Jabir
We will follow your suggestion
Regards