This page is for readers who want to know how rfx turns a declared model into a result: contributors, and users who want to know which part of the code a setting reaches. You do not need it to use rfx.

The stages
- Declaration. You describe the model on a
Simulation: the grid, the materials and shapes, the sources and ports, and what to measure (add_*methods;rfx/api/). - Model assembly.
run()andforward()both start with the same front: the preflight checks (rfx/preflight/), the assembly of the realized model, which is the geometry and materials as they land on the grid (rfx/model/), and the choice of solver path (rfx/api/_dispatch.py). What the grid built is whatsim.realized_geometry()andsim.fidelity_report()show. - Time step. One step order advances the fields: the H update, the E
update, the boundaries and the sources, in a fixed sequence with named
hook points between them (
rfx/stepping/sequence.py). The uniform-mesh and graded-mesh paths use it on one device. On several devices, each slab of the grid runs the same step, and the exchanges between slabs are attached at its hook points (rfx/stepping/slab_wrap_uniform.py,rfx/stepping/slab_wrap.py). - Recording. Before the run, rfx builds a measurement plan from your
declarations: probes, ports, DFT planes, flux monitors, the far-field box and
current-moment monitors (
rfx/measurement/). On one device, the step records each of them at its hook points from that plan. - Results. After the run, the records become results.
run()returns the S-parameters and the far-field box’s DFT records in a result object (rfx/measurement/,rfx/sparams/);compute_far_fieldturns those records into a radiation pattern (rfx/measurement/farfield.py).forward()returns the time signals as JAX arrays, so you can differentiate them (see run() and forward()).
Where the paths still differ
On several devices, the probe and port samples come through the shared step,
but DFT planes, flux, current moments, far field and snapshots are recorded
in the slab code (rfx/runners/_distributed_records.py), not from the
measurement plan. The figure marks this in colour. The recorded quantities are
the same; the code that records them is not yet shared.
Paths the figure leaves out:
- A graded mesh on several devices with PMC faces runs its own slab loop instead of the shared step.
- Subgridding (
add_refinementon a uniform mesh) is outside the 2.0 supported scope and is refused by default; it has its own step loop. See solver paths. - ADI time stepping has been removed. A model that asks for it is refused.
