Skip to content

Absorbing layers on AMR ​

CasesIssuesTypeBackendsFigureRegression
rmf-fwl, rmf-fwl-amr, rmf-pml-amr#31, #58, #95 (P5.1)CCPU, FNLnormf-fwl (digest, FNL only); rmf-fwl-amr, rmf-pml-amr (digest + residuals, CPU and FNL)

Case and scope ​

Three digest-goldened cases anchor the absorbing layers: the far-wave layer ([fWLayer]) and the perfectly matched layer ([PML]) on the six faces of the four-coil rmf problem, on a uniform grid and after an initialization-time refinement. They carry no oracle of their own: the digest pins the solution, and the defects they guard against moved it far outside the tolerance.

What the cases catch:

  • the FNL host→device copy of the layer (rmf-fwl, #31): a buffered transposed copy through a staging buffer whose shape differed from the device destination made nvfortran pass a host temporary to the asynchronous copy (CUDA_ERROR_INVALID_VALUE at more than one rank);
  • a layer width that does not fit a block (#58): the layer is set by a physical width, and the cell count per face is derived, Cface=min(ni,⌈width/Δs⌉);
  • per-block face data left on the pre-AMR blocks (rmf-fwl-amr, rmf-pml-amr, #95 P5.1): the layer ranges, the PML support and its RK storage must be rebuilt on every change of the block set. Before the fix they stayed on the old blocks, 48 of the 96 face blocks per rank, and the initial condition was built with the stale layer.

Models and numerics ​

ItemChoiceCode
EquationsMaxwell, SI, 4 AC rectangular coilsmodels; coils
Space, timecentred finite differences of order 6; SSP Runge–Kutta (5,4), CFL 0.4997numerics
Far-wave layersix faces, width = 0.045 madam_prism_fWLayer_object.F90; absorbing layers
PML (rmf-pml-amr)CFS, six faces, width = 0.045 m, gamma_max = 7.8e10, alfa_max = 2.5e8, k_max = 5adam_prism_pml_object.F90, adam_prism_rk_pml_object.F90; absorbing layers
Face data rebuildafter every change of the block setinitialize_block_face_data, adam_prism_common_object.F90

Initial and boundary conditions ​

Itemrmf-fwlrmf-fwl-amrrmf-pml-amr
Domain[−0.24,0.24]3 mthe samethe same
Grid64 blocks of 163 (iu_ref_levels = 2), Δx=7.5⋅10−3: the layer is 6 cellsplus a box marker fired at initialization (amr_iterations = 1) refining the slab x<−0.13 to level 3the same as rmf-fwl-amr
LayerfWLayer, six facesfWLayer, six facesCFS PML, six faces
Initial conditionvacuum, 4 AC coils (time_delay = 1e-8)the samethe same
Steps, ranks10, 25, 25, 2

Input files ​

FileRole
src/tests/prism/regression/rmf-fwl/input.inithe uniform fWLayer case
src/tests/prism/regression/rmf-fwl-amr/input.ini, rmf-pml-amr/input.inithe refined cases
src/tests/prism/regression/<case>/golden/{cpu,fnl}/the digests run.sh compares
src/tests/lint/check-removed-input-keys.shrejects [fWLayer] C (the former cell count) in every committed input; run.sh runs it first
bash
REGRESSION_CASES="rmf-fwl rmf-fwl-amr rmf-pml-amr" src/tests/prism/regression/run.sh cpu --no-build
src/tests/prism/regression/run-fnl-local.sh --no-build                  # FNL, the whole sweep

Results ​

CaseAssertsBoundCPUFNL
rmf-fwldigest against the goldenrtol = 1e-6, atol = 1e-3no golden (SKIP)pass
rmf-fwl-amrdigest and residuals against the goldensthe samepasspass
rmf-pml-amrdigest and residuals against the goldensthe samepasspass
removed-keys lintno [fWLayer] C in a committed inputnone foundpass—

Related pages: input validation and refusals for the inputs PRISM refuses; hazards for the PML parameter sets. The PML reflection against the angle of incidence is an open analytic oracle (#106).

Findings ​

  • The fWLayer field now holds no device state and copy_cpu_gpu copies only q, whose staging buffer has the shape of its device destination, so the #31 crash cannot recur. The rule stands for every buffered transposed copy: pass a staging buffer only when its shape equals the destination's.
  • On a refined grid the layer and the PML follow the final block set: both refined cases reproduce their goldens on both backends.
  • These cases verify that the layers are applied where they should be, not how well they absorb.