upxo.meshing.gbconformant.fm_steel_abaqus.subset module

Cuboid subset of an input dataset: box entry, the crop, and what the crop cuts.

The crop is taken from the input label array (and the feature table that goes with it) before anything is cleaned or meshed. Raw labels are kept, so grain IDs, element-set names, global IDs and orientations of the features that remain are those of the full structure.

class upxo.meshing.gbconformant.fm_steel_abaqus.subset.BoxSpec(mode: str = 'index', lo: tuple = (0, 0, 0), hi: tuple | None = None, units: str | None = None)[source]

Bases: object

A box entered in one of three ways.

index: voxel indices, hi exclusive. percent: percent of the dataset along each axis. physical: lengths from the dataset origin in units. A hi of None means the full extent.

mode: str = 'index'
lo: tuple = (0, 0, 0)
hi: tuple | None = None
units: str | None = None
validate()[source]
upxo.meshing.gbconformant.fm_steel_abaqus.subset.resolve_box(spec, shape, voxel_size=1.0, source_units=None)[source]

Voxel indices (lo, hi) of spec in a dataset of shape.

voxel_size is one voxel edge in source_units; physical entry is converted from spec.units (default: source_units). Indices are rounded to the nearest voxel boundary.

upxo.meshing.gbconformant.fm_steel_abaqus.subset.describe_box(lo, hi, shape, voxel_size=1.0, source_units=None, units=None)[source]

The same box in all three entry forms, for display and for mode switches.

upxo.meshing.gbconformant.fm_steel_abaqus.subset.extract_labels(labels, lo, hi)[source]

Crop of labels as a new contiguous array.

upxo.meshing.gbconformant.fm_steel_abaqus.subset.extract_subset(hierarchy, lo, hi)[source]

Hierarchy of the crop: same features, IDs and orientations, sizes recomputed.

upxo.meshing.gbconformant.fm_steel_abaqus.subset.cut_statistics(parent_counts, crop_counts, small_threshold=4)[source]

What the box cuts: grains partly inside, and fragments below small_threshold.

upxo.meshing.gbconformant.fm_steel_abaqus.subset.hierarchy_counts(hierarchy, labels=None)[source]

How many PAGs, packets, blocks and sub-blocks the features hold (those of the level meshed), as {name: count}.

labels limits the count to those features (the ones in a crop); a structure that names its own groups (twinned FCC) is counted as grains and host families.

upxo.meshing.gbconformant.fm_steel_abaqus.subset.crop_adequacy(counts, minimums)[source]

Warnings for the levels whose count is below the minimum the person asked for (None or 0: no minimum).

upxo.meshing.gbconformant.fm_steel_abaqus.subset.subset_record(spec, lo, hi, shape, voxel_size=1.0, source_units=None, units=None, statistics=None)[source]

JSON-ready description of a crop (what was cut, in every entry form).

upxo.meshing.gbconformant.fm_steel_abaqus.subset.write_subset_record(folder, record, name='subset.json')[source]
upxo.meshing.gbconformant.fm_steel_abaqus.subset.next_index(parent, width=3)[source]

One more than the largest NNN or NNN_suffix entry in parent.

upxo.meshing.gbconformant.fm_steel_abaqus.subset.indexed_name(index, suffix='', width=3)[source]
upxo.meshing.gbconformant.fm_steel_abaqus.subset.new_indexed_directory(parent, stem, width=3)[source]

Create parent/<stem>_NNN with the next free number and return its path.