This page is a map of the calls you use in almost every model and the objects they return. Each row links to the API page with the full signature and arguments. For every public symbol, see the generated reference.
The workflow in calls
sim = Simulation(freq_max, domain, dx=..., boundary="cpml") # domain and meshsim.add_material(...); sim.add(shape, material=...) # materials, geometrysim.add_source(...) or sim.add_port(...) # excitationsim.add_probe(...); sim.add_flux_monitor(...) # observablessim.preflight() # checkresult = sim.run(n_steps=...) # solve -> ResultBuilding a model
| Call | Does | Reference |
|---|---|---|
Simulation(freq_max, domain, *, dx, boundary, cpml_layers, dz_profile, ...) | domain, mesh, boundaries | Simulation |
add_material(name, *, eps_r, sigma, mu_r, debye_poles, lorentz_poles) | a named material | Geometry & Materials |
LorentzPoleMap(omega_0, delta, kappa), drude_pole_map(omega_p, gamma), lorentz_pole_map(delta_eps, omega_0, delta) | one pole with scalar or callable strength and damping; callables receive X, Y, Z in metres at realized cell centres on uniform and graded meshes | Generated reference |
add(shape, *, material) | fill a Box, Sphere, Cylinder, PolylineWire, Via, MeshShape… | Geometry & Materials |
add_thin_conductor(shape, *, surface_impedance_f0=None) | a copper sheet | Geometry & Materials |
add_wall_loss(*, sigma_bulk, f0, shape=None, faces=None) | conductor loss on opaque PEC walls | Support matrix |
add_source(position, component, *, waveform, amplitude_kind=None) | point source, no impedance; pass amplitude_kind="current" or "field" (left as None it means "current" and warns) | Sources & Ports |
add_tfsf_source(...) | plane wave | Sources & Ports |
add_port, add_msl_port, add_waveguide_port, add_coaxial_port | ports for S-parameters | Sources & Ports |
add_probe, add_dft_plane_probe, add_flux_monitor, add_ntff_box | observables | Results & Observables |
add_wall_loss applies conductor loss to exactly one of faces (PEC domain
faces such as ("y_lo", "y_hi")) or shape (the same shape object already
added with material="pec"). The surface resistance Rs is frozen at f0,
Rs = sqrt(pi * f0 * mu0 / sigma_bulk), magnitude only; surface reactance is
not modelled. Uniform and graded run() and forward() carry the wall
operator. See the support matrix for refused lanes.
Checking and running
| Call | Returns | Reference |
|---|---|---|
preflight() | PreflightReport (read .ok, .errors, .warnings) | Simulation |
fidelity_report() | where each shape landed on the grid | Simulation |
run(n_steps= / num_periods= / until_decay=, ...) | Result | Simulation |
forward(eps_override=..., ...) | ForwardResult, differentiable with JAX | Simulation |
plan_mesh(...), Simulation.auto(...) | a proposed mesh and domain | Automation |
S-parameters
Each port family has its own calculator:
| Ports | Call | Returns |
|---|---|---|
lumped / wire add_port | run(compute_s_params=True, s_param_freqs=...) | Result.s_params, Result.freqs |
microstrip add_msl_port | compute_msl_s_matrix() | MSLSMatrixResult |
waveguide add_waveguide_port | compute_waveguide_s_matrix() | WaveguideSMatrixResult |
coaxial add_coaxial_port | compute_coaxial_line_reflection() or compute_coaxial_two_port() | CoaxialLineReflectionResult, CoaxialTwoPortResult |
sim.compute_s_matrix() chooses the calculator from the registered ports, and
sim.s_matrix_lane() tells you which one it would use. Microstrip and coaxial
ports are not computed by run(compute_s_params=True). Details:
Sources & Ports.
Reading results
| Object | Main contents | Reference |
|---|---|---|
Result | time_series, dt, settling_db, s_params, freqs, flux_monitors, dft_planes, ntff_data, snapshots; find_resonances(), s11(), s_db() | Results & Observables |
ForwardResult | time_series, s_params, dft_planes, ntff_data | Results & Observables |
| S-parameter results | S or s_params indexed [receiver, driven, freq] | Results & Observables |
Before you trust a spectrum, check result.settling_db (below about −40 dB).
For what is supported, limited or refused, see
Support Boundaries.
