Skip to content

Make the tutorials plainer for C++ and AMReX beginners - #190

Merged
WeiqunZhang merged 5 commits into
AMReX-Codes:mainfrom
WeiqunZhang:beginner-friendly
Nov 6, 2026
Merged

WeiqunZhang merged 5 commits into
AMReX-Codes:mainfrom
WeiqunZhang:beginner-friendly

Conversation

@WeiqunZhang

Copy link
Copy Markdown
Member

Across Base, Particles, AMR, TimeIntegration, ML, EB, FFT and LinearSolvers: remove the helpers, templates and lambdas that existed only to verify results, inline one-use helpers and functors so each tutorial reads top to bottom, replace multi-value reductions and STL reference computations with plain calls and loops, write out clever index tricks, and cut each tutorial to one or two checks with a literal tolerance. Input-validation asserts go except the two that guard a real crash. Printed results are kept; READMEs updated.

Across Base, Particles, AMR, TimeIntegration, ML, EB, FFT and
LinearSolvers: remove the helpers, templates and lambdas that existed
only to verify results, inline one-use helpers and functors so each
tutorial reads top to bottom, replace multi-value reductions and STL
reference computations with plain calls and loops, write out clever
index tricks, and cut each tutorial to one or two checks with a
literal tolerance. Input-validation asserts go except the two that
guard a real crash. Printed results are kept; READMEs updated.
- EB/Geometry: 5% tolerance so coarser grids still pass.
- EB/Advection: do not write the final plotfile twice.
- Particles/MultiLevel: keep the grid-size assert; average_down needs
  fine grids coarsenable by 2.
- CustomLinOp: keep the singular-matrix assert.
- ABecLaplacian: name the wavenumber kwave, not k, next to the cell
  index k.
In single precision RK4 reaches round-off on the first grid, so the
measured rate is noise and the Clang single-precision CI job failed.
- EnergySpectrum: keep the n_cell > 16 assert; the exact spectrum
  indexes up to |k| = 8.
- ElectrostaticPIC: assert at least two zero crossings; a NaN
  frequency error no longer passes.
- RungeKutta: the error must be small for any method; the rate is
  checked only with two or more runs.
- EB/Advection: mass is checked to round-off again.
- NeighborList: keep the cutoff and skin asserts.
- Docs: drop descriptions of removed checks; refresh expected output.
The particle reductions call the lambda from host-device code, so the
CUDA build rejected the device-only lambdas in Basics and NeighborList.
@WeiqunZhang
WeiqunZhang merged commit 370bb6f into AMReX-Codes:main Nov 6, 2026
20 checks passed
@WeiqunZhang
WeiqunZhang deleted the beginner-friendly branch November 6, 2026 01:34
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