Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Alignment/Centering of Grids and Points

Various sets of grids and points are used in GeoClaw, for input data, as computational grids, and for output of results. One convenient feature of GeoClaw is that in principle these grids and points need not be aligned with each other in any particular way and the code will run and generally produce useful results.

However, there are some situations in which it is highly desirable to pay more attention to their alignment, and a few cases where misleading results might be obtained that could be avoided by adjusting the alignment.

Types of grids/points used in GeoClaw

First a summary of some of the different grids/points used in GeoClaw:

Interpolation methods

Transferring information from one grid to another grid or set of points typically requires some form of interpolation. Two forms are used in GeoClaw, as described in the next sections. For this discussion we assume we want to interpolate to some arbitrary gauge location, but the same approaches are used to interpolate to points on an fgout or fgmax grid.

Piecewise constant (order 0) interpolation

Since the finite volume method produces cell averages, we can think of the solution as constant over each grid cell. To interpolate to a gauge location, for example, we can determine what grid cell the gauge lies in (on the finest AMR level available at this point) and then simply take the cell average values in that cell as the value at the gauge.

Piecewise bilinear (order 1) interpolation

In many cases a better approximation to the value at a point can be obtained using bilinear interpolation. Consider the cell averages of the solution as defining pointwise values at the cell centers. Then determine what 4 cell centers surround the gauge location of interest. The 4 values a the 4 cell centers defines a unique bilinear function over the rectangle they define. This function has the form $L(x,y) = a_0 + a_1x

Computing GeoClaw cell-averaged B values from topofile

Alignment of topofiles and computational grids

Constant vs. bilinear interpolation of solution

Interpolation to gauges

Centering gauges