Results and reports#
A job (and meshkit.read()) returns a MeshResult: the
mesh as read-only buffers, and a report.
Buffers and ownership#
Array attributes are memoryview objects over arrays owned by native
code. Each access returns a new view, and every view keeps the native storage
alive, even after the result object is gone.
import numpy as np
xyz = np.asarray(result.vertices) # float64 (N, 3), zero-copy, read-only
cells = np.asarray(result.cells) # uint32 (M, 4), strided by cell
editable = np.array(result.vertices, copy=True)
Views are read-only; asking for a writable buffer raises
BufferError. Copy to edit.cells,cell_typesandregionsare strided over one cell array, andedgesandedge_markersover one edge array. NumPy shares them as strided arrays; a consumer that demands a C-contiguous buffer gets aBufferErrorand must copy.Cells are zero-based and counter-clockwise.
cell_typesholds 3 or 4; a triangle’s fourth index is unused.vertex_idsandcell_idsare empty when the IDs are the implicit one-based sequence, andvertex_markersis empty when every marker is 0.
NumPy is optional: memoryview supports indexing, tolist() and the
buffer protocol on its own.
Reports#
result.report is a dict. Start with status and complete:
|
Meaning |
|---|---|
|
Every requirement met. |
|
A mesh is returned, but advisory requirements (such as the minimum
target size) or other accepted exceptions were not met; see the conflict
counts and |
|
The request cannot be met, including invalid option values; no geometry. |
|
A limit in |
|
The job was cancelled; no geometry. |
|
Any other failure; no geometry. |
complete is true for complete and complete_with_exceptions; the
other fields explain the outcome.
Key |
Meaning |
|---|---|
|
Machine-readable reason and its text. |
|
Elapsed time and work units used. |
|
Counts in the result. |
|
Algorithm version and the caller’s terrain identity, for provenance. |
|
Refinement and coarsening activity. |
|
Cells smaller than the minimum target (advisory). |
|
Edges shorter than |
|
Cells whose terrain bound exceeds the tolerance, or could not be established. |
|
Worst measured values. |
|
Quadrilateral planning outcome. |
|
Up to 256 decisions: |
|
Constraint recovery and its independent audit. |
|
Up to 64 failing checks: |
|
The options the job actually used, defaults filled in. |
A report from meshkit.read() has the same keys, with the job-specific
counters at zero.
Progress events#
Job.poll() and the progress callback of
meshkit.run() deliver events as dictionaries:
Key |
Meaning |
|---|---|
|
Current stage and a short description. |
|
Progress of the stage, 0–100. |
|
Run status, as in the report. |
|
|
|
Counts so far. |
|
Event sequence number and job number. |
|
Milliseconds since the job started. |
|
Events lost so far because the queue (2,048 events) was full. |
The worker never waits for Python: when nobody polls, events beyond the queue are dropped and counted.