kicad2ems.fem.palace.run¶
Running Palace and reading its S-parameters.
launcher()
# how Palace is started here: ('native', path) or ('podman', rootfs),
# or None
run(workdir, 'palace.json')
# runs it there (np: one rank per fast core), returns its log
f, S = read_s(workdir + '/postpro', nports)
f, P = read_incident(workdir + '/postpro', 1)
# the driven port's incident power, each solve
f, th, ph, E = read_farfield(workdir + '/postpro')
# the far field r E at the config's angles
modes = read_modes(workdir + '/postpro_eig')
# an eigenmode run's resonances: f, Q, the ports' Q
Palace is found as
K2E_PALACE a `palace` executable (its MPI wrapper), or `palace` on
PATH: run directly, with its own folder first on PATH (a
Spack view's: its mpirun beside it)
K2E_PALACE_ROOTFS an unpacked Palace image (a root filesystem with Palace's
Spack view in /opt/views/view): run in rootless podman with
that as its root, no network, as the user; default
~/opt/palace/rootfs
each also as kicad2ems's installer recorded it (kicad2ems-site.toml:
palace, palace_rootfs), after the environment's and before PATH's
- kicad2ems.fem.palace.run.engine(workdir, logfile='palace.log')[source]¶
Which Palace solved a case, from what run() wrote beside its log (its changeset), for the tool's result (R-B14): dict(program, version, revision, kicad2ems.fem).
- kicad2ems.fem.palace.run.environment(cmd)[source]¶
The environment a Palace command runs in: a native palace's own folder first on PATH (a Spack view's, where its mpirun is too: the launcher finds MPI on PATH).
- kicad2ems.fem.palace.run.ranks(np=None)[source]¶
Palace's MPI processes: np, else one per fast core (emsdev's count: a hybrid CPU's P-cores), at least 1. (8 had been fixed: the development machine's P-cores.)
- kicad2ems.fem.palace.run.read_farfield(postpro)[source]¶
(f Hz (nf,), theta, phi deg (n,), E (nf, n, 3) complex) from Palace's farfield-rE.csv: the far field times the distance, r E (V), in Cartesian components, at the config's angles (one excitation).
- kicad2ems.fem.palace.run.read_incident(postpro, index)[source]¶
(f Hz, P W (nf,)) of the driven lumped port `index` (1-based): the incident wave's power, 0.5 V_inc I_inc of port-V.csv and port-I.csv (peak phasors). The port's own V and I there are those of its resistor, so the power into the model is this times 1 - |S11|^2.
- kicad2ems.fem.palace.run.read_modes(postpro)[source]¶
An eigenmode run's modes from Palace's eig.csv (and port-Q.csv where the ports have resistors): [dict(f_Hz, f_im_Hz, Q, error, q_ext={port index (1-based): Q})], by rising frequency. The fields' time dependence is exp(i w t): a decaying mode has Im f > 0 and Q = Re f / (2 Im f).
- kicad2ems.fem.palace.run.read_s(postpro, n)[source]¶
(f Hz, S (nf, n, n) complex) from Palace's port-S.csv: columns f (GHz), |S[i][j]| (dB), arg(S[i][j]) (deg.) for each excited port j. NaN where a term is missing.
- kicad2ems.fem.palace.run.run(workdir, cfg, np=None, threads=1, log=<built-in function print>, how=None, timeout=None, logfile='palace.log')[source]¶
Run Palace on `cfg` in workdir; its log's tail. The lines where its solvers did not converge are said (a WARNING, which a kicad2ems run lists) and, with its changeset, written to <logfile>.json beside the log (only its exit code had been read: an unconverged solve gave S-parameters as a converged one).