upxo.meshing.gbconformant.d3v2p1.numba_surface_angles module

Compiled candidate search for surface-angle repair (numba).

Opt-in tier of d3v2p1.surface_angles.improve_surface_angles: that function runs it only when the compiled tier is asked for explicitly (backend=’numba’, the pipeline’s BACKEND setting or UPXO_BACKEND) and compiled_ready() says it works here; otherwise, and on any machine without numba, the numpy / parallel tiers run. ‘auto’ does not select it. Importing this module needs numba.

evaluate is d3v2p0.surface_angles._candidates + _keeps_openings + the choice of the best operation, for one triangle, compiled. It reads the same things d3v2p0 reads: the live points and triangles, the angles and the adjacency of the start of the pass (stale during the pass by design: the reservation of touched nodes keeps the operations of one pass apart), and it chooses the same way (candidates in the same order, the first of equal gains wins). The no-sharpening rule is d3v2p0’s (the opening before an operation is measured at the old position of a moved node).

The arithmetic is the same formulas as numpy’s but not always in the same order of additions, so a choice that hangs on the last digit of a float can differ from d3v2p0’s; the checks that accept an operation afterwards (intersections, facet openings, orientation, volumes) are the unchanged d3v2p1 ones.

upxo.meshing.gbconformant.d3v2p1.numba_surface_angles.evaluate(t, p, f, ang, node_off, node_rows, ekey_sorted, esort, width, eoff, erows, edge_u, edge_v, fixed, curve_off, curve_edge, curve_key, patch, pairs, exterior, rve_face, extent, has_extent, flips, relocation, collapses, max_dev, cos_normal, wedge_limit, max_owner)

The best operation for triangle t, as d3v2p0 chooses it. Returns (kind, rows, new, node, x, y, z, gain, keep, gone); kind is KIND_NONE when no candidate passes.

wedge_limit < 0 switches the no-sharpening rule off. Ties between candidates go to the first generated.

class upxo.meshing.gbconformant.d3v2p1.numba_surface_angles.Adjacency(n_points, f, alive, patch, frozen)[source]

Bases: object

d3v2p0’s per-pass _Topology as arrays, in the same orders: the triangles around each node (ascending), the edges in order of first appearance with their triangles (ascending), the curve edges around each node in the order of the edges, and the nodes that touch a frozen triangle.

edge_rows(a, b)[source]

Triangles on the edge a-b at the start of the pass (a list), as d3v2p0’s topo.edge_tri.get.

rows_around_edges_of(f, rows)[source]

The triangles that shared an edge with any of rows at the start of the pass, and rows themselves.

upxo.meshing.gbconformant.d3v2p1.numba_surface_angles.improve_surface_angles_compiled(surface, enabled=True, minimum_angle=30.0, max_passes=10, max_deviation=None, minimum_facet_angle=0.1, frozen_grain_ids=(), flips=True, relocation=True, collapses=True, max_normal_change=60.0, wedge_limit=None, backend='auto', n_workers=None, progress=None, plan_report=None)[source]

d3v2p0.surface_angles.improve_surface_angles with the candidate search compiled.

The same arguments, rules, order of work (worst triangle first, one pass at a time, touched nodes reserved for the rest of the pass) and result as d3v2p0 (coordinates agree to the last digits of a float); the operations a pass proposes are checked afterwards for intersections and facet openings exactly as d3v2p1.surface_angles does, and rejected ones are rolled back. The candidate search runs in this process; backend / n_workers only steer the intersection search of the checks (d3v2p1.backend). plan_report: the backend report to store in the result (d3v2p1.surface_angles passes its plan’s). Needs numba.

upxo.meshing.gbconformant.d3v2p1.numba_surface_angles.compiled_ready()[source]

(True, None) when the kernels compile and repair a small test surface correctly, else (False, reason).

Checked once per process. numba_available() only compiles a one-line probe; this compiles the kernels of the tier (from the on-disk cache when there is one), so a machine where they cannot compile or cache falls back to the other tiers before any real work starts.