Input specifications

Surface inputs

class Pymeshit.headless.SurfaceSpec(name, points, role='unit', target_size=None, metadata=<factory>)[source]

Describe one geological surface supplied to the headless workflow.

Parameters:
namestr

Human-readable surface name. The name is propagated to intermediate data and is used as the default Exodus sideset name.

pointspath-like or array-like

Point-cloud coordinates. Pass a path accepted by read_points() or an (N, 2)/(N, 3+) array-like object. Two-dimensional input receives z=0; columns after the first three are ignored.

role{“border”, “unit”, “fault”}, default=”unit”

"border" identifies an outer domain boundary, "unit" an internal stratigraphic surface, and "fault" an internal fault constraint. Roles also determine surface marker conventions.

target_sizefloat, optional

Surface-specific target edge length in the same units as points. A missing or non-positive value falls back to MeshOptions.target_size.

metadatadict, optional

User metadata copied into the corresponding intermediate dataset. The workflow does not interpret these values.

Parameters:
  • name (str)

  • points (str | PathLike | Sequence[Sequence[float]] | numpy.ndarray)

  • role (Literal['border', 'unit', 'fault'])

  • target_size (float | None)

  • metadata (Dict[str, Any])

Notes

Surface order is significant. Non-fault surface i receives marker i + 1; fault surface i receives marker 1000 + i.

Well inputs

class Pymeshit.headless.WellSpec(name, points, target_size=None, marker=None, metadata=<factory>)[source]

Describe one well or polyline used as a TetGen edge constraint.

Parameters:
namestr

Human-readable well name used by default during export.

pointspath-like or array-like

Ordered well coordinates. Pass a path accepted by read_points() or an (N, 2)/(N, 3+) array-like object. Consecutive points define the well segments.

target_sizefloat, optional

Desired spacing along the refined well in coordinate units. If omitted, the workflow derives a value from the well extent and the global target size.

markerint, optional

Exodus node-set or BAR2 block identifier. Set this explicitly when IDs must remain stable across cases; otherwise PyMeshIt assigns an ID from dataset order.

metadatadict, optional

User metadata copied into the intermediate well dataset.

Parameters:
  • name (str)

  • points (str | PathLike | Sequence[Sequence[float]] | numpy.ndarray)

  • target_size (float | None)

  • marker (int | None)

  • metadata (Dict[str, Any])

Materials

class Pymeshit.headless.MaterialSpec(name, locations, attribute=0, type='FORMATION', max_volume=0.0)[source]

Describe a material and its TetGen region seed locations.

Parameters:
namestr

Material name used as the default Exodus element-block name.

locationsarray-like

One (x, y, z) location or an (N, 3+) collection. Formation seeds must lie inside the volume region they label.

attributeint, default=0

Geological material ID written to the volume mesh MaterialID cell array and used as the key for custom_block_names.

type{“FORMATION”, “FAULT”}, default=”FORMATION”

Formations create volumetric TetGen regions. Fault materials describe surface-only material metadata and do not create volume region seeds.

max_volumefloat, default=0.0

Reserved per-material maximum volume value. The current headless workflow stores it in TetGen material metadata; global TetGen switches remain responsible for volume constraints.

Raises:
ValueError

If locations cannot be interpreted as three-dimensional points.

Parameters:
  • name (str)

  • locations (Sequence[float] | Sequence[Sequence[float]])

  • attribute (int)

  • type (Literal['FORMATION', 'FAULT'])

  • max_volume (float)

to_tetra_dict()[source]

Convert this specification to the dictionary used by TetGen.

Returns:
dict

Normalized material metadata containing name, locations, attribute, type, and max_volume.

Return type:

Dict[str, Any]

Complete cases

class Pymeshit.headless.MeshCase(surfaces, materials=<factory>, wells=<factory>, options=<factory>)[source]

Collect all inputs for one headless mesh generation run.

Parameters:
surfacessequence of SurfaceSpec

Ordered surface definitions. At least one surface is required.

materialssequence of MaterialSpec, optional

Formation and fault material metadata. If no formation material is provided, the TetGen wrapper creates one default region near the PLC centre.

wellssequence of WellSpec, optional

Ordered well/polyline constraints.

optionsMeshOptions, optional

Workflow settings. A default MeshOptions instance is created for each case.

Parameters: