upxo.meshing.gbconformant.fm_steel_abaqus package
Submodules
- upxo.meshing.gbconformant.fm_steel_abaqus.audit module
- upxo.meshing.gbconformant.fm_steel_abaqus.boundary_classes module
class_order()pair_class()BoundaryClassesBoundaryClasses.orderBoundaryClasses.pairsBoundaryClasses.kindsBoundaryClasses.areaBoundaryClasses.facesBoundaryClasses.misorientationBoundaryClasses.low_angle_degreesBoundaryClasses.face_pairBoundaryClasses.face_kindBoundaryClasses.symmetryBoundaryClasses.summaryBoundaryClasses.has_misorientationBoundaryClasses.low_angle()
classify()summarize()class_nodes()
- upxo.meshing.gbconformant.fm_steel_abaqus.boundary_sets module
- upxo.meshing.gbconformant.fm_steel_abaqus.comparison module
- upxo.meshing.gbconformant.fm_steel_abaqus.constants module
- upxo.meshing.gbconformant.fm_steel_abaqus.constraints module
- upxo.meshing.gbconformant.fm_steel_abaqus.deckcheck module
- upxo.meshing.gbconformant.fm_steel_abaqus.element_sets module
- upxo.meshing.gbconformant.fm_steel_abaqus.elements module
- upxo.meshing.gbconformant.fm_steel_abaqus.export module
DeckSettingsDeckSettings.material_formatDeckSettings.n_depvarDeckSettings.load_axisDeckSettings.applied_displacementDeckSettings.step_timeDeckSettings.write_stepDeckSettings.initial_incDeckSettings.min_incDeckSettings.max_incDeckSettings.max_incrementsDeckSettings.output_intervalDeckSettings.load_modeDeckSettings.load_caseDeckSettings.load_senseDeckSettings.target_strainDeckSettings.strain_rateDeckSettings.hold_timeDeckSettings.cycle_definitionDeckSettings.strain_minDeckSettings.strain_maxDeckSettings.strain_amplitudeDeckSettings.r_ratioDeckSettings.cyclesDeckSettings.output_elsetDeckSettings.job_scriptsDeckSettings.abaqus_commandDeckSettings.umat_fileDeckSettings.job_nameDeckSettings.job_cpusDeckSettings.job_memory_gbDeckSettings.job_time_hoursDeckSettings.slurm_partitionDeckSettings.element_outputsDeckSettings.node_outputsDeckSettings.length_scaleDeckSettings.output_unitsDeckSettings.header_messageDeckSettings.elset_prefixesDeckSettings.nset_namesDeckSettings.face_toleranceDeckSettings.boundary_setsDeckSettings.layer_setsDeckSettings.boundary_classesDeckSettings.low_angle_degreesDeckSettings.crystal_symmetryDeckSettings.feature_tableDeckSettings.deck_checkDeckSettings.write_mshDeckSettings.write_vtuDeckSettings.prefix_gb_layerDeckSettings.prefix_interiorDeckSettings.set_providerDeckSettings.provider_optionsDeckSettings.validate()
elset_name()material_name()feature_elset_name()feature_material_name()write_deck()write_boundary_class_table()write_interface_surface()domain_lengths()applied_strain()
- upxo.meshing.gbconformant.fm_steel_abaqus.extra_sets module
- upxo.meshing.gbconformant.fm_steel_abaqus.features module
- upxo.meshing.gbconformant.fm_steel_abaqus.fidelity module
- upxo.meshing.gbconformant.fm_steel_abaqus.hierarchy module
FeatureHierarchyHierarchy.levelHierarchy.lgiHierarchy.featuresHierarchy.voxel_countsHierarchy.unitsHierarchy.voxel_sizeHierarchy.pag_orderHierarchy.pck_orderHierarchy.blk_orderHierarchy.sblk_orderHierarchy.global_idsHierarchy.originHierarchy.parent_shapeHierarchy.namesHierarchy.material_namesHierarchy.extraHierarchy.groupsHierarchy.systemHierarchy.level_textHierarchy.ordered_features()
read_bundle()detect_levels()load_hierarchy()parent_tables()
- upxo.meshing.gbconformant.fm_steel_abaqus.identity module
- upxo.meshing.gbconformant.fm_steel_abaqus.interfaces module
- upxo.meshing.gbconformant.fm_steel_abaqus.jobs module
- upxo.meshing.gbconformant.fm_steel_abaqus.junctions module
- upxo.meshing.gbconformant.fm_steel_abaqus.loading module
- upxo.meshing.gbconformant.fm_steel_abaqus.mergelog module
- upxo.meshing.gbconformant.fm_steel_abaqus.mesh_files module
- upxo.meshing.gbconformant.fm_steel_abaqus.outputs module
- upxo.meshing.gbconformant.fm_steel_abaqus.parameters module
- upxo.meshing.gbconformant.fm_steel_abaqus.plots module
- upxo.meshing.gbconformant.fm_steel_abaqus.setnames module
- upxo.meshing.gbconformant.fm_steel_abaqus.snapshots module
key_of_title()SnapshotSnapshot.keySnapshot.titleSnapshot.unitsSnapshot.labelsSnapshot.pair_labelsSnapshot.pair_areaSnapshot.pair_angleSnapshot.linesSnapshot.rve_volumeSnapshot.volumeSnapshot.aspectSnapshot.noteSnapshot.problemsSnapshot.datasetSnapshot.has_volumeSnapshot.neighbour_count()Snapshot.grain_area()Snapshot.mean_misorientation()
pair_misorientation()dataset_columns()voxel_snapshot()tet_snapshot()surface_junction_edges()closed_volumes()surface_snapshot()
- upxo.meshing.gbconformant.fm_steel_abaqus.subset module
- upxo.meshing.gbconformant.fm_steel_abaqus.texture module
TextureSettingsTextureSettings.pole_familyTextureSettings.crystal_symmetryTextureSettings.apply_sample_symmetryTextureSettings.use_rdTextureSettings.use_tdTextureSettings.use_ndTextureSettings.half_width_degTextureSettings.grid_pointsTextureSettings.unit_normalizeTextureSettings.plot_modeTextureSettings.projectionTextureSettings.hemisphereTextureSettings.cmapTextureSettings.difference_cmapTextureSettings.levelsTextureSettings.contour_scaleTextureSettings.colorbar_decimalsTextureSettings.axis_labelsTextureSettings.validate()
orientation_table()pole_figure()resolved_grid_points()density_difference()
- upxo.meshing.gbconformant.fm_steel_abaqus.twinned module
- upxo.meshing.gbconformant.fm_steel_abaqus.voxel_deck module
Module contents
FM-steel Abaqus decks for grain-conformal tetrahedral meshes.
Reads a raw feature export folder (label arrays, orientations and the
raw_export.pkl bundle), resolves which raw feature each meshed grain
stands for after cleaning and merging, and writes a partitioned C3D4 deck
with element sets, materials, sections, node sets and a static step.
- upxo.meshing.gbconformant.fm_steel_abaqus.applied_strain(settings, hierarchy)[source]
Engineering strain the applied displacement gives along the load axis.
The displacement and the coordinates share the length scale, so it cancels.
- upxo.meshing.gbconformant.fm_steel_abaqus.domain_lengths(hierarchy, output_units=None, length_scale=1.0)[source]
Edge lengths of the structure along x, y and z in the output units.
- class upxo.meshing.gbconformant.fm_steel_abaqus.BoxSpec(mode: str = 'index', lo: tuple = (0, 0, 0), hi: tuple | None = None, units: str | None = None)[source]
Bases:
objectA box entered in one of three ways.
index: voxel indices,hiexclusive.percent: percent of the dataset along each axis.physical: lengths from the dataset origin inunits. AhiofNonemeans the full extent.
- upxo.meshing.gbconformant.fm_steel_abaqus.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.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.extract_labels(labels, lo, hi)[source]
Crop of
labelsas a new contiguous array.
- upxo.meshing.gbconformant.fm_steel_abaqus.extract_subset(hierarchy, lo, hi)[source]
Hierarchy of the crop: same features, IDs and orientations, sizes recomputed.
- upxo.meshing.gbconformant.fm_steel_abaqus.next_index(parent, width=3)[source]
One more than the largest
NNNorNNN_suffixentry inparent.
- upxo.meshing.gbconformant.fm_steel_abaqus.new_indexed_directory(parent, stem, width=3)[source]
Create
parent/<stem>_NNNwith the next free number and return its path.
- upxo.meshing.gbconformant.fm_steel_abaqus.resolve_box(spec, shape, voxel_size=1.0, source_units=None)[source]
Voxel indices
(lo, hi)ofspecin a dataset ofshape.voxel_sizeis one voxel edge insource_units; physical entry is converted fromspec.units(default:source_units). Indices are rounded to the nearest voxel boundary.
- upxo.meshing.gbconformant.fm_steel_abaqus.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.write_subset_record(folder, record, name='subset.json')[source]
- class upxo.meshing.gbconformant.fm_steel_abaqus.ComparisonSettings(include_rve_faces: bool = False, output_units: str | None = None, length_scale: float = 1.0, mesh_voxel_length: float = 1.0, symmetry: str = 'cubic')[source]
Bases:
object
- class upxo.meshing.gbconformant.fm_steel_abaqus.TextureSettings(pole_family: object = '100', crystal_symmetry: str = 'cubic', apply_sample_symmetry: bool = True, use_rd: bool = True, use_td: bool = True, use_nd: bool = True, half_width_deg: float = 7.5, grid_points: object = 'auto', unit_normalize: bool = True, plot_mode: str = 'density', projection: str = 'equal_area', hemisphere: str = 'upper', cmap: str = 'viridis', difference_cmap: str = 'RdBu_r', levels: int = 10, contour_scale: str = 'linear', colorbar_decimals: int | None = None, axis_labels: tuple = (None, None, None))[source]
Bases:
object
- upxo.meshing.gbconformant.fm_steel_abaqus.compare_before_after(hierarchy, points, tetrahedra, tet_grain, identity, settings=None)[source]
Junction line lengths and sphere-equivalent diameters, before and after.
- upxo.meshing.gbconformant.fm_steel_abaqus.compare_junction_lines(hierarchy, points, tetrahedra, resolved_grains, settings=None)[source]
Junction line lengths before (voxels) and after (tetrahedra).
- upxo.meshing.gbconformant.fm_steel_abaqus.density_difference(eulers_before, eulers_after, settings, weights=(None, None))[source]
After-minus-before MUD density difference on a shared grid.
weightsis(before, after): one weight per orientation orNonefor each side. ReturnsXi,Yi,zi_diffandiqr(interquartile range of the difference field; a single-number summary, not a verdict).
- upxo.meshing.gbconformant.fm_steel_abaqus.feature_diameters(hierarchy, points, tetrahedra, resolved_grains, settings=None)[source]
Sphere-equivalent diameter of every feature: raw voxels against mesh volume.
- upxo.meshing.gbconformant.fm_steel_abaqus.format_summary(result)[source]
Plain-text tables of a
compare_before_after()result, the columns named for what they hold.
- upxo.meshing.gbconformant.fm_steel_abaqus.orientation_table(hierarchy, labels=None)[source]
(labels, eulers) of the features in
labels(default: all), ascending.
- upxo.meshing.gbconformant.fm_steel_abaqus.report_summary(result)[source]
JSON-friendly digest of
compare_before_after()(no per-line arrays).
- upxo.meshing.gbconformant.fm_steel_abaqus.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_grainis the resolved raw label of each tetrahedron.shrink_limitis the fraction of volume a feature may lose before it is flaggedshrunk; a feature with no tetrahedra islost. Returns{'units', 'columns', 'rows', 'stats', 'shrink_limit', 'flagged', 'lost'}.
- upxo.meshing.gbconformant.fm_steel_abaqus.merge_log(hierarchy, identity, *, symmetry='cubic', prefixes=None)[source]
Misorientation between every absorbed raw feature and the winner of its merged grain.
identityis theIdentityMap;prefixesare the element-set name prefixes. Only cubic symmetry is available. Returns{'columns', 'rows', 'summary', 'symmetry'}.
- upxo.meshing.gbconformant.fm_steel_abaqus.write_merge_log(folder, log)[source]
Write
merge_log.jsonandmerge_log.csvintofolder; returns both paths.
- class upxo.meshing.gbconformant.fm_steel_abaqus.BoundaryNodes(grain_boundary: ndarray, junction: ndarray, by_feature: dict = <factory>, n_nodes: int = 0)[source]
Bases:
objectNode indices (0-based, as in the tetrahedra array) of the boundary sets.
- upxo.meshing.gbconformant.fm_steel_abaqus.boundary_nodes(tetrahedra, tet_feature, n_nodes=None, chunk=200000)[source]
Boundary nodes from the tetrahedra (0-based node indices) and one feature label per tetrahedron.
- upxo.meshing.gbconformant.fm_steel_abaqus.periodic_pairs(base_points, faces, tolerance)[source]
{axis letter: {‘pairs’: (k, 2) 1-based node numbers [low, high], ‘low’: n, ‘high’: n, ‘max_offset’: d}}.
facesmapsXMIN..``ZMAX`` to 1-based node numbers ofbase_points. A pair is the nearest high-face node withintolerancein the two other coordinates; each node is used at most once.
- upxo.meshing.gbconformant.fm_steel_abaqus.tetrahedron_fields(tet_feature, features, names, ids=None)[source]
Per-tetrahedron arrays from the feature of each tetrahedron.
featuresmaps a feature label to an object witheulerandglobal_id;namesmaps the label to the name of its element set;idsis{column: {label: int}}of further ids (the hierarchy levels, seefeatures.id_columns()). Returns a dictionary withfeature_label(M,),global_id(M,),euler_deg(M, 3),ipf_x/ipf_y/ipf_z(M, 3, floats in 0..1),ids({column: (M,)}) andnames({label: name}).
- upxo.meshing.gbconformant.fm_steel_abaqus.write_msh(path, points, tetrahedra, fields)[source]
Gmsh MSH 2.2 ASCII: physical groups named after the element sets, element data for the orientations.
- upxo.meshing.gbconformant.fm_steel_abaqus.write_vtu(path, points, tetrahedra, fields)[source]
VTK unstructured grid with the cell data of
tetrahedron_fields(); IPF colours as 8-bit RGB.
- class upxo.meshing.gbconformant.fm_steel_abaqus.DeckSettings(material_format: str = 'reference_umat', n_depvar: int = 1, load_axis: str = 'z', applied_displacement: float = 0.2, step_time: float = 80.0, write_step: bool = True, initial_inc: float = 0.01, min_inc: float = 1e-08, max_inc: float = 1.0, max_increments: int = 10000, output_interval: float = 0.5, load_mode: str = 'displacement', load_case: str = 'monotonic', load_sense: str = 'tension', target_strain: float = 0.02, strain_rate: float = 0.0004, hold_time: float = 0.0, cycle_definition: str = 'min_max', strain_min: float = -0.01, strain_max: float = 0.01, strain_amplitude: float = 0.01, r_ratio: float = -1.0, cycles: int = 5, output_elset: str = '', job_scripts: bool = False, abaqus_command: str = 'abaqus', umat_file: str = '', job_name: str = 'fm_job', job_cpus: int = 4, job_memory_gb: float = 0.0, job_time_hours: float = 24.0, slurm_partition: str = '', element_outputs: tuple = ('LE', 'NE', 'S', 'SDV'), node_outputs: tuple = ('U', ), length_scale: float = 1.0, output_units: str | None = None, header_message: str = '', elset_prefixes: dict = <factory>, nset_names: dict = <factory>, face_tolerance: float = 1e-08, boundary_sets: bool = False, layer_sets: bool = False, boundary_classes: bool = False, low_angle_degrees: float = 15.0, crystal_symmetry: str = 'cubic', feature_table: bool = False, deck_check: bool = False, write_msh: bool = False, write_vtu: bool = False, prefix_gb_layer: str = 'es_gb_layer', prefix_interior: str = 'es_interior', set_provider: str = '', provider_options: dict = <factory>)[source]
Bases:
object- set_provider: str = ''
none.
- Type:
Module that adds further sets to the deck (see
extra_sets); empty
- class upxo.meshing.gbconformant.fm_steel_abaqus.Hierarchy(level: str, lgi: numpy.ndarray, features: dict, voxel_counts: dict, units: str, voxel_size: float, pag_order: list = <factory>, pck_order: list = <factory>, blk_order: list = <factory>, sblk_order: list = <factory>, global_ids: dict = <factory>, origin: tuple | None = None, parent_shape: tuple | None = None, names: dict = <factory>, material_names: dict = <factory>, extra: dict = <factory>, groups: dict = <factory>, system: str = 'FM steel')[source]
Bases:
object- property level_text
grainfor a structure that has only grains (twinned FCC), else the level code.- Type:
The level as a person reads it
- exception upxo.meshing.gbconformant.fm_steel_abaqus.IdentityError[source]
Bases:
RuntimeErrorA grain’s tetrahedra do not lie over any of its own raw features.
- class upxo.meshing.gbconformant.fm_steel_abaqus.IdentityMap(winner: dict, members: dict, survivor_raw: dict, rule: str, seed: int, report: dict = <factory>)[source]
Bases:
objectMeshed label -> winning raw label, with the merge history.
- upxo.meshing.gbconformant.fm_steel_abaqus.detect_levels(folder, prefixes=None)[source]
Levels (coarse to fine) with both a label array and an orientation file.
- upxo.meshing.gbconformant.fm_steel_abaqus.load_hierarchy(folder, level, prefixes=None)[source]
Read
levelof the raw export infolderinto aHierarchy.
- upxo.meshing.gbconformant.fm_steel_abaqus.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_lengthis 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 raisesIdentityError.
- upxo.meshing.gbconformant.fm_steel_abaqus.reallocation_report(raw_labels, meshed_labels, identity, hierarchy)[source]
Voxel ownership change between the raw labels and the meshed labels.
meshed_labelsis 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.resolve_identities(raw_sizes, *, shuffle_map=None, survivor_map=None, rule='larger', seed=0)[source]
Resolve the raw identity of every meshed grain.
- Parameters:
raw_sizes (mapping raw label -> voxel count before any cleaning.)
shuffle_map (mapping raw label -> pipeline label (grain-ID shuffle);) –
Nonemeans the pipeline used the raw labels unchanged.survivor_map (mapping pipeline label -> pipeline label of the grain it) – was merged into (the small-grain removal’s
original_to_survivor);Nonemeans no grain was merged.rule (
'larger'keeps the largest member’s identity;'survivor') – keeps the identity of the grain that absorbed the others.seed (seeds the pick between equally large members.)
- upxo.meshing.gbconformant.fm_steel_abaqus.write_deck(directory, points, tetrahedra, tet_grain, hierarchy, identity, settings=None, *, mesh_voxel_length=1.0, meshed_labels=None, audit=True)[source]
Write the deck into a new
directory; return a summary dictionary.- Parameters:
points (mesh coordinates (in units where one raw voxel edge is) –
mesh_voxel_length) and 0-based node indices of linear tetrahedra(M, 4), or of linear hexahedra(M, 8)in C3D8 order (a voxel mesh).tetrahedra (mesh coordinates (in units where one raw voxel edge is) –
mesh_voxel_length) and 0-based node indices of linear tetrahedra(M, 4), or of linear hexahedra(M, 8)in C3D8 order (a voxel mesh).tet_grain (meshed grain label of every element.)
hierarchy (
Hierarchyof the chosen level.)identity (
IdentityMapfor the meshed grains.)meshed_labels (optional cleaned label array (pipeline labels); when given a) – voxel reallocation report is written as well.
audit (look up the raw voxel under every centroid and stop on an identity) – mismatch (
IdentityError).