Split JOREK chart-fallback interpolation errors - #59
Conversation
abe6e93 to
52182b4
Compare
27ee88b to
6f30766
Compare
52182b4 to
764b68c
Compare
6f30766 to
2f952dc
Compare
There was a problem hiding this comment.
Review verdict: Approve
Summary: PR #59 adds a single commit on top of refs/slopqueue/base, touching only SRC/TESTS/test_jorek_poloidal_linearization.f90. It instruments the existing target-owner B-interpolation test to split samples whose target field touched the JOREK global (axis-regularized) chart ("fallback") from purely local-chart samples ("regular"), and emits per-bucket max/rms diagnostics plus a partition-consistency assertion. The change is test-only and consistent with the surrounding fixture.
Findings:
- minor
SRC/TESTS/test_jorek_poloidal_linearization.f90:316—prepare_sample_cornersnow callsjorek_chart_requires_globalfor every corner, butevaluate_owner_corner(called just below for the same corner target) already invokes the same pure test internally. This roughly doubles the per-sample global-chart probe cost (≈8 probes/sample across 769k samples). Impact is test runtime only (results unaffected since the arguments match exactly, sotarget_fallback(index)correctly mirrors the chart decision used for the target field). Optional: haveevaluate_owner_cornerreturn the flag, or compute it once and pass it in, to avoid the redundant evaluations.
No blockers or majors. The target_fallback(index) is computed with (data, element, sub_s(index), sub_t(index)), which exactly matches the chart test performed inside evaluate_owner_corner for both the owner == element (target = corner) and owner /= element (target via element) paths, so the split is semantically correct. The assertion fallback_samples + regular_samples == samples is guaranteed by construction and serves as a useful defensive check; split_metrics finiteness and the max(1, …) guards on the rms denominators are sound.
Verdict: Approve — the change is a clean, correct test instrumentation; the redundant global-chart probes are a minor efficiency note, not a correctness issue.
Purpose
PR #58 shows that target-element corner ownership does not remove the factor-8 interpolation failure. This PR tests the next possible cause: the bounded global fallback used when a target-element corner has an ill-conditioned local geometry chart.
The existing fixed-point diagnostic tags a covered sample when any of its three target-element triangle corners satisfies the production fallback criterion. It accumulates maximum and RMS target-element interpolation errors separately for fallback-tagged and regular samples. The numerical path is unchanged.
This PR is stacked on #58.
Numerical and physics invariants
Result
No covered sample uses a target-corner fallback through factor 4. At factor 8:
The fallback population contains the global worst case and has a larger RMS, so fallback placement matters locally. It is not the sole cause: the regular population still has a 19.87551% maximum.
Factor 8 covers 765,124 points, compared with 432,832 at factor 4. The next diagnostic should split the factor-8 error between points already covered at factor 4 and the 332,292 newly covered points. This tests population change before changing topology, chart handling, or interpolation.
Verification
Test fails on main
The parent diagnostic has no fallback population output:
Test passes after fix