Support for VTKHDF Time Series data format#130
Support for VTKHDF Time Series data format#130lucasbanting wants to merge 4 commits intoJuliaVTK:masterfrom
Conversation
…or each time step
|
Thank you for this! I think we can figure out later how to move things to a package extension. So I first tried to generate a file and open it in ParaView. For that I wrote this minimum example based on the code you provided: using WriteVTK
N = 10
points = rand(3, N)
cells = [
MeshCell(VTKCellTypes.VTK_POLY_LINE, 1:5),
MeshCell(VTKCellTypes.VTK_POLY_LINE, 6:10),
]
dataset = vtk_grid(VTKHDF5(), "fields", points, cells)
E_data = vtkhdf_open_timeseries(dataset, "E", VTKCellData(), 3)
times = 0:0.1:2
for t in times
# update cell_data for time t
cell_data = rand(3, 2)
# store data in vtkhdf file
vtkhdf_append_timeseries_dataset(E_data, t, cell_data)
end
close(dataset)With this I was able to generate a file, but ParaView complained because "File version: 2.0 is higher than this reader supports 1.0" (also, ParaView seems to prefer the |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #130 +/- ##
===========================================
- Coverage 96.63% 85.07% -11.56%
===========================================
Files 15 17 +2
Lines 832 945 +113
===========================================
Hits 804 804
- Misses 28 141 +113 ☔ View full report in Codecov by Sentry. |
|
I think Paraview 5.12 is required for the time varying VTKHDF format, but 5.11 can handle the static VTKHDF format. What you might be seeing is paraview 5.11 isn't reading the Steps group, so you just get a static dataset. The VTKHDF format is defined here: https://docs.vtk.org/en/latest/design_documents/VTKFileFormats.html#hdf-file-formats |
Reference issue: #125
This PR is a draft as the code is in a rough shape compared to the rest of the WriteVTK library.
My implementations works in the following way:
This procedure creates a file "field.vtkhdf", that has a time varying dataset "E" that stores CellData of vectors of dimension 3.
I started creating a package extension to move my code into, but couldn't get the package extension to build.
I would appreciate feedback on the functions and structs I have used, and how they can be changed to better align with this library.