Skip to content

[12/13][Adjoint Module] Scalable Pade extrapolation for DFT monitors - #3294

Draft
smartalecH wants to merge 2 commits into
feat/adjoint-dispersive-smoothingfrom
feat/adjoint-pade-dft
Draft

[12/13][Adjoint Module] Scalable Pade extrapolation for DFT monitors#3294
smartalecH wants to merge 2 commits into
feat/adjoint-dispersive-smoothingfrom
feat/adjoint-pade-dft

Conversation

@smartalecH

@smartalecH smartalecH commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Stacked on the dispersive-smoothing PR. Addresses #3217.

Accumulates the DFT as usual and extrapolates its tail from the last n samples, which both shortens the run and gives a convergence error estimate that stop_when_dft_pade_converged can act on. On a real grating this is ~14% fewer timesteps at matched accuracy.

The estimate is aggregated across monitors and ranks weighted by field magnitude rather than by a max over independently normalised ratios. A component that is near zero for a symmetry reason -- Ey under a y mirror, say -- otherwise has a meaningless ratio that vetoes convergence for everything else; the aggregate went from 3.4e-1 to 1.7e-2 on the case that motivated this.

Also lets a rank place no adjoint source at all. The old assertion was a local check on a globally true condition, so a point monitor landing outside a given rank's chunk deadlocked under MPI.

Accumulate the DFT as usual and extrapolate its tail from the last n samples,
which both shortens the run and yields a convergence error estimate that
stop_when_dft_pade_converged can act on.

The estimate is aggregated across monitors and ranks weighted by field
magnitude rather than by taking a max over independently normalised ratios: a
component that is near zero for a symmetry reason (Ey under a y mirror, say)
otherwise has a meaningless ratio that vetoes convergence for everything else.

Also lets a rank place no adjoint source at all.  The old assertion was a local
check on a globally true condition, so a point monitor that landed outside a
given rank's chunk deadlocked under MPI.
@smartalecH
smartalecH force-pushed the feat/adjoint-pade-dft branch from 1ea5b31 to ae4e1ec Compare September 4, 2026 17:32
This PR's meepgeom.cpp changes were assembled file-wise and carried a function
reordering along with them, putting ivec_in_box, matching_dft_chunk and
forward_dft_value below geometry_addgradient, which calls them.  Nothing
depended on the order until geometry_addgradient started using those helpers
lower in the stack, at which point rungs from here up stopped compiling.

Move them back ahead of their caller.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant