Skip to content

Commit

Permalink
Merge pull request #56 from chmerdon/master
Browse files Browse the repository at this point in the history
allow to change the append and compress argument of vtk_grid in writeVTK
  • Loading branch information
j-fu authored Sep 27, 2024
2 parents abd6ee2 + 807f9d4 commit f84e164
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ exports grid and optional provided data as a vtk file
- `grid`: grid
Each '(key, value)' pair adds another data entry to the vtk file via WriteVTK functionality.
For the arguments 'append' and 'compress', see documentation of vtk_grid of WriteVTK.
"""
function writeVTK(filename::String, grid::ExtendableGrid{Tc, Ti}; kwargs...) where {Tc, Ti}
function writeVTK(filename::String, grid::ExtendableGrid{Tc, Ti}; append = false, compress = false, kwargs...) where {Tc, Ti}
ncells = num_cells(grid) # get number of cells in grid
coords = grid[Coordinates] # get coordinates
cells = grid[CellNodes] # get cell-node list
Expand All @@ -31,7 +33,7 @@ function writeVTK(filename::String, grid::ExtendableGrid{Tc, Ti}; kwargs...) whe
vtk_cells[icell] = MeshCell(VTKCellType(cell_geo[icell]), view(cells, :, icell))
end

vtk_grid(filename, coords, vtk_cells) do vtk
vtk_grid(filename, coords, vtk_cells, append = append, compress = compress) do vtk
for (key, value) in kwargs
vtk[String(key)] = value
end
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ end
sha256(f)
end |> bytes2hex

@test sha_code == "f7e86e426aa6673699bd470f6db328a177eabdee74c71cfa6a855a2507b4f1bb"
@test sha_code == "9596c59f6b0870dd4a42a7a48725c2257f260757e15cc5ac433e5e8e235659d9"
end


Expand Down

0 comments on commit f84e164

Please sign in to comment.