I will present an overview of the DISPATCH task-based adaptive mesh-refinement code framework, which is designed to host a wide variety of mesh- and particle-based solvers. The central idea is to partition large problems into many semi-independent computational tasks. For example, magnetohydrodynamic (MHD) tasks typically consist of small Cartesian 3-D data cubes (“patches”) evolved using Riemann solvers.

By arranging large numbers of such patches in a “volleyball” geometry — with small tilts and overlaps between neighboring cubes — one can cover spherical domains, or even curved space-time geometries such as Kerr black holes, while retaining the efficiency and simplicity of local Cartesian solvers.

Tasks are grouped into MPI ranks, while parallel execution is handled by a lightweight task dispatcher that dynamically schedules task updates. This results in near-embarrassingly parallel execution, allowing solver implementations to remain independent of both MPI and OpenMP details. The ability to use local time stepping provides major efficiency gains in problems spanning large spatial and temporal ranges with strong local variations.

DISPATCH is currently used in applications ranging from star formation in the interstellar medium, to 3-D non-LTE stellar atmosphere modeling for the 4MOST project, to high-resolution simulations of solar and stellar convection.

I will specifically illustrate these methods in the context of the ERC/Synergy Whole Sun project, which aims to model the Sun as a coupled multi-scale physical system. The project has now reached the stage where it is possible to simulate the entire solar convection zone, including the photosphere and optionally chromospheric and coronal physics, covering the entire solar surface.

A key strategy is a “zoom-in” methodology: starting from Whole Sun snapshots, simulations can focus on specific spatial and temporal regions of interest — such as active regions — while retaining realistic initial and boundary conditions derived from the global model. Within such zoom-in regions, additional physics can be included, for example embedding particle-in-cell solvers within MHD simulations, enabling studies of non-thermal particle acceleration in realistic solar environments.