Add periodic Fourier kernel assembly and solve#179
Open
krystophny wants to merge 5 commits into
Open
Conversation
This was referenced Jul 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third split item of #175: the discrete solve on the periodized modes.
fourier_periodic_m(KIM/src/fourier_periodic/fourier_periodic_m.f90)provides the mode grid
k_m = 2 pi m / L, the matrix elementsK_{m,m'} = (2 pi / L)times the one-period equidistantr_gquadrature ofthe restored kernels, the dense LAPACK solve of the screened Poisson system
(k_m^2 delta - 4 pi K^{rho Phi}) Phi = rhs, and the inverse expansionf(r) = sum_m f_m exp(i k_m r).Stack: parent branch
feat/flux-pumping/wp5-periodizationat4671fb10(#178), on top of #177; the diff is cumulative until the parents merge.
Driver integration behind a config switch and the hat-basis/Vaclavik
benchmarks are the remaining split items; nothing calls this module yet.
Invariant preserved
expansion use the same
exp(i k r)convention as theexp(i (k_r - k_r') r_g)factor inside the kernels, so the uniformbackground is exactly diagonal through discrete Fourier orthogonality
of the equidistant midpoint rule (exact for
|m - m'| < N_quad).-sum_s lambda_{D,s}^{-2} / (4 pi), so the system matrix carriesk_m^2 + sum_s lambda_{D,s}^{-2}: the sign convention of the historicalk-space Debye demonstrator. The kinetic term regularizes the
k_0 = 0mode, so no separate gauge handling is needed.
periodic integrand; no interpolation, truncation, or padding enters.
Verification
Test fails on the flipped kinetic sign
Test passes after restore
Full suite
Checks (1e-12 relative): centered mode grid, exact uniform diagonality,
adiabatic screening diagonal on every mode, the screened point-charge
solve against the analytic per-mode solution, L-periodicity of the
expansion, and a real potential at the charge location. Quadrature
convergence on a radially varying background is exercised in the driver
integration item, where real profiles enter.
Relation to Markus's Fokker-Planck periodic branch
This PR assembles and solves the restored Krook kernels. Its mode-grid, quadrature, dense-solve, and manufactured-Debye tests may be reusable infrastructure, but its kernel and Poisson conventions are not an authority for the FP branch. The matched FP boundary-value problem is #188; final selection is #191.