upxo.meshing.gbconformant.fm_steel_abaqus.fidelity module

Per-feature fidelity of the mesh to the raw voxel structure.

For every feature of the chosen hierarchy level, the raw voxels and the resolved mesh are measured the same way: volume, boundary area, number of neighbours and aspect ratio. A feature whose volume shrank by more than a limit is flagged. Lengths are in output units.

The voxel boundary area is the area of the stepped voxel faces, which exceeds the area of a smooth surface enclosing the same voxels; the ratio of the two areas is a measure of that, not a defect. Neighbours are features that share a face (a voxel face, or a triangle of the mesh).

upxo.meshing.gbconformant.fm_steel_abaqus.fidelity.voxel_boundaries(labels)[source]

(area_faces, pairs): exposed voxel faces per label (box faces included) and neighbour pair counts.

pairs maps (a, b) with a < b to the number of faces the two labels share. Label 0 is treated as outside every feature.

upxo.meshing.gbconformant.fm_steel_abaqus.fidelity.voxel_aspect(labels, top)[source]
upxo.meshing.gbconformant.fm_steel_abaqus.fidelity.mesh_boundaries(points, tetrahedra, tet_grain)[source]

(area, pairs): boundary area per label (box faces included) and shared area per neighbour pair.

A triangle is a boundary of a feature when the tetrahedra on its two sides carry different labels, or when only one tetrahedron has it (a face of the box). Areas are in mesh coordinates.

upxo.meshing.gbconformant.fm_steel_abaqus.fidelity.mesh_aspect(points, tetrahedra, tet_grain, top)[source]

Aspect ratio of each label from the second moments of its tetrahedra (volume-weighted).

upxo.meshing.gbconformant.fm_steel_abaqus.fidelity.grain_fidelity(hierarchy, points, tetrahedra, tet_grain, settings=None, *, shrink_limit=0.1)[source]

Volume, boundary area, neighbours and aspect ratio of every feature, before and after.

tet_grain is the resolved raw label of each tetrahedron. shrink_limit is the fraction of volume a feature may lose before it is flagged shrunk; a feature with no tetrahedra is lost. Returns {'units', 'columns', 'rows', 'stats', 'shrink_limit', 'flagged', 'lost'}.