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

Base

Core data structures, kernels, reductions, I/O, ParmParse

AMR

Adaptive mesh refinement with AmrCore and AmrLevel

LinearSolvers

MLMG, GMRES and related solvers

EB

Embedded boundaries

Particles

Particle containers and particle-mesh operations

FFT

amrex::FFT transforms and FFT-based solvers

TimeIntegration

amrex::TimeIntegrator and SUNDIALS

Coupling

Multiple programs in one MPI job (MPMD)

Fortran

Applications written in Fortran with the AMReX Fortran interfaces

Python

pyAMReX

ML

Machine-learning inference

Applications

Complete solvers combining several topics

BuildSystems

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.