Add radial background periodization#178
Open
krystophny wants to merge 4 commits into
Open
Conversation
8d4b7e4 to
57b4ad0
Compare
57b4ad0 to
4671fb1
Compare
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.
Second split item of #175: the radial periodization of the background.
periodize_m(KIM/src/background_equilibrium/periodize_m.f90) provides theC-infinity localizer weight and the periodized profile value for a tabulated
profile: untouched inside the resonant layer
|r - r_m| <= dr_layer, blendedwith its period-shifted copies in the transition zones, periodic with
L = 2 (dr_layer + dr_transition).Stack: parent branch
feat/flux-pumping/wp5-kernel-restoreat3959cf6c(#177); this PR's diff is cumulative until the parent merges. Pipeline
integration behind a config switch is the fourth split item; nothing calls
the new module yet.
Invariant preserved
weight
exp(-2 pi/(1-t) exp(-sqrt(2)/t))with clamped ends, wrap into[r_m - L/2, r_m + L/2), then the two shifted-copy blends.the layer is left unmodified, the result is exactly L-periodic, values
and derivatives through order 4 are continuous at the seam, and the
localizer's derivatives vanish at both transition ends.
gradient differs in the transition zone (also part of the CAS record).
The module documents that ordering constraint.
binsrc/plag_coeffLagrange interpolation; the tabulation must cover three half-periods on
each side of
r_m, guarded by explicit errors.Verification
Test fails on a degraded localizer (linear blend mutation)
Test passes after restore
Full suite
Checks: resonant layer unmodified (4-point Lagrange exact on the quadratic
profile, 1e-12 relative), exact L-periodicity across five periods, an
already-L-periodic profile passes through unchanged (1e-8), and one-sided
finite-difference slopes agree at the period seam and at the layer edge
(1e-3 relative, against an O(1) kink for a non-smooth blend).
Relation to Markus's Fokker-Planck periodic branch
This PR is an independent implementation of the C-infinity periodizer. Compare its seam, derivative, and untouched-layer behavior with
feature/kim-forced-periodicity; do not retain two hidden periodizers. Multispecies preservation is specified in #186 and the final selection belongs to #191.