Repository navigation
Add Maxwell TE10 wave ports, first-order ABC and S-parameter sweeps - #75
xtalax-droid wants to merge 28 commits into
Conversation
Rectangular-waveguide ports and Silver-Mueller absorbing facet sets enter the MaxwellModel as extra real blocks with frequency coefficients on the shared pattern. solve_sweep recombines one operator per frequency, reuses the UMFPACK symbolic factorisation and solves all port excitations from one factorisation; the solver is pluggable. Port amplitudes are normalised by the projected mode norm p^T B^-1 p, which makes a PEC short reflect |S11| = 1 to 1e-4 where the continuous norm int e.e gives 1e-2 errors. Validated against WR-90 closed forms. Agent-Harness: Claude Code 2.1.318 Agent-Model: claude-opus-5-5 Agent-Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5 Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
A short WR-90 example of the sweep API in docs/src/maxwell.md. Agent-Harness: Claude Code 2.1.318 Agent-Model: claude-opus-5-5 Agent-Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5 Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
…t rim The ABC admittance now uses eps_c = eps_r - i sigma/(omega eps0) of each adjacent material, one block per material, so a conducting load sees the same impedance in the volume and on the ABC; validated against a transmission-line closed form for a WR-90 guide with a conducting section. A wave port whose rim edges are not PEC-constrained (natural PMC sides) is rejected, since the TE10 PEC-guide mode would be wrong there. Addresses review findings. Agent-Harness: Claude Code 2.1.318 Agent-Model: claude-opus-5-5 Agent-Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5 Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
A port facet set that is also listed in pec has no free edge dofs, so its projected mode norm is zero and the sweep returned NaN. Throw an ArgumentError for an empty free-dof set or a nonpositive projected norm. Addresses a review finding. Agent-Harness: Claude Code 2.1.318 Agent-Model: claude-opus-5-5 Agent-Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5 Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.318 Agent-Model: claude-opus-5-5 Agent-Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5 Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.318 Agent-Model: claude-opus-5-5 Agent-Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5 Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.319 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.322 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Independent review (Codex CLI v0.164.0 / gpt-6.1-sol), reviewer session 01a1c8d0-7042-75f1-b0ee-4c1b467ea492, reviewed head a892dbd
This is a blind code-only review by a session other than the PR author's, copied below from the reviewer's report with only the grading metadata removed. The posting agent did not re-run the reviewer's commands. A MERGE verdict is advice; merging is left to the maintainers. Riskmedium-low (ML7: additive public Maxwell solver, port and sweep APIs; existing entry points and defaults are unchanged). Blocking findings
Non-blocking findings
What I ranReviewer: codex-cli 0.164.0, model gpt-6.1-sol. All Julia runs preserved the supplied layered
What I did not verify
🤖 Posted by an AI agent — harness: Claude Code 2.1.322 · model: claude-sonnet-5-5 |
Agent-Harness: Claude Code 2.1.322 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
At beta = 0 the TE10 wave impedance is infinite and the power-wave scale of s_parameters is 0/0, which filled the scattering matrix with NaN. port_excitations and s_parameters now throw an ArgumentError naming the port; the propagation constant itself is still returned. Agent-Harness: Claude Code 2.1.322 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com> (cherry picked from commit cabdd93)
… port faces, finite absorbing operator at zero frequency solve_sweep stores a copy of each solution, so a solver that reuses its output matrix cannot alias the frequencies; an empty frequency vector gives an empty sweep. A wave port in a material with complex eps_r is rejected with an ArgumentError (the power-wave normalisation holds only for a real wave impedance), as is a facet set that is both absorbing and a port. The absorbing coefficient is 0 at omega = 0 instead of 0/0. The tetrahedron facet tables replace the non-public Ferrite.reference_facets and dirichlet_facetdof_indices in ports.jl. Agent-Harness: Claude Code 2.1.322 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
A facet in two boundary conditions got both terms; pairwise facet overlap (including aliases and two ports on one face) is now an ArgumentError. Agent-Harness: Claude Code 2.1.322 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.322 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
The table now lives in model.jl on the core branch and is tested there. Agent-Harness: Claude Code 2.1.322 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
An interior edge of the port face in pec blocks part of the aperture while the TE10 mode and propagation constant describe the full rectangle. Same hunk on both branches. Agent-Harness: Claude Code 2.1.322 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
|
Review feedback on this PR has been addressed on head Retarget to master and merge master into this branch after #74 merges. Items deliberately left as they are: reaction coefficients that are subnormal but representable are still rejected (conservative); coefficients that cancel to zero only up to roundoff are rejected rather than compared with a tolerance; the absorbing-boundary adjoint derivative uses 0 for the sigma term at omega = 0 although the true limit is finite and nonzero. 🤖 Posted by an AI agent · harness: Claude Code 2.1.322 · model: claude-sonnet-5-5 |
Independent review (Codex CLI v0.164.0 / gpt-6.1-sol), reviewer session 01a1ceea-f16c-7ff3-bbfd-e4877568bafc, reviewed head 20f6d3e
This is a blind code-only review by a session other than the PR author's, copied below from the reviewer's report with only the grading metadata removed. The posting agent did not re-run the reviewer's commands. A MERGE verdict is advice; merging is left to the maintainers. CI: green Riskmedium-low (ML7: additive, documented Maxwell model, port and sweep APIs; existing entry points and defaults are unchanged). Blocking findingsNone identified in the delta. Both prior P2 cases have passing regression tests in this run: retained fields remain independent when the solver reuses its output buffer, and lossy dielectric port materials are rejected. The cutoff, partial PEC, boundary overlap, point-location, empty-sweep and zero-frequency regressions also pass.
Non-blocking findings
What I ranReview produced by codex-cli 0.164.0, model gpt-6.1-sol; the session ID above is local, with no session URL available. Risk was assessed without reading an author rating.
What I did not verify
🤖 Posted by an AI agent — harness: Claude Code 2.1.322 · model: claude-sonnet-5-5 |
Validation consumed one-pass iterators such as Iterators.Stateful before assembly, leaving the model with no ports. The ports are now collected into a vector and reused. Agent-Harness: Claude Code 2.1.322 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
|
Follow-up to the latest review on head Codex review of the branch approved with no open findings, and all named CI checks are green on this head. Merge commits only; no rebase or force-push. 🤖 Posted by an AI agent · harness: Claude Code 2.1.322 · model: claude-sonnet-5-5 |
Below cutoff the incident mode carries no real axial power, so its coefficients are generalized traveling-wave coefficients rather than power waves. The docstrings, the manual and the normalisation comment now say so, and a test integrates the axial flux of the projected incident mode above and below cutoff. No behaviour change. Agent-Harness: Claude Code 2.1.322 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
The function is not exported. Agent-Harness: Claude Code 2.1.322 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.322 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
PR: #75 Reviewed head: e734b27 Risk assessment
Review reportVERDICT: MERGE Riskmedium-low (ML7: additive, documented and tested Maxwell API, with existing entry points and defaults unchanged in the diff). Blocking findingsNone.
Non-blocking findingsNone. No confirmed numerical, interface or rule violation was found. Inspection found independent analytic references and no weakened or deleted test assertions. What I ranReview performed by codex-cli 0.164.0, model gpt-6.1-sol, without reading PR discussion, author ratings or earlier reviews. All Julia runs preserved the supplied layered JULIA_DEPOT_PATH and used the requested TMPDIR. Environment generation and probes stayed in scratch; the reviewed checkout remained clean. There is no tracked Manifest.toml, Julia interpreter pin, uv.lock or Python project. I instantiated an exact HEAD archive in
What I did not verifyOther test groups, QA, documentation build, older supported Julia versions and performance benchmarks. No lockfile was available to reproduce a preselected dependency environment. CI status is supplied by the task; I did not inspect GitHub. No GitHub operations or checkout edits were performed. AUTHOR_GRADE: {"task":"feature","score":5,"difficulty":4,"rounds":4,"author_harness":"Claude Code 2.1.322","author_model":"claude-sonnet-5-5","note":"The full Maxwell group passed 152 assertions and independent probes passed 11 assertions covering analytic fields, units, unequal port impedances, reciprocity, conservation and geometry/orientation invariance. No defect was confirmed; broader suites and documentation builds were not rerun."} Head link: e734b27 🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol |
…ive permittivity; positive frequencies only The absorbing coefficient took the principal square root, which is the incoming branch for a negative real eps_r/mu_r with no loss and jumped when a vanishing loss was added; it now takes the limit from the lossy side. A wave port's propagation constant squares omega, so a negative frequency returned the same S instead of its conjugate; wave ports and sweeps now reject non-positive frequencies before any solve. Agent-Harness: Claude Code 2.1.322 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
For a lossless negative real eps_r/mu_r the coefficient chose the same root at both signs of omega, so the operator at -omega was not the conjugate of the one at omega; the root is now the limit from the lossy side at each sign. Agent-Harness: Claude Code 2.1.322 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
…f eps_r, mu_r and omega The lossless root now follows the passive limit for negative permeability too, y = -i sign(omega) sign(mu_r) sqrt(|eps_c/mu_r|) where eps_c/mu_r is a negative real, with a table regression over the sign combinations and the decaying-exterior check. A wave port's term in the operator path now rejects non-positive frequencies like the sweeps, since its propagation constant depends on omega squared. Agent-Harness: Claude Code 2.1.322 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
The operator is finite at omega = 0, where an existing adjoint test evaluates it; only the S-parameter normalisation is singular there, and the sweeps keep rejecting zero. Agent-Harness: Claude Code 2.1.322 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
A port filled with a double-negative or single-negative material has an outward power that does not follow beta/mu_r, so the port injects energy and the transmission phase has the wrong sign; such a port is now an ArgumentError at construction, documented with the real-permittivity requirement. Agent-Harness: Claude Code 2.1.322 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
PR: #75 Reviewed head: fcb0262 Risk assessment
Review reportVERDICT: CHANGES Riskmedium-low (ML7: additive exported Maxwell model, driven-solve and scattering APIs). Blocking findings
Non-blocking findingsNone. What I ranIndependent blind review produced by an AI agent using codex-cli 0.164.0, model gpt-6.1-sol, in the local session identified above (no session URL available). Inspected the checkout, All Julia execution used a clean
What I did not verifyThe full All suite, documentation build, formatter, other supported Julia versions, or live CI status. CI status above is supplied by the task. I did not read PR descriptions, comments, reviews, author risk ratings, earlier same-head reviews or sibling review artifacts. No deferred-issue evidence was supplied or inspected. AUTHOR_GRADE: {"task":"feature","score":3,"difficulty":5,"rounds":5,"author_harness":"Claude Code 2.1.322","author_model":"claude-sonnet-5-5","note":"All 212 Maxwell and 21 QA assertions pass, but an independent lossless single-mode taper probe demonstrates persistent 22.8% artificial power loss from the port boundary formulation."} Head link: fcb0262 🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol |
The propagating admittance acted on the whole tangential mass of the port face, so the evanescent higher modes absorbed real power: a lossless taper, dielectric insert and short inclusion lost 23%, 11% and 27% of the incident power. The port term is now the rank-one p p^T / norm of the TE10 projection (the same one s_parameters and the excitation use), which couples the dofs of the face and adds them to the model's sparsity pattern; the complement keeps the natural boundary condition, so power is conserved. Frequencies that are not finite are rejected with one predicate, and the single-mode limitation is documented. Agent-Harness: Claude Code 2.1.322 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
PR: #75 Reviewed head: dfef81e Risk assessment
Review reportVERDICT: MERGE Riskmedium-low (ML7: additive, documented Maxwell model, driven-solve and scattering APIs; existing entry points and defaults are unchanged). Blocking findings
None. The prior P1 artificial-loss finding is resolved, confirmed by running the same independent lossless-taper probe on both heads. For mesh refinements n = 2, 4, 6, outgoing power on the prior head was 0.7712156626, 0.7716377178, 0.7719758895; on this head it is 1 within 1.4e-15. Full scattering-matrix unitarity errors are at most 3.0e-15, including both excitation columns and their cross terms. The implementation explicitly documents the reflected evanescent complement and uniform-lead limitation. Non-blocking findings
What I ranReview produced by an AI agent using codex-cli 0.164.0, model gpt-6.1-sol, in the local session identified above (no session URL available). Inspected the whole PR diff for context and the supplied delta against fcb0262. Recorded the independent risk in this report before reading the explicitly supplied prior-head All commands first set TMPDIR to this review workspace's
What I did not verifyThe full All suite, documentation build, formatter, other supported Julia versions, benchmarks, or live CI and its failures. The non-green CI state is supplied by the task and remains a separate merge gate. No committed locked Julia environment was available. I did not read PR bodies, comments, author risk ratings, earlier same-head opinions or sibling review directories. The supplied prior-head review was the explicitly requested re-review context; no second review was launched. AUTHOR_GRADE: {"task":"feature","score":4,"difficulty":5,"rounds":6,"author_harness":"Claude Code 2.1.322","author_model":"claude-sonnet-5-5","note":"The prior artificial-loss blocker is independently reproduced before the delta and resolved afterward. All 223 Maxwell, 21 QA and 27 targeted probe assertions pass; two non-blocking model docstrings need alignment with the expanded pattern and modal boundary term. Live CI remains unverified and is supplied as non-green."} Head link: dfef81e 🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol |
…es of a model block The port term is i beta L / mu_r p p^T / norm on the widened pattern, so a matrix from Ferrite.allocate_matrix no longer has the model's pattern. Agent-Harness: Claude Code 2.1.322 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
The comment now states the boundary residual +(i beta/mu_r) c e - 2 (i beta/mu_r) E0 e that the operator and load implement. Agent-Harness: Claude Code 2.1.322 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
PR: #75 Reviewed head: f836a5d Risk assessment
Review reportVERDICT: MERGE Riskmedium-low (ML7: additive public Maxwell API, documented and exercised against analytic solutions; existing entry points remain unchanged). Blocking findingsNone confirmed.
Non-blocking findingsNone. What I ranIndependent blind review by codex-cli 0.164.0, model gpt-6.1-sol; the Session above is the actual local session ID (no session URL available). No author rating, PR discussion or earlier review was read. Julia 1.13.2; Ferrite 1.7.0. Commands used isolated scratch environments developed against this checkout, preserving the supplied layered
What I did not verifyRemote CI, other test groups, documentation build, formatter/spelling jobs, Julia 1.10 or other platforms. The supplied non-green CI status remains a merge gate. No checkout files were edited and nothing was posted to GitHub. AUTHOR_GRADE: {"task":"feature","score":5,"difficulty":4,"rounds":7,"author_harness":"Claude Code 2.1.322","author_model":"claude-sonnet-5-5","note":"223 affected assertions and 21 QA checks passed; independent unit/frame, analytic global-convergence, dissipation and reuse probes found no confirmed blocker."} Head link: f836a5d 🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol |
Add discrete adjoint material sensitivities for Maxwell S-parameters Antenna and filter optimisation needs gradients of S-parameters with respect to material parameters. A(omega) is complex symmetric, so the adjoint of each wave port's output is the forward field with that port driven: s_parameter_sensitivities gives dS/dp for eps_r, Im eps_r, mu_r and sigma of named cell sets from the sweep's fields with no extra solve, including the absorbing boundary's dependence on the adjacent material. adjoint_gradient covers real field functionals with one adjoint solve through the pluggable solver interface. Validated against central finite differences of the forward sweep (relative agreement 1e-10 to 2e-8) and against the closed-form WR-90 dielectric slab. Agent-Review: unreviewed Merge maxwell/3-sweep-abc into maxwell/8-adjoint (PR workflow triggers) Agent-Review: unreviewed Merge forge/mwsync-3-sweep-abc into maxwell/8-adjoint Agent-Review: unreviewed Merge forge/mwsync-3-sweep-abc into 8-adjoint Agent-Review: unreviewed Merge forge/mwsync-3-sweep-abc into 8-adjoint Agent-Review: unreviewed Adjoint sensitivities: reject nonsymmetric added terms The adjoint of a port is its forward field, and the adjoint solve uses A, only when A is symmetric; add_term! accepts any block of the right pattern, so the three entry points now check the blocks are symmetric and throw an ArgumentError otherwise. Agent-Review: unreviewed Adjoint sensitivities: scale-free symmetry check The absolute floor accepted a tiny nonsymmetric block with a huge coefficient; the check is now relative to the block. Agent-Review: unreviewed Adjoint: absorbing coefficient derivative is 0 at omega = 0 Consistent with the forward absorbing coefficient. Agent-Review: unreviewed Merge forge/mwsync-3-sweep-abc into 8-adjoint Agent-Review: unreviewed Merge forge/mwsync-3-sweep-abc into 8-adjoint Agent-Review: unreviewed Adjoint: check symmetry on the free dofs only A large symmetric entry on a constrained dof could hide a nonsymmetric free operator, so the sensitivities accepted models whose adjoint is wrong. The relative skew is now measured on the unconstrained sub-block, with the same tolerance. Agent-Review: unreviewed Merge forge/mwsync-3-sweep-abc into 8-adjoint Agent-Review: unreviewed Merge forge/mwsync-3-sweep-abc into 8-adjoint Agent-Review: unreviewed Merge forge/mwsync-3-sweep-abc into 8-adjoint Agent-Review: unreviewed Merge forge/mwsync-3-sweep-abc into 8-adjoint Agent-Review: unreviewed Adjoint: differentiate the outgoing-branch absorbing admittance The absorbing term now takes the outgoing root for a lossless negative eps_r/mu_r; the derivative uses the same branch. Agent-Review: unreviewed Merge forge/mwsync-3-sweep-abc into 8-adjoint Agent-Review: unreviewed Adjoint: the absorbing admittance derivative follows the sign of omega Uses the same outgoing branch as the operator. Agent-Review: unreviewed Merge forge/mwsync-3-sweep-abc into 8-adjoint Agent-Review: unreviewed Merge forge/mwsync-3-sweep-abc into 8-adjoint Agent-Review: unreviewed Merge forge/mwsync-3-sweep-abc into 8-adjoint Agent-Review: unreviewed Merge forge/mwsync-3-sweep-abc into 8-adjoint Agent-Review: unreviewed Merge forge/mwsync-3-sweep-abc into 8-adjoint Agent-Review: unreviewed Merge forge/mwsync-3-sweep-abc into 8-adjoint Agent-Review: unreviewed Agent-Harness: Claude Code 2.1.318 Agent-Model: claude-opus-5-5 Agent-Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5 Co-authored-by: Claude Code <agent@noreply.juliahub.com> Agent-Harness: Claude Code 2.1.319 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Harness: Claude Code 2.1.322
Depends on #74 (this PR targets its branch, so the diff shows only this layer; it will be retargeted to
masteronce #74 merges).Adds rectangular-waveguide TE10 wave ports, a first-order Silver-Müller absorbing boundary and a frequency sweep returning S-matrices to the frequency-domain
MaxwellModel.What's added
MaxwellModel(grid; ..., absorbing = ["outer"], ports = [WavePort("p1"; a_direction = (1, 0, 0))]).+i k0 L ∮ sqrt(εc(ω)/μr) (n×Nᵢ)⋅(n×Nⱼ) dSwithεc = εr − iσ/(ωε0)of the adjacent material (one facet block per adjacent material), so conducting media next to the boundary are handled.+i (β(ω)/μr) L ∮ (n×Nᵢ)⋅(n×Nⱼ) dSand drives the load2i(β/μr) L ∮ e⋅Nᵢ dS(exp(+iωt)).WavePort: the TE10 modeê sin(πξ/a)is built from the facet set's rectangle. The broad-wall direction is explicit, the field direction optional, and an optionaldeembeddistance moves the reference plane. Below cutoff the port uses the evanescent branchβ = −iα. Port geometry is checked (coplanar, rectangular, one non-conducting material, PEC rim, face not itself PEC) with clearArgumentErrors.solve_sweep(model, omegas; fields = false, solver = umfpack_solver)keeps one complex operator and recombines its nonzeros per frequency, reuses the UMFPACK symbolic factorisation (lu!), and solves every port excitation from one factorisation. The solver is a function(A, B, cache) -> (X, cache)so other backends can plug in.S_ij = p_iᵀu_j / P_i − δ_ijwith power-wave normalisation throughZ_TE = ωμ0μr/β. The mode norm isP = pᵀB⁻¹p, the norm of the L²-projected mode on the port's free edge dofs, which keeps excitation and extraction consistent with the discrete trace space (using∫e⋅einstead costs about 1% in amplitude at h = 2 mm).tangential_mass(model, facetsets; weight)is a helper for further facet blocks.Validation (WR-90, a = 22.86 mm, b = 10.16 mm, 10 GHz; Maxwell group)
Also tested: reciprocity (S12 = S21 to 1e-8), losslessness to 1e-3, β = 158.238 rad/m and f_c = 6.557 GHz from the mode code, de-embedding, invalid-port errors, and that a sweep equals independent single-frequency solves. One frequency at 29k dofs with two right-hand sides takes 0.4 s. Maxwell group 133 tests (~2 min), QA 21/21.
Docs: a "Wave ports, absorbing boundaries and frequency sweeps" section in
docs/src/maxwell.md.Review pointers
pᵀB⁻¹p(above) is the main modelling choice; it leaves a small positive bias in S11 of the empty guide (3.8e-3 at 2 mm, 1.0e-3 at 1 mm, roughly O(h²)).sqrt(P_i Z_j / (P_j Z_i)); no test uses dissimilar guides yet.🤖 Posted by an AI agent · harness: Claude Code 2.1.318 · model: claude-opus-5-5
Review: unreviewed
Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5