upxo.meshing.gbconformant.fm_steel_abaqus.snapshots module

The grain structure measured the same way at several points of the pipeline.

A Snapshot holds, for one representation of the structure, everything the before/after comparison needs: the grains present (raw feature labels), their volume and aspect ratio when the representation encloses them, the area shared by every pair of neighbouring grains with its misorientation, the junction lines and the volume of the box. Five representations can be measured:

  • voxels: the voxel structure of the chosen hierarchy level,

  • surface_raw: the grain boundary surface as first extracted from the voxels, before smoothing,

  • surface_smoothed: the same surface after smoothing,

  • surface_prepared: the closed, remeshed surface handed to the tetrahedral mesher,

  • tets: the tetrahedral mesh.

The two open surfaces hold the interior grain boundaries only, so they have no grain volume. Areas are those of the interior grain boundaries (the faces of the box are not counted), the same for every representation. Lengths are in output units, as in comparison.

upxo.meshing.gbconformant.fm_steel_abaqus.snapshots.key_of_title(title: str) → str[source]

The snapshot key of a title (or of a key).

class upxo.meshing.gbconformant.fm_steel_abaqus.snapshots.Snapshot(key: str, title: str, units: str, labels: ndarray, pair_labels: ndarray, pair_area: ndarray, pair_angle: ndarray, lines: dict, rve_volume: float, volume: ndarray | None = None, aspect: ndarray | None = None, note: str = '', problems: dict = <factory>, dataset: dict | None = None)[source]

Bases: object

The structure at one point of the pipeline; arrays aligned with labels unless said otherwise.

key: str
title: str
units: str
labels: ndarray
pair_labels: ndarray

(P, 2) raw labels of every pair of grains that share a boundary, the lower label first.

pair_area: ndarray

(P,) area they share, in output units squared.

pair_angle: ndarray

(P,) misorientation in degrees; NaN where it cannot be given.

lines: dict
rve_volume: float
volume: ndarray | None = None
aspect: ndarray | None = None
note: str = ''
problems: dict
dataset: dict | None = None

What the dataset says about every grain (dataset_columns()), aligned with labels.

property has_volume: bool
neighbour_count() → ndarray[source]

Number of neighbours of every grain (grains it shares a boundary with).

grain_area() → ndarray[source]

Interior boundary area of every grain.

mean_misorientation() → ndarray[source]

Area-weighted mean of the misorientations across the boundaries of every grain (NaN where unavailable).

upxo.meshing.gbconformant.fm_steel_abaqus.snapshots.pair_misorientation(hierarchy, pairs, symmetry='cubic') → ndarray[source]

Misorientation in degrees of every pair of features (NaN for a symmetry other than cubic, or a missing feature).

upxo.meshing.gbconformant.fm_steel_abaqus.snapshots.dataset_columns(hierarchy, labels) → dict[source]

What the raw dataset says about every grain of labels (aligned with it).

euler is (N, 3) Bunge-Euler angles in degrees (NaN where the label is no feature). groups maps pag, packet, block and family to a list of group keys, one per grain: the group of a coarser level than the one meshed (None where the level does not apply). A twinned structure has the family of a host and its twins (a grain with no family is a family of its own).

upxo.meshing.gbconformant.fm_steel_abaqus.snapshots.voxel_snapshot(hierarchy, settings: ComparisonSettings | None = None) → Snapshot[source]

The voxel structure of the hierarchy level (raw labels).

upxo.meshing.gbconformant.fm_steel_abaqus.snapshots.tet_snapshot(hierarchy, points, tetrahedra, resolved, settings: ComparisonSettings | None = None) → Snapshot[source]

The tetrahedral mesh; resolved is the raw label of every tetrahedron.

upxo.meshing.gbconformant.fm_steel_abaqus.snapshots.surface_junction_edges(points, triangles, region_a, region_b, include_rve_faces=False) → JunctionEdges[source]

Junction edges of a triangulated grain boundary surface.

region_a/region_b are the grains on the two sides of every triangle; a triangle on the box has the same grain on both sides and borders the exterior (region 0), which counts only with include_rve_faces.

upxo.meshing.gbconformant.fm_steel_abaqus.snapshots.closed_volumes(points, triangles, tet_points, tetrahedra, tet_labels)[source]

Volume and aspect ratio of every grain, from the surface triangles that bound it.

Each triangle is a face of the tetrahedra on one or both of its sides; the tetrahedron says which way the triangle faces into its grain, whatever the winding of the stored triangle. points are the coordinates the triangles are measured in (the surface), tet_points those of the tetrahedra (whose nodes 0..len(points) are the surface nodes). Returns (labels, volume, aspect, problems); problems['unmatched'] counts triangles that are not a face of the tetrahedra (the volumes are then incomplete).

upxo.meshing.gbconformant.fm_steel_abaqus.snapshots.surface_snapshot(key, hierarchy, points, triangles, region_a, region_b, settings: ComparisonSettings | None = None, *, tets=None, note='') → Snapshot[source]

A grain boundary surface; region_a/region_b are the raw labels on the two sides of every triangle.

A triangle on the box has the same grain on both sides. With tets (the nodes, tetrahedra and raw label of each tetrahedron of a mesh built on this surface) the grain volume and aspect ratio are measured too; an open surface has interior boundaries only and no grain volume.