Adaptive Mesh Refinement

Ian Hawke <>

November 05 2004


A brief description of how to use AMR.

1 Introduction

This thorn is a regridding thorn to work with Carpet. It is meant to directly replace the standard CarpetRegrid thorn and many of the parameters are based directly on standard parameters that people already use. However, this thorn is meant to provide full Adaptive Mesh Refinement (AMR). The thorn is not complete by itself; as described below, an error indicator needs to be given.

As those that use mesh refinement will know, the question of where to put the refined grids is as much art as science. The crucial points are the following:

  1. We wish to refine as few points as possible. The reason for this is to reduce memory overhead and to reduce runtime. The latter is particularly important as the runtime is essentially dominated by the finest level(s).
  2. We wish to create as few new grids as possible. The reason for this is that the ghost zones required for the boundaries of the grids are, in a sense, a waste of computational time. Therefore the larger the boundaries the more time the code will spend filling zones that have no benefit for the evolution. The more grids, the larger the boundary for any given benefit.
  3. We wish to place the refined grid(s) where they will do the most good; that is, where the error is highest. This allows us to get a (more) uniform error over the whole domain.

Therefore the problem to be solved is to balance requirements (1) and (2) in a sensible way whilst ensuring that the error is minimized as required by point (3).

The process by which this is achieved is twofold:

  1. An approximation to the error is found. For “true” AMR this is usually meant to be an approximation to the truncation error found using Richardson extrapolation and a shadow heirachy. However, this can be expensive and may not work well at low resolutions (particularly in the Carpet case when a large number of buffer zones are in use). Instead a separate approximation can be used (often called an error indicator instead of a true error estimate) based on certain physical properties of the solution, such as a curvature based method (such as is used in Paramesh).
  2. The points marked in error are then “clustered” into Cartesian boxes. The Cartesian boxes can either be pre-determined (as in Paramesh) or computed on-the-fly, as done here. It might be that a box is refined only if a certain fraction of its points are marked in error (I believe this is the Paramesh approach) or that every point marked in error is contained in a refined box, which is the approach taken here.

Essentially, this thorn requires somebody else to compute the approximation to the error and to store it in a grid function. It will then cluster the points in error, providing Carpet with a new grid structure.

For those that want the real details, this is basically an implementation of the clustering algorithm of Berger and Rigoutsos [1].

2 Using This Thorn

As a user you should just replace CarpetRegrid with CarpetAdaptiveRegrid in your parameter file and set the appropriate parameters correctly: