xx Interpatch Interpolation

Interpatch Interpolation

Erik Schnetter

May 17, 2024

Abstract

The Interpolate2 thorn provides interpatch interpolation.

1 Overview

The interpolator works in several steps.

In the first step, during startup, it decides which points need to be set via interpolation. This is usually a layer N grid points deep at the boundaries of the patches, excluding ghost zones, and also excluding the outer boundaries.

After each regridding, the Coordinates thorn iterates over these grid points, converts their locations to global coordinates, and finds out which patch “owns” each location. It then assumes that this location is sufficiently far in the interior of the patch that one can apply a full interpolation stencil there. That is, the interpolation source must be surrounded by sufficiently many ghost zones, outer boundary points, or additional overlap points that the stencil does not include any other inter-patch boundary points. This condition depends, among other things, on the grid spacings in the patches, and thus there is no generic rule. It is tested each time via a dummy interpolation.

At this point, Interpolate2 also calculates and stores the weights for the interpolation stencils, because calculating them is somewhat expensive. If the interpolation point is on a 2D plane, 1D line, or on a grid point (with a small tolerance of about ), then the interpolation dimension is reduced, so that either 2D or 1D interpolation is performed whenever possible, or even “0D” interpolation (i.e.xcopying of grid points).

Finally, each time the symmetry boundary conditions are applied, these stencils are evaluated and the result transferred (via MPI) to the target process.

Interpolate2 provides the same interface as Interpolate, but it uses the CarpetInterp2 thorn to perform the actual interpolation instead of CarpetInterp. This is more efficient.

2 Parameters

11continuexifxselftestxfails 10Scope: privatex01  BOOLEAN

11Description: Continue if the self test fails – this is only for debugging

11                  10  x01  Default: no

11

11fillxpatch0xradiusxmax 10Scope: privatex01  REAL

11Description: Interpolate to patch 0 up to this radius

11 Range 10 x01 Default: 1e+30
110.0:*  10

11

11fillxpatch0xradiusxmin 10Scope: privatex01  REAL

11Description: Interpolate to patch 0 from this radius on

11 Range 10 x01 Default: 1e+30
110.0:*  10

11

11fillxpatch0xxyradiusxmax 10Scope: privatex01  REAL

11Description: Interpolate to patch 0 up to this cylindrical radius in the x-y plane

11 Range 10 x01 Default: 1e+30
110.0:*  10

11

11fillxpatch0xxyradiusxmin 10Scope: privatex01  REAL

11Description: Interpolate to patch 0 from this cylindrical radius in the x-y plane on

11 Range 10 x01 Default: 1e+30
110.0:*  10

11

11interpolatexzero  10Scope: privatex01  BOOLEAN

11Description: Set interpolation result to zero – this is only for debugging

11                  10  x01  Default: no

11interpolatorxorder 10Scope: privatex01  INT

11Description: Interpolation order

11  Range  10  x01  Default: 4

110:*  10

11

11interpolatorxorderxmatter 10Scope: privatex01  INT

11Description: Interpolation order for those variables having an ’interpolator=matter’ tag

11 Range 10 x01 Default: -1
11-1  10Don’t use special matter interpolator
111  101st-order Lagrange
112  102nd order ENO

11

11poison  10Scope: privatex01  REAL

11Description: Poison value to detect uninitialised variables

11  Range  10  x01  Default: -4.2e+20

11*:*  10

11

11shiftxedges  10Scope: privatex01  BOOLEAN

11Description: Artificially shift coordinates of grid function edges (use this for DGFE)

11                  10  x01  Default: no

11

11verbose  10Scope: privatex01  BOOLEAN

11Description: Produce debug output

11                  10  x01  Default: no

11

3 Interfaces

General Implements: interpolate

Inherits: coordinates grid

Grid Variables 3.0.1 PRIVATE GROUPS

11x Group Names x10x Variable Names xx01 Details x11x
11 test 10 test x01 compact110
11                 10  x01 description11Test grid function
11                 10  x01 dimensions113
11                 10  x01 distribution11DEFAULT
11                 10  x01 group type11GF
11 10 x01 tags11tensortypealias=”Scalar” Checkpoint=”no” Prolongation=”none”
11                 10  x01 timelevels111
11                 10  x01variable type11REAL

11

3.0.2 PUBLIC GROUPS

11x Group Names x10x Variable Names xx01 Details x11x
11 sourcexpatch 10  x01  compact110
11                 10  Sn  x01 description11source patch number
11                 10  x  x01 description11-1 for interior points
11                 10  Sn  x01 description11-2 for outer boundary points
11                 10  Sn  x01 description11-3 for inter-processor ghost points
11                 10  Sn  x01 description11-4 for symmetry boundary points
11                 10  x01 dimensions113
11                 10  x01 distribution11DEFAULT
11                 10  x01 group type11GF
11 10 x01 tags11Checkpoint=”no” Prolongation=”none”
11                 10  x01 timelevels111
11                 10  x01variable type11INT

11

Uses header: tensortypes.h loopcontrol.h carpetinterp2.hh

4 Schedule This section lists all the variables which are assigned storage by thorn Llama/Interpolate2. Storage can either last for the duration of the run (Always means that if this thorn is activated storage will be assigned, Conditional means that if this thorn is activated storage will be assigned for the duration of the run if some condition is met), or can be turned on for the duration of a schedule function.

Storage

11Always: 11Conditional:
11sourcexpatch11test

11x  11x

11

Scheduled Functions

CCTKxBASEGRID x interpolate2init x initialise interpolating inter-patch boundaries x

11x11After: 11choosepatchsystem
11 x 11x  11correctcoordinates
11 x 11x  11spatialcoordinates
11 x 11x  11coordinatesxsetglobalcoordsxgroup
11 x 11Language:11c
11 x 11Reads: 11grid::coordinates
11 x 11x  11coordinates::interpolatexboundaryxpoints
11 x 11x  11coordinates::jacobian
11 x 11Type: 11function
11 x 11Writes: 11sn(everywhere)

11

CCTKxBASEGRID x interpolate2test x test interpolating inter-patch boundaries x

11x11After: 11interpolate2init
11 x 11Storage:11test
11 x 11Type: 11group

11

Interpolate2Test x interpolate2testinit x test: initialise test grid function x

11x11Language:11c
11 x 11Reads: 11grid::coordinates
11 x 11x  11sn(everywhere)
11 x 11Type: 11function
11 x 11Writes: 11test(everywhere)

11

Interpolate2Test x interpolate2testselectbcs x test: interpolate test grid function

11x11After: 11interpolate2testinit
11 x 11Language:11c
11 x 11Options: 11level
11 x 11Sync:  11test
11 x 11Type: 11function

11

Interpolate2Test x applybcs x test: interpolate test grid function x

11x11After: 11interpolate2testselectbcs
11 x 11Options:11level
11 x 11Type: 11group

11

Interpolate2Test x interpolate2testcheck x test: check test grid function x

11x11After: 11interpolate2testapplybcs
11 x 11Language:11c
11 x 11Reads: 11grid::coordinates
11 x 11x  11sn(everywhere)
11 x 11x  11test(everywhere)
11 x 11Type: 11function

11

BoundaryConditions x interpolate2applybc x apply interpolating inter-patch boundaries x

11x11Language:11c
11 x 11Options: 11level
11 x 11Reads: 11grid::coordinates
11 x 11x  11coordinates::jacobian

11 x 11x  11sn

11 x 11Type: 11function

11

Aliased Functions x

11Alias Name: xxxxxxx11Function Name:
11ApplyBCs  11Interpolate2TestApplyBCs