Skip to content

Add the Base/StaggeredGrids tutorial - #185

Merged
WeiqunZhang merged 3 commits into
AMReX-Codes:mainfrom
WeiqunZhang:staggered-grids
Nov 5, 2026
Merged

WeiqunZhang merged 3 commits into
AMReX-Codes:mainfrom
WeiqunZhang:staggered-grids

Conversation

@WeiqunZhang

Copy link
Copy Markdown
Member

Face- and node-centered MultiFabs with convert, faces of a tile with nodaltilebox, OverrideSync of the faces shared by boxes, computeDivergence of a face velocity, and the averaging utilities between faces, nodes and cell centers. The divergence is checked to be exactly zero and the averages to reproduce linear functions to round-off.

The tutorial is built in 2D and 3D only; the shear flow has no 1D analogue.

Face- and node-centered MultiFabs with convert, faces of a tile with
nodaltilebox, OverrideSync of the faces shared by boxes, computeDivergence
of a face velocity, and the averaging utilities between faces, nodes and
cell centers. The divergence is checked to be exactly zero and the
averages to reproduce linear functions to round-off.

The tutorial is built in 2D and 3D only; the shear flow has no 1D analogue.
Use the ParallelFor overload that takes one box and one function per
direction, so the face velocity is set in a single launch per tile
instead of a loop over directions.
Replace the three face lambdas and their index-type locals with a small
device functor that takes the direction, so the ParallelFor call needs no
#if and the docs snippet renders dedented. Say in the README and the Base
docs that the tutorial runs in 2D and 3D.
@WeiqunZhang
WeiqunZhang merged commit 779d7d8 into AMReX-Codes:main Nov 5, 2026
19 checks passed
@WeiqunZhang
WeiqunZhang deleted the staggered-grids branch November 5, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant