Skip to content

Cell Types ​

meshio++ uses its own canonical type names. Every format reader maps native element names to these; every writer maps them back.

Node ordering follows the VTK convention where available. The figures below are generated from the code's own topology tables (_convert_cells._ELEVATE for mid-edge nodes, _skin._CELL_FACES and _refine_templates.QUAD_FACES for face and body centres), so they cannot drift from what the readers, writers and operations actually assume; corner nodes are drawn solid, mid-edge nodes blue, face centres orange and the body centre violet. One convention is worth stating: pyramid14 is pyramid13 plus a base-centre node 13, the order every consumer in the core (detail/cell_faces.hpp, the CGNS table) uses; the gmsh reader/writer permutes both pyramid14 and wedge18 (gmsh's own edge-lexicographic types 14 and 13) to and from this convention, derived from gmsh's own edge/face tables and verified geometrically (every mid-edge/face-centre node lands at the exact midpoint/centroid of the corners it should).

0-D ​

TypeNodes
vertex1

1-D (line elements) ​

Node ordering of vertex, line and line3

TypeNodesDescription
line2Linear line
line33Quadratic line
line44Cubic line
line55Quartic line
line66
line77
line88
line99
line1010
line1111

2-D surface elements ​

Triangles ​

Node ordering of triangle and triangle6

TypeNodes
triangle3
triangle66
triangle77 (triangle6 plus a centre node, VTK 34; Code_Aster TRIA7, MED TR7)
triangle1010
triangle1515
triangle2121
triangle2828
triangle3636
triangle4545
triangle5555
triangle6666

Quadrilaterals ​

Node ordering of quad, quad8 and quad9

TypeNodes
quad4
quad88
quad99
quad1616
quad2525
quad3636
quad4949
quad6464
quad8181
quad100100
quad121121

Arbitrary polygons ​

TypeNodes
polygonvariable

For polygon cells, all cells within a CellBlock must have the same number of nodes (the array shape determines this). Multiple CellBlock entries with type polygon but different node counts are permitted.

3-D volume elements ​

Tetrahedra ​

Node ordering of tetra and tetra10

TypeNodes
tetra4
tetra1010
tetra2020
tetra3535
tetra5656
tetra8484
tetra120120
tetra165165
tetra220220
tetra286286

Hexahedra ​

Node ordering of hexahedron, hexahedron20, hexahedron24 and hexahedron27

TypeNodes
hexahedron8
hexahedron2020
hexahedron2424
hexahedron2727
hexahedron6464
hexahedron125125
hexahedron216216
hexahedron343343
hexahedron512512
hexahedron729729
hexahedron10001000
hexahedron13311331

Wedges (prisms) ​

Node ordering of wedge, wedge15 and wedge18

TypeNodes
wedge6
wedge1515
wedge1818
wedge4040
wedge7575
wedge126126
wedge196196
wedge288288
wedge405405
wedge550550

Pyramids ​

Node ordering of pyramid, pyramid13 and pyramid14

TypeNodes
pyramid5
pyramid1313
pyramid1414

Arbitrary polyhedra ​

TypeDescription
polyhedron4Tetrahedron as polyhedron
polyhedron5Pyramid as polyhedron
polyhedronnNN-faced polyhedron

Polyhedron cells store their face connectivity as a list of lists (ragged), not a rectangular numpy array. The type name encodes the number of faces: polyhedron4 has 4 faces.

VTK Lagrange types ​

Higher-order VTK Lagrange elements (arbitrary polynomial order, controlled at runtime):

Type
VTK_LAGRANGE_CURVE
VTK_LAGRANGE_TRIANGLE
VTK_LAGRANGE_QUADRILATERAL
VTK_LAGRANGE_TETRAHEDRON
VTK_LAGRANGE_HEXAHEDRON
VTK_LAGRANGE_WEDGE
VTK_LAGRANGE_PYRAMID

These are read and written by the VTK/VTU readers/writers, and read and written by the MFEM reader and writer for meshes and fields of order 3 and up (v16.11.0; VTK_LAGRANGE_PYRAMID excepted). They are ragged blocks: the node count follows from the order, which is not stored in the type.

VTK Bézier types ​

VTK's rational Bézier elements (since v16.40.0), the same seven shapes:

Type
VTK_BEZIER_CURVE
VTK_BEZIER_TRIANGLE
VTK_BEZIER_QUADRILATERAL
VTK_BEZIER_TETRAHEDRON
VTK_BEZIER_HEXAHEDRON
VTK_BEZIER_WEDGE
VTK_BEZIER_PYRAMID

A Bézier cell lists its control points in the node order of the Lagrange cell of the same shape and degree, so it is a ragged block in the same way; but only its corners lie on the geometry, so operations do not treat it as a Lagrange cell, and drawing it (render) goes through its corners. VTK/VTU, VTKHDF and the legacy VTK format read and write them; a VTU's rational weights and per-cell degrees travel as the RationalWeights point data and the HigherOrderDegrees cell data (VTU).

Released under the MIT License.