Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hex27 VTK export #714

Merged
merged 1 commit into from
Jul 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/Export/VTK.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,41 @@ cell_to_vtkcell(::Type{SerendipityQuadraticQuadrilateral}) = VTKCellTypes.VTK_QU

cell_to_vtkcell(::Type{Hexahedron}) = VTKCellTypes.VTK_HEXAHEDRON
cell_to_vtkcell(::Type{SerendipityQuadraticHexahedron}) = VTKCellTypes.VTK_QUADRATIC_HEXAHEDRON
cell_to_vtkcell(::Type{QuadraticHexahedron}) = VTKCellTypes.VTK_TRIQUADRATIC_HEXAHEDRON
cell_to_vtkcell(::Type{Tetrahedron}) = VTKCellTypes.VTK_TETRA
cell_to_vtkcell(::Type{QuadraticTetrahedron}) = VTKCellTypes.VTK_QUADRATIC_TETRA
cell_to_vtkcell(::Type{Wedge}) = VTKCellTypes.VTK_WEDGE

nodes_to_vtkorder(cell::AbstractCell) = collect(cell.nodes)
nodes_to_vtkorder(cell::QuadraticHexahedron) = [
cell.nodes[1], # faces
cell.nodes[2],
cell.nodes[3],
cell.nodes[4],
cell.nodes[5],
cell.nodes[6],
cell.nodes[7],
cell.nodes[8],
cell.nodes[9], # edges
cell.nodes[10],
cell.nodes[11],
cell.nodes[12],
cell.nodes[13],
cell.nodes[14],
cell.nodes[15],
cell.nodes[16],
cell.nodes[17],
cell.nodes[18],
cell.nodes[19],
cell.nodes[20],
cell.nodes[25], # faces
cell.nodes[23],
cell.nodes[22],
cell.nodes[24],
cell.nodes[21],
cell.nodes[26],
fredrikekre marked this conversation as resolved.
Show resolved Hide resolved
cell.nodes[27], # interior
]

"""
vtk_grid(filename::AbstractString, grid::Grid; kwargs...)
Expand Down