kicad2ems.pcbqs.static_backends

Execution backends for quasi-static triangle-pair integration.

Factories receive (FillGeometry, workers, chunk), returning an object
with `evaluate(p, q, d, kind, scalar_only)` and `parallel_tiles` (whether calls
may run concurrently). kind=-1 selects the smooth three-point product rule;
0/1/2 select analytic source integration at that observation refinement.
Results must be host float64 arrays: (npairs, 1) for scalar-only, otherwise
(npairs, 6), ordered M0, Mro_x, Mro_y, Mrs_x, Mrs_y, Mrr. The scheduler owns
tiling, reciprocity and output.
class kicad2ems.pcbqs.static_backends.FillGeometry(nodes: numpy.ndarray, tris: numpy.ndarray, z: numpy.ndarray, cent: numpy.ndarray, radius: numpy.ndarray, points: numpy.ndarray, levels: dict)[source]
kicad2ems.pcbqs.static_backends.bounded_map(function, items, workers)[source]
Ordered results with at most `workers` tasks/results in flight, including
on failure.
kicad2ems.pcbqs.static_backends.default_workers()[source]
Respect affinity and Linux cgroup CPU quotas; never change global
OMP/BLAS settings.
kicad2ems.pcbqs.static_backends.host_data(geometry)[source]
The compiled host kernel's geometry (static_pairs' data): level 0's
arrays, and each level's quadrature.
kicad2ems.pcbqs.static_backends.layered_spline_args(images, smooth)[source]
Image distances/coefficients and spline breaks/coefficients for
layered_pairs.
kicad2ems.pcbqs.static_backends.native_layered(engine, workers=None, kernel='layered_pairs')[source]
(core, common args, workers) for the compiled layered image kernel (or
another `kernel`, rwg_inductance: the whole entry blocks), or None (another
fill backend, or a core that predates the kernel).

Only OpenMP engines use it; NumPy/threaded backends keep the host
image loops, so an explicit backend choice is respected.
kicad2ems.pcbqs.static_backends.register_fill_backend(name, factory)[source]
Register a factory implementing the module's pair-integration protocol.
Existing names are protected.
kicad2ems.pcbqs.static_backends.resolve_workers(workers=None)[source]
Explicit count, else PCBQS_FILL_THREADS, PCBQS_OMP_THREADS,
OMP_NUM_THREADS, then default_workers().