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 |
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_source(position, component, *, waveform, amplitude_kind="current") | point source, no impedance | 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 |
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.
