Box
Where a patch lives in the level's integer index space.
[lower, upper]AMReX alignment / design proposal / 26 September 2026
Give today's solver a clearer structure. Then teach it to connect patches. Then add resolution where the physics needs it.
Three separate gates. The first changes the representation of existing simulations. Multiblock and refinement are later numerical features. Nothing on this page is evidence that those features already work.
01 / Vocabulary
The domain is the physical region being simulated. A level gives it a particular grid spacing. A patch stores a rectangular part of that level.
One coarse patch can cover the entire domain. Fine levels can use several smaller patches. Splitting a level into patches does not change its resolution.
AMReX uses boxes and field collections to express this separation. Official data-model reference.
Where a patch lives in the level's integer index space.
[lower, upper]Where the quantity is sampled relative to a cell.
cell · x/y/z faceHow a kernel reaches values without owning their memory.
bounds + strides + dataWhich boxes share a resolution and cover which region.
spacing + patch boxes02 / Follow the same physical domain
Choose a stage to inspect the difference. These are schematic 2D grids, not simulation results.
AMR-02 / same capability
The solver still advances the same grid. Domain coordinates, patch bounds, field placement and memory ownership become explicit and consistently used.
160 active cells · 1 physical level · 1 patch
It guarantees base coverage. Fine patches still need values from their neighbors, and the coarse and fine regions must agree on normal volume flux and pressure coupling. The coarse solution must respond to the fine region as part of one physical solution.
The fine patch covers 48 of the 160 coarse cells and contains 192 fine cells. We retain 160 + 192 = 352 cell slots, but the physical composite uses 160 − 48 + 192 = 304 active cells. A uniformly fine 2D grid would contain 640 cells. These counts exclude face arrays, ghosts, geometry and solver buffers; they are not a GPU memory or speed prediction. In 3D, a 2:1 refinement divides a coarse cell into eight fine cells.
03 / What already fits
Pressure and velocity should not be forced into one identically shaped array. A patch with Nx × Ny × Nz cells has different valid extents for each field.
We keep device-resident arrays, float fields, Half geometry and double weighted reductions. Alignment makes their meaning and ownership explicit.
04 / Where the hard work lives
A wall, inlet, outlet or periodic domain edge. Apply the problem's physical conditions here.
An internal storage split. Obtain neighboring samples and agree on the shared face value; this edge is not a wall.
Different resolutions describe the same fluid. Couple pressure, transfer fields and make weighted fluxes consistent.
Current advection clamps or wraps at the current grid's edges. S2 must replace that domain-wide assumption with a policy for sampling across patches, including departure points and corner data.
See AMReX boundary filling and AMReX-Hydro projection methods.
05 / Our current code
| Area | AMR-02: representation | S2 / S3: behavior |
|---|---|---|
| Grid & coordinates | Separate domain geometry, global boxes and local strides. | Support several patches and new refinement layouts. |
| Session & fields | One level with one patch; explicit owners and borrowed views. | Coordinate operators and reductions across patches. |
| Boundary sampling | Name and guard the current patch-equals-domain restriction. | Exchange same-level data, then fill coarse/fine data. |
| Solid geometry | Separate coordinates from cut-cell metrics; preserve sampling. | Establish consistent geometry and fluxes across interfaces. |
| Results & viewers | Derive current metadata from the canonical layout. Preserve wire meanings. | Carry native patch/level coverage or label resampled previews. |
Physical refinement levels
Coarse background plus finer local regions. These levels carry physical simulation state and affect resolution.
Coarse domain → fine region
Multigrid solver levels
Auxiliary coarse problems accelerate pressure convergence. They do not add locally refined simulation state.
Pressure problem → coarser corrections
Both can use box descriptors. They need separate identities and ownership. Existing GpuMgHierarchy is the second kind.
06 / Delivery gates
Inventory consumers, introduce canonical descriptors, migrate ownership and callers, then remove superseded representations.
Gate: existing inputs, fields, measurements, outputs and scientific acceptance remain valid. No new mesh capability and no abstraction-driven performance regression.
Begin with the same problem split in two. Add same-level sampling, shared-face consistency, coupled pressure/diffusion, geometry, measurements and output.
Gate: partitioned and monolithic solutions agree within declared tolerances, including periodic and cut interfaces. A simple two-patch test alone does not finish S2.
Start with one coarse base, one aligned 2:1 fine patch and synchronized timesteps. Add coverage masks, transfers and composite equations.
Gate: accuracy and conservation pass against uniform-fine references, with less measured memory or time at comparable measurement accuracy.
Extend fixed refinement to multiple patches/levels. Then add tagging, regridding, safe state transfer, layout revisions and geometry/solver rebuilding.
Gate: refine/derefine cycles preserve the required budgets and constraints. Thermal and moving-geometry combinations need their own evidence. Time subcycling is a later decision.
Continue reading
The Markdown plans define scope and acceptance. The work board owns current status. Proposed type names and diagrams are explanatory; they are not executable API or file-format specifications.