SU2#

.su2 read + write eager

Summary of the specification#

The SU2 native mesh is plain ASCII, keyed by uppercase tokens on their own lines. NDIME= gives the dimension, NELEM= precedes the volume element list — one line per element: a VTK element type code, its node indices, then the element index — and NPOIN= precedes the coordinates. Boundaries are declared per marker: NMARK= counts them, then each MARKER_TAG= names one and MARKER_ELEMS= lists its surface elements in the same code-then-nodes form.

Specification at a glance#

dimension

NDIME= 2 or 3

elements

NELEM= then <vtk_type> <nodes…> <index>

type codes

3 line, 5 triangle, 9 quad, 10 tetra, 12 hexa, 13 prism, 14 pyramid

points

NPOIN= then coordinates, one point per line

boundaries

NMARK=, MARKER_TAG=<name>, MARKER_ELEMS=<n>

Reading#

import polyxios as px

mesh = px.read("model.su2")
mesh.vertices          # (n, 3)
mesh.element_types     # element groups found in the file

Writing#

px.write(mesh, "out.su2")

This codec takes no format-specific options.

Quirks worth knowing#

  • Boundary marker names become element tags, so named inlets, outlets and walls survive a round trip.

  • 2D meshes are padded to z = 0 so the vertex array is always (n, 3).

  • The trailing per-element index is read but not trusted for ordering; elements keep file order.

See also

Supported formats — the full format table.