AMReX Tutorials
These tutorials show how to write codes with AMReX, a software framework for block-structured adaptive mesh refinement. Each tutorial is a small, self-contained program that runs on CPUs and GPUs (the Fortran ones on CPUs only, PyTorchInference not with HIP or SYCL), with MPI and OpenMP, and builds with CMake or GNU Make (the Python ones are scripts). Most of them check their result against an exact or reference answer, and all of them run as tests in CI (GPU builds are compiled only).
The source is in the amrex-tutorials repository. For the concepts and the full API, see the AMReX documentation.
Organization
Tutorials are organized by topic. Most live in <Topic>/<Name>/
with a README.md, an inputs file, a CMakeLists.txt and a
GNUmakefile; the Applications, BuildSystems and Python ones differ.
Each has a level:
★ introductory
★★ intermediate
★★★ advanced
Blueprint: a complete code meant to be copied as the starting point of an application
New users should start with Getting Started, then HelloWorld, MultiFab and HeatEquation in Base.
Topic |
Contents |
|---|---|
Core data structures, kernels, reductions, I/O, |
|
Adaptive mesh refinement with |
|
MLMG, GMRES and related solvers |
|
Embedded boundaries |
|
Particle containers and particle-mesh operations |
|
|
|
|
|
Multiple programs in one MPI job (MPMD) |
|
Applications written in Fortran with the AMReX Fortran interfaces |
|
pyAMReX |
|
Machine-learning inference |
|
Complete solvers combining several topics |
|
Standalone projects that build against AMReX |
Getting Started
Questions and help
Questions are welcome on AMReX’s GitHub Discussions. To add a tutorial, see CONTRIBUTING.md.
AMReX and these tutorials are distributed under the 3-clause BSD license; see LICENSE.