upxo.pxtal.fm_steel_3d.deck_export module

Abaqus deck export with chosen set names, optional sets and a chosen level.

ConfigurableMeshExporter3D extends MeshExporter3D with:

  • element-set name prefixes and an on/off switch for each hierarchy level;

  • optional element sets of grain-boundary, junction-line and junction-point voxels;

  • renamed or switched-off face node sets (the faces the analysis step loads and supports are always written);

  • optional node sets at the origin and along the edges of the domain;

  • a requested hierarchy level for materials and sections, including the 'packet' level;

  • optional writing of the files straight into the output directory.

export_deck runs a whole export from plain arguments: rescaling, exporter set-up and the call for the chosen element type.

Options (all optional; options is a plain dict)

  • export_level: 'auto' (default), 'subblock', 'block', 'packet' or 'pag'.

  • elset_<kind>: bool, kinds pag, pck, blk, subblk and iso (default True).

  • prefix_<kind>: str, default 'es_<kind>_'.

  • elset_gb, elset_jl, elset_jp: bool, default False; the set is named <prefix>all.

  • prefix_gb, prefix_jl, prefix_jp: str, default 'es_gb_', 'es_jl_' and 'es_jp_'.

  • nset_<face>: bool, faces x_min, x_max, y_min, y_max, z_min and z_max (default True).

  • prefix_<face>: str, default the library face-set names.

  • nset_origins: bool, default False; the set is named prefix_origins ('ns_origin').

  • nset_rve_edges: bool, default False; the set is named prefix_rve_edges ('ns_rve_edge').

class upxo.pxtal.fm_steel_3d.deck_export.ConfigurableMeshExporter3D(options: dict | None = None, *, flat_output: bool = False, **kwargs)[source]

Bases: MeshExporter3D

MeshExporter3D with configurable set names, optional sets and level.

Parameters:
  • options (dict, optional) – See the module docstring.

  • flat_output (bool) – If True the files are written straight into the output base directory and folder_name is not used to make a subfolder.

  • **kwargs – Passed to MeshExporter3D (verbosity, phase_id, mat_data_flag).

options: dict
flat_output: bool
upxo.pxtal.fm_steel_3d.deck_export.export_deck(fm_state, element_type: str, output_directory, *, folder_name: str = 'model', output_unit: str | None = None, scale_factor: float = 1.0, max_voxels: int | None = None, force: bool = False, custom_message: str = '', ignore_ids=(), analysis: dict | None = None, options: dict | None = None, verbosity: int = 1, flat_output: bool = True) → Path[source]

Export fm_state as an Abaqus deck and return the directory written.

Parameters:
  • fm_state – FM steel pipeline state. It is not modified; with scale_factor other than 1 the deck is made from a rescaled copy of the grid.

  • element_type ({'C3D8', 'C3D4', 'C3D20', 'C3D10'})

  • output_directory – Existing directory the files are written to (with flat_output) or in which <folder_name>N is created.

  • output_unit ({'microns', 'mm', 'm'}, optional) – Unit of the node coordinates; the unit of the state if not given.

  • scale_factor (float) – Voxel-count scale factor of the exported grid (> 0).

  • max_voxels (int, optional) – Overrides the hard voxel limit of the element type.

  • force (bool) – Skip the interactive confirmation above the hard limit.

  • ignore_ids (iterable of int) – Grain ids exported as void.

  • analysis (dict, optional) – Keyword arguments of MeshExporter3D.configure_analysis (write_step may be given as text).

  • options (dict, optional) – See the module docstring.

upxo.pxtal.fm_steel_3d.deck_export.find_isolated_grain_orientations(fm_state) → dict[source]

isolated_grain_orientations of the state, found by following its _parent chain; an empty dict if none is found.

upxo.pxtal.fm_steel_3d.deck_export.next_instance_directory(base_dir) → str[source]

Create and return base_dir/instanceN, N one above the highest existing.

upxo.pxtal.fm_steel_3d.deck_export.as_bool(value, default=False)[source]

Read a boolean that may have been stored as text (‘true’, ‘off’, …).

upxo.pxtal.fm_steel_3d.deck_export.parse_integer_list(text) → List[int][source]

Integers from comma-separated text; blank entries are skipped.

Raises ValueError if an entry is not an integer.

upxo.pxtal.fm_steel_3d.deck_export.parse_positive_int(value) → int | None[source]

A positive integer from a number or text, or None.

None, blank text, zero and negative values give None. Text that is not an integer raises ValueError.