kicad2ems.pcbqs.static

Reciprocal free-space 1/R moments, tiled across the fill backends.
kicad2ems.pcbqs.static.edge_inductance(rwg, Mrr, Mrx, Mry, M0, factor=1.0, scale=None, workers=None)[source]
factor * diag(scale) combine(rwg, Mrr, Mrx, Mry, M0) diag(scale),
symmetric.

Returns (matrix, info). The compiled core gathers each entry from the two
triangles of each RWG function, with no temporaries beyond the output;
otherwise the sparse Galerkin products of combine() are used.
kicad2ems.pcbqs.static.static_moments(nodes, tris, z, near=3.0, outer_levels=1, chunk=16384, scalar_only=False, backend='auto', workers=None, return_info=False)[source]
Return (local nodes, M0, Mrx, Mry, Mrr), in SI units.

Pairs within `near` times the sum of their bounding radii use analytic
source integration; close observation triangles subdivide `outer_levels`
times. Far pairs use the three-point product rule. near=inf is the
all-analytic reference, scalar_only returns just (local nodes, M0).

backend='auto' uses OpenMP if built, otherwise threaded NumPy. 'numpy'
selects the serial reference. Explicit unavailable backends raise.
workers controls CPU threads; chunk bounds tile pair count. Independent
pair results are assembled by one writer, with identical reciprocity for
every backend. Storage remains O(Nt**2), scratch is O(chunk*workers).
The OpenMP backend classifies, integrates and writes whole matrices
natively (scheduler='native'); other backends use host tiles of `chunk`.
return_info=True returns (moments, execution metadata).