kicad2ems.fdtd.gfdtd

gfdtd as a kicad2ems solver and FDTD engine (engines.py): the FDTD model
(solver.py) solved by gfdtd's engine (the GPU via Vulkan, its compiled
CPU core, or numpy) through its CSXCAD / openEMS interface. The board, the mesh
(--res, --fine, --nz, ...), the ports, the parts and the end criteria are the
FDTD settings shared with openEMS; only the engine differs. Runs go to
<out>/gfdtd/exc_<port>, the CSX file to <name>_gfdtd.xml (also runnable with
`python -m kicad2ems.gfdtd`), the antenna results to <name>_gfdtd_antenna.json.

--sigma: openEMS's conducting-sheet model; --rough and --finish: the sheets' own
(Hammerstad, a wideband fit); --converge: the FDTD layer's mesh levels, run on
gfdtd.
class kicad2ems.fdtd.gfdtd.GFDTD[source]
check(s=None)[source]
(usable, one line): its version and origin, or what is missing and
how to get it. s: the run's settings, where one says where the solver is
(--qucsator); None for --check.
details()[source]
(usable, report lines) of a longer check (--check, and when a named
solver cannot run).
engine(s)[source]
The engine string of engines.py ('openems', 'gfdtd:gpu').
estimate(run)[source]
openEMS's estimate (the same mesh and timesteps), at gfdtd's speed on
the backend it would use.
jobs(run, p)[source]
Runs at once: --jobs when given; on the GPU as many as its cache
holds (engine.concurrent_runs), on the CPU one (the core's threads
already share the cores). --gfdtd-gpus: one a GPU named, each in a
process of its own bound to it (GPU_SLOTS; R-D9).
prepare(run)[source]
Its own form of the board (openEMS: the boundaries and the mesh),
handed to solve() and the later steps; None when it needs none. A
preview stops here.
resources()[source]
The GPU gfdtd's engine would run on (the best Vulkan GPU), or why
there is none.
solve(run, p)[source]
FDTD's solve, the GPU jobs() chose for it (EMSDEV_VULKAN_DEVICE)
given back at its end: it had stayed set for the rest of the process,
and the window's next solves and mom25d's Vulkan LU took that GPU.
validate(s)[source]
A message when its settings in s cannot be used together (None:
fine); checked for every run.
kicad2ems.fdtd.gfdtd.api(backend='')[source]
(ContinuousStructure, openEMS) of gfdtd's engine (engines.py) on a
backend: gpu, vulkan, core, numpy or auto.
kicad2ems.fdtd.gfdtd.bind_process(slots, counter, lock)[source]
A worker process's initializer: the next slot's GPU, as
EMSDEV_VULKAN_DEVICE (read when its runs pick one).
kicad2ems.fdtd.gfdtd.gpu_slots(spec, runs)[source]
The GPUs --gfdtd-gpus names ('all', or indices '0,1'), at most `runs` of
them, as [Vulkan adapter index]; None: not asked, or fewer than two of them
usable (ValueError for an index there is no such GPU of).
kicad2ems.fdtd.gfdtd.gpu_speeds(slots)[source]
{slot: M cell updates / s} as measured on earlier runs (by the GPU's
name), None where never measured.
kicad2ems.fdtd.gfdtd.record_speed(slot, mcps)[source]
A run's speed on GPU `slot`, kept by its name (the mean with what was
kept, weighted 1:1).
kicad2ems.fdtd.gfdtd.share(slots, n, speeds=None)[source]
{slot: [run positions 0..n-1]}: each run to the GPU that would finish it
first (its runs so far plus this one over its speed; the runs taken as
alike). A GPU never measured counts as fast as the fastest (so it is
measured); with no speeds at all, round the GPUs. A GPU too slow to finish a
run before the others would is given none (R-D9: the 4.7 times slower one
had taken the second of two runs).