Repository navigation
Add near-to-far-field transform and half-wave dipole validation - #81
xtalax-droid wants to merge 27 commits into
Conversation
far_field, radiated_power and directivity transform a MaxwellSolution on a closed interior facet set (Love's currents J = n x H, M = -n x E, outward side away from a centre, H averaged over both cells), validated against the exact radiation of a small current ball. examples/dipole meshes a strip dipole with a lumped-port gap, a Huygens sphere and an absorbing sphere through Gmsh physical groups and finds its resonance, impedance, directivity and pattern; a coarse case runs in the Maxwell group and the full one with FEM_MAXWELL_DIPOLE=1. 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>
Measured: togrid takes about 17 s at 1.8e5 cells, not hours. 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>
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-aeb2-7ac1-b5f4-a4c02df735db, reviewed head a6d4f66
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 Maxwell public API; existing entry points and defaults are unchanged). Independently assessed from the diff without reading an author rating. Blocking findings
Non-blocking findingsNone. What I ran
What I did not verifyJulia 1.10/1.12 or prerelease compatibility, the other test groups including QA, documentation build, and the opt-in full dipole run ( 🤖 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>
…errite API 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>
|
Review feedback on this PR has been addressed on head Stacked on #79. 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-7c45-77d1-a275-167668d79684, reviewed head 353da16
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). Independent risk recorded before any author rating; verification is in progress. Blocking findingsVerification in progress. Non-blocking findingsVerification in progress. What I ranVerification in progress. What I did not verifyVerification in progress. 🤖 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>
|
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 |
PR: #81 Reviewed head: 6f7ad12 Risk assessment
Review reportVERDICT: CHANGES Riskmedium-low (ML7: additive Maxwell public API with existing package entry points and defaults unchanged). Independent assessment; no author risk rating was read. Blocking findings
Non-blocking findings
What I ran
What I did not verifyOther test groups including QA; documentation build; the opt-in full dipole run; other Julia versions; full default-branch regression comparison. CI green is supplied metadata, not independently inspected. No GitHub state or P2-deferral issue evidence was consulted. No fixes, checkout edits, commits, pushes, GitHub posts, approvals, or merges were made. 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 247 affected-suite assertions pass. The three delta assertions fail or error on the prior head and pass on this head; 50 targeted probes pass. The prior below-cutoff power-wave documentation blocker remains confirmed by an independent Poynting-flux calculation."} Head link: 6f7ad12 🤖 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>
Replaces a non-public Ferrite function with the package's own facet node table, which test/Maxwell/model.jl checks against the geometry. 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>
PR: #81 Reviewed head: 841183e Risk assessment
Review reportVERDICT: MERGE Riskmedium-low (ML7: additive Maxwell public API; existing package entry points and defaults remain unchanged). Independent assessment; no author risk rating was read. Blocking findingsNone. The prior below-cutoff power interpretation blocker is resolved: the manual, port and sweep docstrings, and normalization comment distinguish propagating power waves from evanescent coefficients. Independent facet integration confirms the distinction. The prior zero-frequency explanation is also corrected.
Non-blocking findingsNone. What I ran
What I did not verifyOther test groups, including QA; documentation build; opt-in full dipole run; other Julia versions; full default-branch regression comparison. CI status is supplied metadata, not independently inspected; its non-green state remains a merge gate. No GitHub state or issue-deferral evidence was consulted. No checkout edits, fixes, commits, pushes, GitHub posts, approvals or merges were made. AUTHOR_GRADE: {"task":"feature","score":5,"difficulty":4,"rounds":5,"author_harness":"Claude Code 2.1.322","author_model":"claude-sonnet-5-5","note":"The prior power-interpretation blocker and zero-frequency explanation are resolved. All 310 affected-suite assertions and 171 targeted probes pass. Fifteen delta regression assertions fail on the prior head and pass on this head; independent analytic convergence and Poynting-flux calculations support the numerical behavior."} Head link: 841183e 🤖 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>
PR: #81 Reviewed head: af48c13 Risk assessment
Review reportVERDICT: CHANGES Riskmedium-low (ML7: additive, documented Maxwell public API on a separate solver path) Blocking findings
Non-blocking findings
What I ran
What I did not verify
AUTHOR_GRADE: {"task":"feature","score":4,"difficulty":4,"rounds":6,"author_harness":"Claude Code 2.1.322","author_model":"claude-sonnet-5-5","note":"321 affected assertions and five independent numerical invariants passed. One new dependency access is not declared public under the supplied author rule; the theta-quadrature comment overstates its convergence order."} Head link: af48c13 🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol |
…eta rule is second order The Gmsh grid helper read the facets of a tetrahedron through Ferrite.facets, which is not public; it uses the local node indices of the four facets in Ferrite's order instead. The far-field midpoint rule in theta converges at second order, not spectrally; only the periodic phi rule can be spectral. 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: #81 Reviewed head: df73abc Risk assessment
Review reportVERDICT: MERGE Riskmedium-low (ML7: additive, documented Maxwell public API on a separate solver path) Blocking findings
None. The prior blocker at Non-blocking findingsNone. The revised comment at What I ran
What I did not verify
AUTHOR_GRADE: {"task":"feature","score":4,"difficulty":4,"rounds":7,"author_harness":"Claude Code 2.1.322","author_model":"claude-sonnet-5-5","note":"The delta resolves the prior non-public dependency access and corrects numerical explanations. All 321 affected assertions and 21 independent delta probes passed, including exact agreement with the public mesh converter on rotated and shared-interface meshes. Full QA, documentation and remote CI remain unverified."} Head link: df73abc 🤖 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>
Depends on #79 (this PR targets its branch, so the diff shows only this layer; it will be retargeted once the layers below merge).
Adds a near-to-far-field transform for
MaxwellModelsolutions and validates it on a Hertzian source and on a strip dipole fed by a lumped port, meshed with Gmsh physical groups.API
far_field(sol, surface, directions; center)returnsE_theta,E_phiofr e^{ikr} E(exp(+iωt)), from Love's equivalent currentsJ = n × HandM = −n × Eon a closed interior facet set (the Huygens surface).radiated_power(sol, surface; method = :flux | :far_field)integrates the Poynting flux through the surface or the radiation intensity over the sphere.directivity(sol, surface, directions)returns4πU / P_far.The surface must be closed, in vacuum, clear of PEC and star-shaped about
center; each condition is checked with a clear error. H is the curl of E averaged over the two cells next to each facet.Validation
Hertzian source (uniform current ball of radius 0.05λ, ABC sphere at 0.75λ, Huygens sphere at 0.3λ, 2.1e4 dofs, Maxwell group): complex E_theta (phase included) within 1% of the exact radiation integral over three φ-cuts and 10–170°, E_phi below 0.5% of the peak, D = 1.505 (exact 1.5), P_far within 1.2% of exact. The flux exceeds the far-field power by 5%: that is the first-order ABC's reflection (about 1/(kR)²), which the outgoing far field does not see.
Strip dipole (
examples/dipole: PEC strip of width 4a with a = 0.005λ, 50 Ω lumped port in the gap, resonance found by a frequency sweep):FEM_MAXWELL_DIPOLE=1)The pattern, directivity and beamwidth agree closely. The resonant length (−2.2% against induced EMF) is still rising as the mesh at the strip is refined (0.437, 0.451, 0.454, 0.456λ), so it is mesh-limited at order 1. R at resonance is 16% above the induced-EMF value; induced EMF is known to under-estimate R for a wire this thick, so treat that reference as soft. The gated full test asserts D within ±0.1 dB, the pattern within 0.2 dB and power balance within 2%, not the impedance bands.
Maxwell group 222/222, QA 21/21.
Docs: a far-field and dipole section in
docs/src/maxwell.md.Review pointers
_far_fieldinsrc/maxwell/farfield.jl: signs and scale (E_θ = −ik/4π (L_φ + η N_θ),E_φ = +ik/4π (L_θ − η N_φ)), checked in complex form by the Hertzian test.examples/dipole/mesh.jlbuilds the grid from Gmsh directly (gmsh_grid) with a node-hash facet lookup:FerriteGmsh.togridmatches facets in O(facets × cells) (about 17 s at 1.8e5 cells, against 0.2 s here), and building a grid by hand fromtonodesassumes node tags are ingetNodesorder.🤖 Posted by an AI agent · harness: Claude Code 2.1.318 · model: claude-opus-5-5
Review: unreviewed
Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5