JuliaVTK / WriteVTK.jl

Julia package for writing VTK XML files
Other
151 stars 32 forks source link

Support point, cell, and field data attributes #111

Closed lcw closed 1 year ago

lcw commented 1 year ago

This allows adding arbitrary attributes to point, cell, and field dataset types.

With these changes a "HigherOrderDegrees" dataset and cell dataset type attribute can now be added with

vtk = vtk_grid(...)
vtk["HigherOrderDegrees", VTKCellData()] = [2;3;12]
vtk[VTKCellData()] = Dict("HigherOrderDegrees"=>"HigherOrderDegrees")

which is required for setting direction dependent degrees for VTKCellTypes.VTK_LAGRANGE_QUADRILATERAL cells. For reference see https://gitlab.kitware.com/paraview/paraview/-/issues/21550.

The point, cell, and field dataset type attributes are copied from the vtk file into the associated pvtk file.

jipolanco commented 1 year ago

This looks great, thanks. Right now I can't look at the details, but I should be able to merge this some time next week.

codecov-commenter commented 1 year ago

Codecov Report

Merging #111 (f25928e) into master (d82297a) will decrease coverage by 0.25%. The diff coverage is 85.71%.

@@            Coverage Diff             @@
##           master     #111      +/-   ##
==========================================
- Coverage   96.27%   96.02%   -0.26%     
==========================================
  Files          17       17              
  Lines         860      881      +21     
==========================================
+ Hits          828      846      +18     
- Misses         32       35       +3     
Impacted Files Coverage Δ
src/gridtypes/pvtk_grid.jl 97.94% <75.00%> (-1.34%) :arrow_down:
src/write_data.jl 96.19% <92.30%> (-0.30%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

jipolanco commented 1 year ago

Thanks a lot!