Skip to content

Footprint of a high-order restriction ​

IDGroupMilestoneBackendsFigureRegression
B3Seam studiesM6 (#68)NumPy prototype (no ADAM run)yes—

Case and scope ​

Phase C replaces the mean restriction with a 6-point one. Its stencil reaches 2 to 3 fine cells beyond the two cells of the coarse cell, so near the edge of a fine block it needs data the block does not hold. Two footprints are possible:

  • shift-inward: the stencil shifts inside the donor block (one-sided, at least 6 fine cells per block);
  • two-pass: the fine block's ghosts are filled first and the stencil stays centred (any block size, at the price of an ordering constraint).

B3 asks which one Phase C should implement: how accurate each is, how the block size matters, and what each costs in FLUME's ghost update.

Models and numerics ​

ItemChoiceCode
Modelthe B1 problem (ut+ux+uy=0, 5th-order linear upwind flux, RK4) with the reflux off, where the restriction's order showsComposite, run, proto2d.py
Fine blocksthe fine box split into blocks of B fine cells per axisComposite, proto2d.py
lag6 (shift-inward)the 6-point restriction shifted inside its donor fine block (needs B≥6)Composite._restriction_stencils, proto2d.py
lag6c (two-pass)the centred 6-point restriction reading the fine ghosts (exact fine neighbours inside the box, the prolongation at its edge)Composite._restriction_stencils, proto2d.py
Prolongationcubic or quinticComposite.pad_fine, proto2d.py
FLUME counterpartshift-inward, adopted in C1: seam_restriction_code keeps the footprint inside the donor blockseam_restriction_code, adam_seam_interpolation_library.F90; update_ghost_local, adam_field_object.F90

Initial and boundary conditions ​

ItemValue
Domain, initial conditionthe periodic unit square, sin⁡2πxsin⁡2πy, one period
Block sizesB = 4, 6, 8, 16 and the whole box (the proto2d.py default; check.sh runs 4, 6, 8 and the box)
GridsN = 48 / 96 / 192 (so that 6, 8 and 16 divide the fine cells; check.sh --long); N = 24 / 48 / 96 (check.sh)
Refluxoff

Input files ​

FileRole
src/tests/flume/verification/amr-proto/proto2d.pyb3 [--cells ...] [--blocks 4 6 8 16 0] [--assert ARM:NORM:MIN] (block 0: the whole box)
src/tests/flume/verification/amr-proto/check.shruns B1, B2 and B3 (--legs b3 for B3 alone)
src/tests/flume/verification/make_doc_figures.py --only seam-proto-b3draws the figure (fig_seam_proto_b3; NumPy only, about 20 s)
bash
cd src/tests/flume/verification/amr-proto && ./check.sh --legs b3  # B3 at N = 24 / 48 / 96, about 20 s
./check.sh --legs b3 --long                                        # B3 at N = 48 / 96 / 192

Bounds asserted by check.sh: the L∞ orders of shift-inward (B=6) and two-pass at least 3.7 with the cubic prolongation and 4.7 with the quintic; shift-inward at B=4 is reported infeasible.

Results ​

B3: the restriction footprint against the fine block size

The check.sh ladder, N = 24 / 48 / 96, reflux off: L∞ per footprint, with the cubic (left) and quintic (right) prolongation (48 → 96 orders in the legend). Shift-inward at 6 or 8 fine cells per block matches the whole box; the centred two-pass lag6c is slightly more accurate with the cubic fill and identical with the quintic one.

N=192; orders of 96 → 192:

Footprint, prolongationBlock sizeL1L∞Order L1 / L∞
shift-inward, cubic6 / 8 / 16 / box9.2 to 9.4⋅10−83.7 to 3.9⋅10−73.98 / 4.00
two-pass, cubicany2.4⋅10−81.9⋅10−74.14 / 4.03
shift-inward, quintic6 / 8 / 16 / box2.38⋅10−97.83⋅10−94.98 / 4.99
two-pass, quinticany2.42⋅10−97.85⋅10−95.00 / 5.00
shift-inward4infeasible

Related cases: C1 implements the recommendation; B1 is the base model; D1 adds the quintic prolongation in FLUME.

Findings ​

  • The block size does not matter for shift-inward. From 6 fine cells per block to the whole box the error changes by at most 2.5 % in L1 and 5 % in L∞, at the same order.
  • With the quintic prolongation the two footprints are equivalent (within 1.5 %), both at order 5.
  • With today's cubic prolongation, two-pass is 4 times more accurate in L1 (2 times in L∞), at the same order 4: the one-sided shift has a larger error constant than the centred stencil reading 4th-order ghosts.
  • What each costs in FLUME. update_ghost_local fills copies, coarse-to-fine interpolations and fine-to-coarse restrictions in one pass, in map order, the restriction reading only the donor block's interior cells. Shift-inward keeps that single pass and needs 6 fine cells per refined axis, which the #66 guard already requires (n≥2ngc=6). Two-pass needs the fine ghosts complete before any restriction: a second local pass and, on several ranks, a second exchange round, because the sender must update its fine ghosts before it packs.
  • Recommendation for Phase C: shift-inward. It fits the current ghost update and block guard, and with the quintic prolongation of Phase D it is as accurate as two-pass. Two-pass would buy a constant factor only while the cubic prolongation stays, at the cost of a second synchronisation per ghost update.