Skip to content

Order across static 2:1 seams ​

IDGroupMilestoneTypeBackendsFigureRegression
AO (A1, C1, D1, D2)Seam accuracy and divergenceM6 (#68) · A1, C1, D1, D2PCPU, FNLyes—

Case and scope ​

A smooth vortex starts centred on the corner of a refined quadrant, so its core straddles an x seam, a y seam and their corner, and the free stream (1,1) carries it into the fine quadrant. The exact solution is the convected vortex, so the error is measured cell by cell, split into the seam band and the interior.

Every smooth order test (V2, MV-5 to MV-7 in order of accuracy) runs on a uniform grid; VV-8 measures a seam with dissipative waves. No test measured the inviscid order of a smooth feature crossing a seam, where the #68 audit (F1) predicts that the mean restriction of the coarse ghosts and the Berger–Colella reflux of point-value fluxes each cap the order at 2.

What the case catches:

  • a loss of order at the seams, in the band and in the regions the flow reaches after crossing a seam;
  • a degradation of the seam operators: the finest refined errors are bounded by the CPU baseline plus 2 %, so an improvement of the transfers or of the reflux passes and a degradation fails;
  • a broken instrument: the uniform control (no refined quadrant) must reach design order.

Phases C (high-order restriction), D (6-point coarse-to-fine fills) and E (reflux policy) of #68 are measured against these baselines; the legs euler-l6, euler-w6, euler-q6, euler-ww, euler-mp and euler-tq are their entries in the same ladder.

Models and numerics ​

ItemChoiceCode
Equations, eulercompressible Euler, ideal gas, γ=cp/cv=1.4models
Equations, mhdideal MHD with mixed GLM cleaning, γ=5/3, glm_ch 3.0, glm_alpha 0.18, glm_damping_length 1.0models; mhd_glm_face_split_fluxes, adam_flume_mhd_library.F90
SpaceWENO5 (weno-u-5) flux splitting on characteristic variablescompute_residuals_weno, adam_flume_cpu_object.F90; compute_face_split_fluxes, adam_flume_euler_library.F90
TimeSSP Runge–Kutta, 5 stages (runge-kutta-ssp-54), CFL 0.4adam_stepper_object.F90 (SELAH)
Fine-to-coarse ghosts[amr] seam_restriction: mean (default, the 2:1 mean), lagrange6 (C1), weno6 (C3)update_ghost_local, restrict_seam_high_order, adam_field_object.F90; seam_restriction_code, SEAM_W_LAGRANGE6, adam_seam_interpolation_library.F90; key read in initialize, adam_adam_object.F90
Coarse-to-fine ghosts[amr] seam_ghost_fill: tricubic (default), quintic (D1), weno6, quintic-mp (D2)interp_seam_ghost, adam_field_object.F90; seam_interpolate_tricubic, seam_interpolate_quintic, adam_seam_interpolation_library.F90
RefluxBerger–Colella, [numerics] reflux = .true.; reflux_policy = always (default) or troubled (euler-tq)accumulate_seam_fluxes, apply_reflux_to_stage_forest, flag_troubled_seam_cells, adam_flume_cpu_object.F90; reduce_fine_sums, adam_flux_register_object.F90
Boundariesperiodic in x and y; extrapolation on the null z facesboundary conditions
FNL backendthe same kernels on the device; the restriction rows in the local ghost kernel (C2)adam_flume_fnl_object.F90; update_ghost_local_gpu_dev, adam_fnl_field_kernels.F90

The seam operators are described in numerics.

C1, the 6-point restriction ([amr] seam_restriction = lagrange6, #68 C1, C2). The coarse seam ghosts take the tensor 6-point Lagrange interpolation of the fine cells to the coarse centre instead of their mean: exact 1-D weights k/256, the footprint shifted inside the donor block at its edge, as B3 recommends. A row whose fine pair does not lie inside its donor block falls back to the mean. On FNL the restriction runs in the device twin of C2.

D1, the quintic fill ([amr] seam_ghost_fill = quintic, #68 D1). A fine ghost takes the tensor 6-point Lagrange interpolation of the coarse cells at its centre: 1-D weights k/8192 (exact in binary), the footprint shifted inside the coarse donor block at its edge as the tricubic one is (blocks of at least 6 cells along the refined axes); along an unrefined axis only the anchor is read. The anchor shifts travel in the fill meta of every map row (bits 18–26, seam_meta_pack, adam_seam_interpolation_library.F90). FNL sums straight from the device field; the inter-realm rows use the same fill.

D2, the limited fills (#68 D2), both order 6 at the centred anchor positions:

  • weno6: per direction the WENO-Z combination of the cubics of the 4-point sub-stencils that contain the ghost's interval (the kernel of the C3 restriction), with positive linear weights that reproduce the Lagrange interpolant of their union; a sub-stencil holding a jump is dropped, and the clamped linear interpolation is used when none is left. Order 5 one cell from the donor block's edge, 4 at it (seam_interpolate_weno6; per direction SETH's seth_weno6_point since #139 S7, which also holds the C3 restriction);
  • quintic-mp: the D1 quintic clamped per direction to a Suresh–Huynh monotonicity-preserving bound, the interval's values and the curvature-corrected linear value L+θ(θ−1)/2dM4, widened by the curvature term; at the block edge the extrapolation is allowed only when the edge-side intervals hold no jump (seam_interpolate_quintic_mp).

The other fills compared on the shock crossings are injection (order 1) and restriction-compatible (order 2, exact R∘P=I with the mean restriction). Every fill but tricubic is opt-in.

Initial and boundary conditions ​

Itemeulermhd
Domain[0,1]2, null z[−7,7]2, null z
Initial conditionV2 isentropic vortex: radius 0.07, strength 5, centre (0.5,0.5); free stream (ρ,u,v,p)=(1,1,1,1)MV-7 magnetised vortex: radius 1, κ=1, μ=1, centre (0,0); background (ρ,u,v,p)=(1,1,1,1), B=0
Base gridquadtree (ratio = 4), 4×4 base blocks of N/4×N/4×1 cells, ngc = 3; N = 64 / 128 / 256the same
Refined regionquadrant [0.5,1]2: four base blocks refined one 2:1 level at initialisation (primitive-box marker, max_level = 3, no regridding)quadrant [0,7]2, the same
Uniform controlthe same case without the box (max_level = 2), the coarse spacingthe same
Boundariesperiodic in x, y; extrapolation in zthe same
Final timet=0.1 (CFL 0.4; V2's 0.1 gives the same errors to five digits: uniform N=64 L1 8.2184⋅10−5 both)t=0.5
Ranks22
euler-octree (on request)the euler leg on an octree (ratio = 8, nk = 4), N = 64 / 128; it refines along the null z too, about 16 times the cost of the quadtree—

Legs of the euler ladder (each: refined and uniform runs, N = 64 / 128 / 256):

Legseam_restrictionseam_ghost_fillRefluxPhase
eulermeantricubicon, alwaysA1
euler-l6lagrange6tricubicoffC1
euler-w6weno6tricubicoffC3, C3c
euler-q6lagrange6quinticoffD1
euler-wwweno6weno6offD2
euler-mplagrange6quintic-mpoffD2
euler-tqlagrange6quinticon, troubledE2

Input files ​

FileRole
src/tests/flume/verification/amr-order/make_amr_order.pywrites the inputs from the V2 input vortex/vortex-n{064,128,256}.ini (euler) or mhd/vortex/make_mhd_vortex.py (mhd); --ratio, --uniform, --no-reflux, --seam-restriction, --seam-ghost-fill, --reflux-policy, --time-max, --it-save
src/tests/flume/verification/mhd/amr_box.pyrefine_box: the refined quadrant, one 2:1 level at initialisation
src/tests/flume/verification/amr-order/amr_order_oracle.pythe per-region errors against the exact vortex, the orders, the bounds
src/tests/flume/verification/make_doc_figures.py --only order-across-seamsthe figure, from the kept work directories of amr-order/check.sh --keep (CPU)
src/tests/flume/verification/amr-shock/make_amr_shock.pythe D1 and D2 shock crossings of AS (--seam-restriction, --seam-ghost-fill)
src/tests/flume/verification/ghosts/check.sh --seam-restriction lagrange6 --seam-ghost-fill quintic --degree 5the ghost probe on a degree-5 field (D1); --seam-ghost-fill F on a cubic field (D2)
src/tests/flume/verification/make_doc_figures.py --only quintic-fillthe D1 figure, from ghosts/check.sh --degree 5 --keep and the kept AO work directories (CPU)
src/tests/flume/verification/make_doc_runs.sh <runs> seams, make_doc_figures.py --only limited-fillsthe D2 figure: re-runs the crossings d-{quintic,weno6,quintic-mp}-{c2f,f2c} (CPU)
src/tests/flume/verification/amr-order/check.shruns the legs (--legs euler,mhd,euler-octree,euler-l6,euler-w6,euler-q6,euler-ww,euler-mp,euler-tq, default all but euler-octree; --np N, --keep; FLUME_EXE selects the backend)
bash
cd src/tests/flume/verification/amr-order && ./check.sh             # CPU, default legs (all but euler-octree)
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl ./check.sh         # FNL
./check.sh --legs euler-octree                                      # the octree leg, on request

Oracle (amr_order_oracle.py). Each cell of the last checkpoint is compared with the exact convected vortex: the density for Euler; for MHD the eight conservative variables, combined as MV-7 does (∑ve¯v2 of the per-variable means). The error is split into the seam band, the cells within ngc of their own spacing from the boundary of the refined quadrant (periodic images included), and the interior, the rest; a uniform run is all interior. For each region: L1 (the volume-weighted mean of |e|), L∞ and the orders of successive runs.

BoundLegValue
finest refined L1 (all, band) and L∞ (all)every leg but euler-octreeat most the CPU baseline plus 2 %
uniform control, interior L1 orderevery leg≥4.7
refined L1 / L∞ order, finest paireuler-l6, euler-w6, euler-ww≥4.8 / ≥4.5
refined L1 / L∞ order, finest paireuler-q6, euler-mp, euler-tq≥5.5 / ≥5.5

Cost of euler-l6: about 10 min on the CPU, 2 on FNL.

Results ​

AO ladders and error maps

CPU, from the work directories amr-order/check.sh --legs euler,euler-l6,euler-q6 --keep leaves: L1(ρ) over all cells and L∞(ρ) in the seam band against N (the 128 → 256 orders in the legend), the default operators (mean + tricubic, reflux on) capped at 2.01 and 1.46, lagrange6 without reflux at the uniform control, lagrange6 + quintic below it; and the density error maps at N=128 (the refined quadrant in white): the default operators' error concentrates on the seams, lagrange6 + quintic leaves the vortex's own.

Baselines (A1). CPU and FNL identical to every printed digit, 2 ranks; orders of the finest pair, N = 128 → 256:

LegRefined L1 at N = 256Uniform L1 at N = 256L1 order: all / band / interiorL∞ orderUniform L1 order
euler4.05⋅10−68.38⋅10−82.01 / 1.71 / 1.911.465.79
mhd1.83⋅10−62.62⋅10−82.07 / 1.85 / 1.921.895.34

C1, the 6-point restriction (euler-l6). CPU and FNL (the device twin of C2) agree to every printed digit, and on the same run to 3⋅10−14:

N = 256L1 allL∞ allOrders 128 → 256, L1 / L∞
euler (mean, reflux on, default)4.05⋅10−6–2.01 / 1.46
euler-l6 (lagrange6, reflux off)8.55⋅10−86.36⋅10−65.33 / 5.53
uniform at the coarse spacing8.38⋅10−85.34⋅10−65.79 / 7.38

euler-w6 reports in C3c and euler-tq in E2.

The quintic fill ​

Phase D1: the quintic coarse-to-fine fill.

D1: the quintic fill in situ and on the AO vortex

CPU. Left and centre: the ghost probe on a degree-5 field, box3d (octree) and channel2d (quadtree), 2 ranks, the largest error per ghost group: mean + tricubic misses the field by up to 5⋅10−5 in every group a seam operator fills (the expected failure: exact to degree 1 and 3), lagrange6 + quintic matches it to 10−14. Right: the AO ladder without reflux, lagrange6 with the tricubic and the quintic fill.

FNL, 2 ranks, lagrange6 restriction in every run. The shock crossings are the AS c2f and f2c runs (Sod N=200, RJ2a N=256, reflux on, the null axes widened to 8 cells); plateau values in units of 10−2, band values absolute:

Checklagrange6 + tricubiclagrange6 + quintic
AO euler, reflux off, N = 256: L1 all / band, L∞8.55⋅10−8 / 2.61⋅10−7, 6.36⋅10−66.03⋅10−8 / 1.74⋅10−7, 4.78⋅10−6
AO orders L1 / L∞ (128 → 256)5.33 / 5.536.11 / 6.35
Sod c2f plateau ρ / p, band ρ2.457 / 0.691, 0.633⋅10−22.631 / 0.858, 0.795⋅10−2
Sod f2c plateau ρ / p, band ρ1.575 / 1.015, 0.343⋅10−21.573 / 0.985, 0.338⋅10−2
RJ2a c2f plateau ρ / p, band ρ1.410 / 0.622, 1.03⋅10−42.297 / 0.986, 0.68⋅10−4
PV-5 split / HLLD: most faces limited, inadmissible stages46336 / 17920, 045644 / 17920, 0

Backend agreement: np 1 / 2 / 3 bitwise on the CPU, np 1 / 2 on FNL, CPU against FNL 2.7⋅10−13; the euler-q6 ladder agrees on CPU and FNL to every printed digit. Multirealm leg 6 runs the fill across a refined inter-realm seam, bitwise.

The limited fills ​

Phase D2: the limited fills weno6 and quintic-mp.

D2: the plateau with the 6-point fills

Sod at N=200, lagrange6, reflux on, CPU: the plateau behind the shock with the quintic, weno6 and quintic-mp fills (and the tricubic, c2f), coarse to fine and fine to coarse. The fills differ by at most about 10−3 in density, against a defect of 2.5⋅10−2 of the jump: the defect is not the fill.

Every fill on the c2f crossings (FNL, 2 ranks, lagrange6 restriction, reflux on; plateau and band defects as in AS):

Fill (order)Sod plateau ρSod band ρSod shock (cells)RJ2a plateau ρRJ2a band ρ
injection (1)2.98⋅10−27.91⋅10−30.1732.49⋅10−22.16⋅10−4
restriction-compatible (2)2.32⋅10−25.31⋅10−30.1641.98⋅10−21.28⋅10−4
tricubic (4)2.46⋅10−26.33⋅10−30.1581.41⋅10−21.03⋅10−4
quintic (6)2.63⋅10−27.95⋅10−30.1592.30⋅10−20.68⋅10−4
weno6 (6, limited)3.01⋅10−27.75⋅10−30.1781.48⋅10−21.52⋅10−4
quintic-mp (6, limited)3.14⋅10−28.82⋅10−30.1732.47⋅10−26.25⋅10−4

Smooth flow (AO, N = 128 → 256):

LegL1 orderL∞ orderL1 at N = 256L∞ at N = 256
euler-ww (weno6 + weno6)5.325.508.60⋅10−86.61⋅10−6
euler-mp (lagrange6 + quintic-mp)6.106.336.04⋅10−84.77⋅10−6
euler-q6 (lagrange6 + quintic)6.116.356.03⋅10−84.78⋅10−6

PV-5 passes with no inadmissible stage under both limited fills; the ghost probe holds a cubic field to round-off with either fill; multirealm leg 6 runs both across a refined inter-realm seam, bitwise.

Related cases: AS is the shock baseline of the same seam operators; AL logs the drift of this vortex without the reflux; B1 reproduces the caps in a 2-D prototype; E0 explains the crossing defect D2 could not reduce; the uniform-grid orders are V2 and MV-5 to MV-7.

Findings ​

  • The seams cap the whole solution at second order, not only the band. The error made at a seam is carried into the interior by the flow, so every region a feature reaches after crossing a seam is second order. The plan's expectation of "design order in the interior" holds only for regions the flow does not reach from a seam.
  • On this smooth flow the refinement makes the solution worse. At N=256 the refined composite error is 48 times (Euler) and 70 times (MHD) the error of the uniform run at the coarse spacing, which reaches design order.
  • Euler's L∞ order is 1.46, below the 2 of the 1-D prototype in #68 (Appendix A). The vortex crosses the seam corner, where the two seam directions meet; the 2-D prototypes of Phase B show that the corner does not explain it (B1, B2).
  • C1: the restriction was the seam error. With the 6-point restriction and without the reflux the refined composite error equals the uniform coarse run's, 47 times below the default operators': at these resolutions the restriction was the seam error, and the tricubic prolongation's O(h4) term has not shown yet.
  • C1: the reflux caps the order by itself. With the reflux on, the restriction changes nothing (band L∞ order 1.43 against 1.46 at N = 64 → 128), as B1 predicts. The high order with the reflux kept at the shocks is E2.
  • No restriction row fell back to the mean: every fine pair lies inside its donor block.
  • C1 cost on FNL: the restriction rows read 36 cells instead of 4 on this quadtree, in the same kernels as the copies.
  • D1: the smooth order reaches the scheme's. With the reflux off, the 6-point restriction and the quintic fill, AO euler is sixth order (6.11 / 6.35) and its error at N=256, 6.03⋅10−8, is below the uniform coarse run's (8.38⋅10−8): the 2:1 seams no longer cost accuracy on this flow.
  • D1: unlimited, the quintic fill worsens a shock entering a finer region. On the c2f crossings the plateau defect grows (Sod +7 % in ρ, +24 % in p; RJ2a +63 % / +59 %): the shock's coarse values reach the fine ghosts through a 6-point stencil with larger overshoots than the 4-point one. f2c is unchanged, the shock positions are the same, mass is exact, and PV-5 passes with no inadmissible stage.
  • D2: the crossing defect has no trend with the fill's order, and limiting makes it worse. The best fill differs by case and by metric (restriction-compatible on Sod, tricubic on the RJ2a plateau, quintic on its band); every unlimited fill sits within about ±30% of tricubic, and the two limited fills are the worst on Sod, their shock furthest off. The plateau defect is not an overshoot of the fill, so no fill can be held to "no worse than tricubic"; E0 shows it is a capturing error.
  • D2: on smooth flows both limited fills keep their order. euler-ww has the weno6 restriction's accuracy; euler-mp equals euler-q6: the MP bound never clips the vortex.
  • quintic, weno6 and quintic-mp stay opt-in; the default fill is tricubic.