sgio.renumber_elements#

sgio.renumber_elements(mesh) None#

Renumber elements sequentially starting from 1.

Renumbers all element IDs in the mesh to consecutive integers starting from 1, ordered by cell block. Modifies the mesh in-place.

Parameters:

mesh (SGMesh) – Mesh object to renumber. Must have cell_data['element_id'].

Raises:

ValueError – If mesh does not have cell_data or cell_data[‘element_id’].

Examples

>>> mesh = SGMesh(points, cells, cell_data={'element_id': [[10, 20, 30]]})
>>> renumber_elements(mesh)
>>> print(mesh.cell_data['element_id'])
[[1, 2, 3]]