Results and export

class Pymeshit.headless.MeshResult(datasets, conforming_surface_data, tetra_mesh=None, intersections=<factory>, triple_points=<factory>, tetra_generator=None, failures=<factory>)[source]

Store final and intermediate outputs from a headless run.

Parameters:
datasetslist of dict

Normalized surface datasets followed by well datasets. When keep_intermediate=True, entries may also contain hulls, initial triangulations, refined well points, and conforming meshes.

conforming_surface_datadict of int to dict

Surface-indexed meshes. Each value contains name, vertices, triangles, facet_markers, original_dataset_index, conforming_mesh_source, constraint_source, and mesh_metadata.

tetra_meshobject, optional

Final PyVista UnstructuredGrid returned by TetGen, or None when volume generation is disabled or fails.

intersectionsdict of int to list of dict, optional

Intersection records grouped by the lower participating dataset index. Records contain dataset_id1, dataset_id2, is_polyline_mesh, and ordered points.

triple_pointslist of dict, optional

Records with a three-coordinate point and the participating intersection_ids.

tetra_generatorobject, optional

Internal TetrahedralMeshGenerator retaining metadata needed for Exodus export.

failureslist of tuple[str, str], optional

Recoverable stage or surface failures as (name, message) tuples.

Parameters:
  • datasets (List[Dict[str, Any]])

  • conforming_surface_data (Dict[int, Dict[str, Any]])

  • tetra_mesh (Any)

  • intersections (Dict[int, List[Dict[str, Any]]])

  • triple_points (List[Dict[str, Any]])

  • tetra_generator (Any | None)

  • failures (List[Tuple[str, str]])

Notes

In volume cases, ok reports whether a tetrahedral mesh exists. Always inspect failures as well, because a mesh can exist even when a requested export failed.

property ok: bool

Whether the requested meshing stage produced its primary result.

For a volume case this is True when tetra_mesh exists. For a surface-only case it is True when no recoverable failures were recorded. Export errors remain available separately in failures.

export_mesh(file_path, *, custom_block_names=None, custom_sideset_names=None, custom_well_names=None, well_export_type='Node Sets')[source]

Export the generated tetrahedral mesh using the same exporter as the GUI.

EXODUS/NetCDF paths (.exo, .e, .nc, .nc4, .cdf) are written with material element blocks, boundary/fault sidesets, and well node sets when that metadata is available from TetGen.

Parameters:
file_pathpath-like

Destination mesh path. Parent directories are created.

custom_block_namesdict of int to str, optional

Map material attributes to Exodus element-block names.

custom_sideset_namesdict of int to str, optional

Map surface markers to Exodus sideset names.

custom_well_namesdict of int to str, optional

Map well markers to Exodus node-set or BAR2 block names.

well_export_type{“Node Sets”, “Element Blocks”}, default=”Node Sets”

Write wells as shared mesh-node sets or as BAR2 element blocks.

Returns:
bool

True when the exporter reports success.

Raises:
ValueError

If no tetrahedral mesh is available.

Parameters:
  • file_path (str | PathLike)

  • custom_block_names (Dict[int, str] | None)

  • custom_sideset_names (Dict[int, str] | None)

  • custom_well_names (Dict[int, str] | None)

  • well_export_type (str)

Return type:

bool

Notes

Exodus export requires tetra_generator metadata produced by run_mesh_case() or the GUI workflow.

See Understanding results for the intermediate-data schemas and Mesh and Exodus export for marker and naming conventions.