upxo.meshing.gbconformant.fm_steel_abaqus.audit module

Reports on how cleaning and meshing changed feature ownership.

reallocation_report compares the raw label array with the cleaned labels that were meshed. location_audit looks up the raw voxel under every tetrahedron centroid and compares it with the identity the tetrahedron was given; it stops the export when a grain’s tetrahedra mostly lie over raw features that are not part of that grain’s merge history.

exception upxo.meshing.gbconformant.fm_steel_abaqus.audit.IdentityError[source]

Bases: RuntimeError

A grain’s tetrahedra do not lie over any of its own raw features.

upxo.meshing.gbconformant.fm_steel_abaqus.audit.reallocation_report(raw_labels, meshed_labels, identity, hierarchy)[source]

Voxel ownership change between the raw labels and the meshed labels.

meshed_labels is the cleaned label array in pipeline labels (before any upscaling), the same array the grain surfaces were extracted from.

upxo.meshing.gbconformant.fm_steel_abaqus.audit.location_audit(points, tetrahedra, tet_grain, identity, hierarchy, mesh_voxel_length=1.0, chunk=500000)[source]

Compare each tetrahedron’s identity with the raw voxel under its centroid.

mesh_voxel_length is the length of one raw voxel in mesh coordinates. Smoothing and cleaning legitimately move boundaries, so a mismatch fraction is reported per feature; only a grain whose volume lies mostly over raw features outside its own merge history raises IdentityError.