kicad2ems.gfdtd.dumps

Field dumps, in openEMS's files: a time-domain dump is a series of VTK
rectilinear grids (<name>_<step>.vtr, zlib-compressed binary, every sample
step), a frequency-domain dump one HDF5 file (<name>.h5: /Mesh, /FieldData/FD
with one complex dataset per frequency, d_order NXYZ, as openEMS 0.37 writes
it).

Values are at the cell centres (openEMS's dump mode 2): E and J averaged over
the four parallel edges of a cell, H over its two. J is rot H (the loop sum of
the currents around each E edge over its dual area), Jc kappa E.
Frequency-domain values are 2 dt_s sum F(t) exp(-j w t) over the samples, as
openEMS's (and its port DFT).

    d = Dumps(op, backend); d.sample(step); ...; d.close(path)
class kicad2ems.gfdtd.dumps.Dumps(op, be, path, notes=None)[source]
The dumps of a run: sample(step) at every sample step (time domain: a
frame every `sub` of them; frequency domain: one DFT term), close() writes
the frequency-domain files.
close()[source]
Write the frequency-domain dumps and close the time-domain HDF5 ones;
returns the files written.
sample(step)[source]
The fields after timestep `step` (E at step dt, H half a step
before).
class kicad2ems.gfdtd.dumps.Region(d, op, be)[source]
One dump box's points (cell centres or nodes), with the per-edge scale
factors it needs on the backend's device. Cell centres: E and J average the
four parallel edges of the cell, H its two. Nodes: E and J average the two
edges along their direction, H the four around the node; edges past the
domain don't count. On the GPU (E, H, J) one kernel does it all, and adds
the DFT term in the same pass (kernels.py / kernels_vk.py: dump;
backend.dump_kernel).
accumulate(acc, t, V, I)[source]
acc (nf, nx, ny, nz, 3) complex += the field x exp(-j w t), on the
GPU in one kernel.
field(V, I)[source]
(nx, ny, nz, 3) float32 on the device.
kicad2ems.gfdtd.dumps.add_h5_td(group, step, t, data)[source]
One sample (nx, ny, nz, 3) of a time-domain HDF5 dump: dataset <step>,
d_order NXYZ, its time.
kicad2ems.gfdtd.dumps.replace(tmp, path, tries=50)[source]
os.replace(tmp, path), tried again for a while where Windows refuses it:
a file another program has open (the GUI reading the last frame) cannot be
replaced there until it is closed.
kicad2ems.gfdtd.dumps.write_h5(path, d, freqs, data)[source]
openEMS's frequency-domain HDF5 dump: data (nf, nx, ny, nz, 3)
complex.
kicad2ems.gfdtd.dumps.write_vtr(path, coords, data, name)[source]
A VTK rectilinear grid as openEMS writes its time-domain dumps: coords
(m) per axis, data (nx, ny, nz, 3).