Skip to content

Commit eea31c8

Browse files
authored
Merge pull request #48 from scientificcomputing/dokken/pyvista-second-order
VTK second order cells for pyvista backend
2 parents 27d97a7 + 1329a1d commit eea31c8

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools>=61.0.0", "wheel"]
33

44
[project]
55
name = "io4dolfinx"
6-
version = "1.1.2"
6+
version = "1.2.0"
77
description = "Checkpointing functionality for DOLFINx meshes/functions with ADIOS2"
88
authors = [
99
{ name = "Jørgen S. Dokken", email = "dokken@simula.no" },
@@ -99,7 +99,7 @@ tag = true
9999
sign_tags = false
100100
tag_name = "v{new_version}"
101101
tag_message = "Bump version: {current_version} → {new_version}"
102-
current_version = "1.1.2"
102+
current_version = "1.2.0"
103103

104104

105105
[[tool.bumpversion.files]]

src/io4dolfinx/backends/pyvista/backend.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@
4444
74: "pyramid",
4545
}
4646

47+
_quadratric_vtk = {
48+
21: "interval",
49+
22: "triangle",
50+
23: "quadrilateral",
51+
24: "tetrahedron",
52+
25: "hexahedron",
53+
}
54+
4755

4856
read_mode = ReadMode.serial
4957

@@ -161,9 +169,14 @@ def read_mesh_data(
161169
if (cell_type := cell_types[0]) in _first_order_vtk.keys():
162170
cell_type = _first_order_vtk[cell_type]
163171
order = 1
172+
elif cell_type in _quadratric_vtk.keys():
173+
cell_type = _quadratric_vtk[cell_type]
174+
order = 2
164175
elif cell_type in _arbitrary_lagrange_vtk.keys():
165176
cell_type = _arbitrary_lagrange_vtk[cell_type]
166177
order = _cell_degree(cell_type, cells.shape[1])
178+
else:
179+
raise NotImplementedError(f"Cell type {cell_type} not supported in Pyvista backend.")
167180
perm = dolfinx.cpp.io.perm_vtk(dolfinx.mesh.to_type(cell_type), cells.shape[1])
168181
cells = cells[:, perm]
169182
lvar = int(basix.LagrangeVariant.equispaced)

0 commit comments

Comments
 (0)