upxo.meshing.gbconformant.fm_steel_abaqus.voxel_deck module

Voxel (non-conformal) FM-steel deck: one C3D8 hexahedron per voxel of a label array.

The deck is written by the same writer as the conformal tetrahedral deck (export.write_deck()), so it has the same files, Part and Instance, element and node sets, set names, materials, sections, step and deck check. Boundaries follow the voxel faces (a staircase); nothing is smoothed or fitted.

The label array is one of:

  • a cleaned label array (pipeline labels), optionally resampled by a scale factor (resample_labels(): nearest voxel when refining, majority vote when coarsening);

  • the tetrahedral mesh turned back into voxels (voxelize_tetrahedra()), which shows how far the conformal mesh moved from the voxels it was built from.

Coordinates are in mesh units where one raw voxel edge is mesh_voxel_length long, as for the conformal deck.

upxo.meshing.gbconformant.fm_steel_abaqus.voxel_deck.label_hexahedra(labels, voxel_size=1.0)[source]

Nodes, C3D8 connectivity and label of every voxel of labels.

voxel_size is one edge length, or three (x, y, z). Element e is voxel np.unravel_index(e, labels.shape).

upxo.meshing.gbconformant.fm_steel_abaqus.voxel_deck.resample_labels(labels, factor)[source]

(resampled labels, report): labels with round(n * factor) voxels along each axis.

A factor above 1 refines (each new voxel takes the label of the old voxel under its centre); below 1 it coarsens, and each new voxel takes the label most of the old voxels inside it carry (ties go to the smaller label). The report lists the labels that no voxel carries any more.

upxo.meshing.gbconformant.fm_steel_abaqus.voxel_deck.voxelize_tetrahedra(points, tetrahedra, grains, voxel_size, *, low=None, high=None, chunk=100000)[source]

(labels, report): the grain of the tetrahedron that holds each voxel centre.

The grid covers the box low..``high`` (the mesh’s bounding box by default) with voxels as close to voxel_size as fit a whole number of times along each axis. A centre that no tetrahedron holds (numerical gaps on shared faces) takes the grain of the nearest tetrahedron centroid.

upxo.meshing.gbconformant.fm_steel_abaqus.voxel_deck.available_memory_bytes()[source]

Memory the system can give a program now, in bytes (None when it cannot be found).

upxo.meshing.gbconformant.fm_steel_abaqus.voxel_deck.format_bytes(count)[source]

1.4 GB-style text for a size in bytes.

upxo.meshing.gbconformant.fm_steel_abaqus.voxel_deck.estimate_voxel_deck(shape, *, available=None) → dict[source]

Rough memory and disk need of the voxel deck of a grid of shape voxels.

Returns voxels, nodes, peak_memory_bytes, disk_bytes, available_memory_bytes (None when unknown), fraction_of_available and warning: text when the peak would use more than 80 % of the free memory (None otherwise), with what to change.

upxo.meshing.gbconformant.fm_steel_abaqus.voxel_deck.write_voxel_deck(directory, labels, hierarchy, identity, settings=None, *, voxel_size=1.0, mesh_voxel_length=1.0, meshed_labels=None, audit=True, source=None)[source]

Write the voxel deck of labels into the new directory; return the summary of export.write_deck().

voxel_size is the edge of one voxel of labels in mesh units and mesh_voxel_length that of one raw voxel (they are equal for the cleaned labels at their own resolution). source (a dictionary) is stored in deck_info.json as voxel_source.