research32 min studyLesson 848 in Physics

Adaptive mesh refinement in spacetime evolution

Count refinement costs and connect time synchronization, interpolation and characteristic resolution.

On this page

What you’ll understand

  • Count cell-update work for a declared nested-grid model.
  • Calculate local timestep limits including the fastest modeled characteristic.
  • Explain why refinement interfaces and regridding belong in an accuracy study.

A strong-field spacetime contains several spatial scales: near-horizon structure, orbit-scale dynamics, and radiation traveling toward distant extraction surfaces. Uniformly resolving the smallest scale across the entire domain can be expensive. Mesh refinement concentrates points where they are needed, but introduces interfaces and multiple clocks. The numerical question is therefore not merely how many points were added. It is whether information moves between resolutions with compatible accuracy, stability and constraint behavior.

Declare the grid hierarchy and its work model

For a Cartesian three-dimensional hierarchy, halving the spacing increases the number of cells in a fixed physical region by eight. An explicit hyperbolic method often also halves the stable timestep there, adding another factor of two in work per fixed physical time. A uniform fine-grid evolution can therefore cost roughly sixteen times a coarse one under a simple equal-work-per-cell-update model. Memory growth and communication introduce different scaling factors.

A small refined patch can reduce that ideal cost, especially when subcycling lets fine levels take more steps than coarse levels. State whether covered coarse cells are still evolved, which ghost zones are counted, and whether a patch volume is a fraction of the physical domain or of an array's point count. Without those definitions, two apparently inconsistent cost estimates may simply be counting different work. Real performance also depends on parallel balance, interpolation and memory traffic.

Ncells∝h−3,Nsteps∝h−1,Wuniform∝h−4in the stated ideal explicit modelN_{\rm cells}\propto h^{-3},\qquad N_{\rm steps}\propto h^{-1},\qquad W_{\rm uniform}\propto h^{-4}\quad\text{in the stated ideal explicit model}
This work estimate assumes fixed physical domain/time, comparable per-cell-update cost and a hyperbolic timestep proportional to spacing. It is not a hardware benchmark or a universal solver complexity.↔ Scroll wide equations horizontally.

Synchronize levels and resolve all relevant speeds

A Courant-type restriction compares timestep with spacing divided by the largest characteristic speed that matters to the discretization. Gauge and constraint speeds can be larger than the physical light speeds in coordinates. A refinement ratio two naturally suggests two fine substeps per coarse step when the speed bounds are comparable. If those bounds vary strongly, the hierarchy needs a consistent scheduling rule rather than a purely geometric assumption.

Fine-grid boundary values typically require interpolation from coarser data at intermediate times. Restriction transfers fine information back to a coarse level, while regridding changes which points belong to each level. Each operation can introduce errors. High-order interior finite differences cannot by themselves repair a lower-order interface treatment that dominates the global solution. Conservation, constraint preservation and interpolation accuracy are related goals but are not interchangeable properties.

Δt≤CCFLhvmax⁡,hfine=hcoarse/2 ⟹ Δtfine=Δtcoarse/2for equal speed bounds\Delta t\le C_{\rm CFL}\frac{h}{v_{\max}},\qquad h_{\rm fine}=h_{\rm coarse}/2\ \Longrightarrow\ \Delta t_{\rm fine}=\Delta t_{\rm coarse}/2\quad\text{for equal speed bounds}
The allowed Courant factor depends on the spatial operator, dimension and time integrator. The displayed condition is a local estimate under those choices, not a sufficient nonlinear stability proof.↔ Scroll wide equations horizontally.

Audit interfaces with propagating and geometric tests

A wave crossing a refinement boundary can acquire phase error or spurious reflection, even when each uniform-grid scheme behaves well in isolation. Useful verification therefore includes waves at different incidence angles, moving refinement patches, and smooth gauge or exact-solution tests. Constraint norms should be examined near interfaces as well as over the full domain. An average norm can hide localized spikes that later propagate into a wave-extraction region.

Refinement criteria based on a particular variable are coordinate dependent and may miss another physically relevant scale. A coordinate horizon can be small while outgoing radiation still needs adequate resolution farther out. Error indicators, patch motion and extraction surfaces should therefore be included in a convergence study. The tiny cell-count example below isolates scheduling arithmetic; it supplies neither an error estimate nor evidence that a particular binary spacetime has been resolved.

W=∑ℓNℓnℓfor equal cost per cell update and declared level countsW=\sum_\ell N_\ell n_\ell\qquad\text{for equal cost per cell update and declared level counts}
N-ell is the evolved cell count on level ell and n-ell its number of time updates. Interpolation, ghost-zone and communication costs are excluded in this explicit toy accounting.↔ Scroll wide equations horizontally.

A finite nested-grid work count

Evolve a coarse cube with 838^3 cells for four coarse steps. Retain and evolve every coarse cell. Add one ratio-two fine patch covering one eighth of the physical domain, taking two fine substeps per coarse step. Ignore ghost zones, communication and interpolation. Compare total cell updates with a uniform ratio-two fine grid over the same physical duration.

  1. The coarse grid has 512 cells and contributes 512×4=2048512\times4=2048 updates. The patch covers 64 coarse-cell volumes; eight fine cells per such volume give 512 fine cells.

  2. The fine patch takes eight steps and contributes 512×8=4096512\times8=4096 updates. Total nested-grid work is 6144 updates, three times the coarse-only count under the stipulated accounting.

  3. A uniform fine grid has 163=409616^3=4096 cells and takes eight steps, giving 32768 updates. The nested total is 0.1875 of that count, or an ideal work reduction by about 5.33. No accuracy or real-runtime conclusion follows from these counts alone.

The result

The declared hierarchy requires 6,144 cell updates versus 32,768 for uniform refinement, before the explicitly excluded overheads.

Explore the model

Interactive lab

Interactive lab · roofline

An ideal work count leaves hardware limits open

Reset and set operational intensity one and bandwidth 100; predict synthetic ceiling 100 GFLOP per second. Compare a fresh Reset run at intensity ten and bandwidth 100; predict the fixed compute ceiling 1000 GFLOP per second. This hypothetical roofline does not measure an AMR code, account for communication, or predict a binary simulation runtime.

An ideal work count leaves hardware limits openSynthetic roofline ceiling min(1000, B·I), in GFLOP/s, with B in decimal GB/s and I in FLOP/byte. Playback traces the roof without changing the selected kernel. This upper-bound model is not a measured throughput prediction, hardware comparison or price model. Current readings: Attainable ceiling: 640 GFLOP/s; Ridge intensity: 12.5 FLOP/byte; Ceiling regime: Memory-bound ceiling. All parameters are adjustable with the labeled controls below.Hypothetical roofline upper bound: 640 GFLOP per second at operational intensity 8 FLOP per byte and bandwidth 80 gigabytes per second.0.1110641101001000Operational intensity · FLOP/byte · log scaleCeiling · GFLOP/s · log scalePeak: 1000
Attainable ceiling / kernelBandwidth roof / traceCompute ceiling
Attainable ceiling
640 GFLOP/s
Ridge intensity
12.5 FLOP/byte
Ceiling regime
Memory-bound ceiling
t = 0 s

Synthetic roofline ceiling min(1000, B·I), in GFLOP/s, with B in decimal GB/s and I in FLOP/byte. Playback traces the roof without changing the selected kernel. This upper-bound model is not a measured throughput prediction, hardware comparison or price model. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forCell counts and attainable hardware ceilings are distinct ingredients; neither alone establishes actual performance or numerical accuracy.

Check your understanding

Why can a high-order interior stencil still fail to deliver its nominal global order on a refined hierarchy?

Try it yourself

For a toy explicit method use spacing h=0.25Lh=0.25L, fastest coordinate characteristic speed two, and allowed Courant factor 0.4. Find the coarse timestep limit and the ratio-two fine limit. How many fine steps synchronize with one coarse step under equal speed bounds?

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Use the fastest stated characteristic, not an assumed light speed of one. Both levels use the same Courant factor.

Compare with the solution

The coarse estimate is 0.4(0.25L)/2=0.05L0.4(0.25L)/2=0.05L. The fine spacing is 0.125L0.125L, giving timestep 0.025L0.025L. Two fine steps synchronize with one coarse step. These values are conditional on the stipulated speed bounds and integrator allowance. If a gauge mode becomes faster or an interface scheme imposes a tighter restriction, this arithmetic must be revisited before calling the schedule stable.

Take it with you

  • Refinement reduces ideal work only for a specified hierarchy and schedule.
  • Every relevant characteristic speed belongs in timestep planning.
  • Interfaces and regridding require their own convergence and constraint checks.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.