Repository navigation
Add a Cartesian UPML to the Maxwell model - #78
xtalax-droid wants to merge 25 commits into
Conversation
CartesianPML turns named cell sets outside an axis-aligned box into the uniaxial absorber Lambda = diag(sy sz/sx, sx sz/sy, sx sy/sz) with frequency-independent stretching s = 1 - i alpha, graded as (xi/d)^m with alpha_max from a target reflection R at a reference frequency. Frozen stretching keeps every term a real block with a polynomial coefficient in omega, so sweeps still only recombine values; on WR-90 it reflects 0.002-0.004 over 8-12 GHz, within about 20% of a layer re-tuned per frequency. 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>
JET's typo mode reported lo and hi as possibly undefined in the stretching closure when they were assigned in two branches. 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 01a1c8d1-509f-7910-9f07-12099a694398, reviewed head 7bc0939
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, documented Maxwell public API; 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. The session ID above came from
What I did not verify
🤖 Posted by an AI agent — harness: Claude Code 2.1.322 · model: claude-sonnet-5-5 |
docs/src/maxwell.md conflict resolved keeping both sections. 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>
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 The CI trigger edits (PR base filters) live in #74 rather than here. 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 01a1ceeb-4280-7743-bb7c-0a02cebadee6, reviewed head acd2351
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 Maxwell public API; existing entry points and defaults are unchanged). Blocking findingsReview in progress; validation pending. Non-blocking findingsPending validation. What I ranPending completion. What I did not verifyPending completion. 🤖 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>
|
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 |
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: #78 Reviewed head: 66a3f0a Risk assessment
Review reportVERDICT: CHANGES Riskmedium-low (ML7: additive, documented and tested Maxwell API; existing entry points and defaults are unchanged). Blocking findings
Non-blocking findingsNone in the delta. The prior docstring mismatch is addressed at What I ranAI reviewer: codex-cli 0.164.0, model gpt-6.1-sol; actual local session ID above, no session URL available.
What I did not verify
AUTHOR_GRADE: {"task":"feature","score":4,"difficulty":4,"rounds":4,"author_harness":"Claude Code 2.1.322","author_model":"claude-sonnet-5-5","note":"All 174 Maxwell assertions and 35 targeted probes passed. The one-pass iterator regression fails on the preceding head and passes on this head with identical dependencies. The docstring clarification is addressed, but the prior non-public Ferrite API blocker remains in two test assertions."} Head link: 66a3f0a 🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol |
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>
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>
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 stretching used the positive-frequency signs at every omega, so at negative omega the layer amplified the outgoing wave; the imaginary blocks now change sign with the frequency, giving A(-omega) = conj(A(omega)) and leaving the omega = 0 operator unchanged. 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 01a1d18b-7536-77d1-be8a-bb127c0ecf92, reviewed head 1755c74
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: CI is not green Riskmedium-low (ML7: additive, documented and tested Maxwell API; existing master entry points and defaults are unchanged). Blocking findings
Non-blocking findingsNone. The round-4 blocker is resolved: the two non-public Ferrite calls were replaced with independent geometry and tangential-trace assertions. The rewritten model tests pass. What I ranReviewer: codex-cli 0.164.0, model gpt-6.1-sol, actual local session ID above (no session URL available).
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 negative omega the imaginary block of eps_r (Lambda - 1) was flipped as a whole, which conjugated the supplied permittivity too, so a complex permittivity and the equivalent conductivity assembled different operators. The permittivity blocks are now split by the real and imaginary parts of eps_r and of the stretching, and only the stretching changes 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>
For a negative-index filling the outward-power wave has a negative phase wavenumber and the stretching s = 1 - i alpha amplifies it, so such a PML is rejected at construction, consistent with the wave-port decision. 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>
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: #78 Reviewed head: 9474fa1 Risk assessment
Review reportVERDICT: MERGE Riskmedium-low (ML7: additive, documented Maxwell API; existing entry points unchanged; analytic convergence and waveguide tests pass). Blocking findingsNone. The observations below concern extreme mesh conditioning, invalid-input guards, and documentation; they do not invalidate the exercised solver paths.
Non-blocking findingsAll four observations were confirmed by running scratch probes.
What I ranReviewer: codex-cli 0.164.0, model gpt-6.1-sol. No PR body, comments, reviews, earlier opinions, or author risk rating were read. No checkout edits or GitHub writes were made.
With GROUP=Maxwell julia --startup-file=no --project="$R/scratch/env" test/runtests.jl
julia --startup-file=no --project="$R/scratch/env" "$R/scratch/probes.jl"
julia --startup-file=no --project="$R/scratch/env" "$R/scratch/edgecases.jl"
julia --startup-file=no --project="$R/scratch/env" "$R/scratch/tangential_reference.jl"
What I did not verifyFull-package/QA tests, documentation build, formatter, other Julia versions, extensions, benchmarks, or remote CI. No project-locked interpreter/dependency environment is supplied; Julia verification used the scratch resolution described above. No independent accuracy claim is made for extreme-aspect-ratio meshes. CI remains non-green as supplied; MERGE is code-review advice, not merge authorization. AUTHOR_GRADE: {"task":"feature","score":4,"difficulty":5,"rounds":7,"author_harness":"Claude Code 2.1.322","author_model":"claude-sonnet-5-5","note":"252 affected assertions and 7 targeted assertions pass, including analytic convergence, guide scattering, power conservation, and unit scaling. Four non-blocking conditioning, validation, and documentation observations were reproduced; full CI and QA were not verified."} Head link: 9474fa1 🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol |
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 PML blocks depend on the supplied material in the layer, but the parameter derivative assembled only the isotropic terms, so the sensitivity of a region reaching into the PML differed from finite differences. The model records its PML cell sets and all three entry points reject an overlapping region, documented in the adjoint docstring and the manual. 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>
Depends on #75 (this PR targets its branch, so the diff shows only this layer; it will be retargeted once the layers below merge).
Adds
CartesianPML, apmlkeyword onMaxwellModelthat turns named cell sets outside an axis-aligned box into a PEC-backed uniaxial perfectly matched layer.What's added
Λ = diag(s_y s_z/s_x, s_x s_z/s_y, s_x s_y/s_z)multipliesεrandσ, andΛ⁻¹multiplies1/μr, withs_j = 1 − iα_j(exp(+iωt)).α = α_max (ξ/d)^mwithα_max = −(m+1) ln R / (2 k_ref d). Each face's thickness is inferred from the cells (the inner box defaults to the bounding box of the non-PML cells), or the innerboxcan be given.α = σ/ω_ref): every term stays a real block on the shared pattern with a polynomial coefficient inω, sosolve_sweepstill only recombines values. The layer enters as correction blocks (real and imaginary parts of the curl, permittivity and conductivity terms), somodel.blocksis unchanged.Λis diagonal, so the operator stays complex symmetric.Validation (
test/Maxwell/pml.jl)WR-90 with one wave port and a 20 mm PEC-backed layer (h = 2 mm, 11k dofs, reference 10 GHz):
against 0.1396 for the first-order ABC. The floor is the discrete reflection of the graded layer, not R: |S11| = 8.2e-3, 4.0e-3, 2.6e-3, 1.0e-3 at h = 3, 2, 1.5, 1 mm, and 1.8e-2 to 2.0e-3 for d = 8 to 30 mm, while R from 1e-3 to 1e-10 moves it only between 2.2e-3 and 5.3e-3.
A conducting filling continued through the layer matches the closed-form interface reflection to 2.2e-3 (σ is stretched by Λ too).
A radiating source in a PML-truncated vacuum box (λ/10 mesh, 21k dofs, oblique incidence and corners included) matches a larger-domain reference to 1.9%, against 8.5% for the ABC and 173% for a PEC box.
The operator is complex symmetric and not Hermitian.
Maxwell group 155/155, QA 21/21.
Docs: a "Perfectly matched layers" section in
docs/src/maxwell.mdwith the trade-off and the measured numbers.Review pointers
1, i, −k²ω², −ik²ω², iμ0L²ω, −μ0L²ω.addcellset!(grid, name, f)) that includes inner cells touching the box is rejected with an error naming the cell.🤖 Posted by an AI agent · harness: Claude Code 2.1.318 · model: claude-opus-5-5
Review: unreviewed
Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5