Interpatch Interpolation

Erik Schnetter

December 12, 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 \(10^{-12}\)), then the interpolation dimension is reduced, so that either 2D or 1D interpolation is performed whenever possible, or even “0D” interpolation (i.e. copying 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




continue_if_selftest_fails
Scope: private BOOLEAN



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



Default: no






fill_patch0_radius_max
Scope: private REAL



Description: Interpolate to patch 0 up to this radius



Range Default: 1e+30
0.0:*






fill_patch0_radius_min
Scope: private REAL



Description: Interpolate to patch 0 from this radius on



Range Default: 1e+30
0.0:*






fill_patch0_xyradius_max
Scope: private REAL



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



Range Default: 1e+30
0.0:*






fill_patch0_xyradius_min
Scope: private REAL



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



Range Default: 1e+30
0.0:*






interpolate_zero
Scope: private BOOLEAN



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



Default: no






interpolator_order
Scope: private INT



Description: Interpolation order



Range Default: 4
0:*






interpolator_order_matter
Scope: private INT



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



Range Default: -1
-1
Don’t use special matter interpolator
1
1st-order Lagrange
2
2nd order ENO






poison
Scope: private REAL



Description: Poison value to detect uninitialised variables



Range Default: -4.2e+20
*:*






shift_edges
Scope: private BOOLEAN



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



Default: no






verbose
Scope: private BOOLEAN



Description: Produce debug output



Default: no



3 Interfaces

General

Implements:

interpolate

Inherits:

coordinates

grid

Grid Variables

3.0.1 PRIVATE GROUPS





  Group Names     Variable Names   Details    




test test compact 0
description Test grid function
dimensions 3
distribution DEFAULT
group type GF
tags tensortypealias=”Scalar” Checkpoint=”no” Prolongation=”none”
timelevels 1
variable type REAL




3.0.2 PUBLIC GROUPS





  Group Names     Variable Names   Details    




source_patch compact 0
Sn description source patch number
  description -1 for interior points
Sn description -2 for outer boundary points
Sn description -3 for inter-processor ghost points
Sn description -4 for symmetry boundary points
dimensions 3
distribution DEFAULT
group type GF
tags Checkpoint=”no” Prolongation=”none”
timelevels 1
variable type INT




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

 

Always: Conditional:
source_patch test
   

Scheduled Functions

CCTK_BASEGRID

  interpolate2init

  initialise interpolating inter-patch boundaries

 

  After: choosepatchsystem
    correctcoordinates
    spatialcoordinates
    coordinates_setglobalcoords_group
  Language: c
  Reads: grid::coordinates
    coordinates::interpolate_boundary_points
    coordinates::jacobian
  Type: function
  Writes: sn(everywhere)

CCTK_BASEGRID

  interpolate2test

  test interpolating inter-patch boundaries

 

  After: interpolate2init
  Storage: test
  Type: group

Interpolate2Test

  interpolate2testinit

  test: initialise test grid function

 

  Language: c
  Reads: grid::coordinates
    sn(everywhere)
  Type: function
  Writes: test(everywhere)

Interpolate2Test

  interpolate2testselectbcs

  test: interpolate test grid function

 

  After: interpolate2testinit
  Language: c
  Options: level
  Sync: test
  Type: function

Interpolate2Test

  applybcs

  test: interpolate test grid function

 

  After: interpolate2testselectbcs
  Options: level
  Type: group

Interpolate2Test

  interpolate2testcheck

  test: check test grid function

 

  After: interpolate2testapplybcs
  Language: c
  Reads: grid::coordinates
    sn(everywhere)
    test(everywhere)
  Type: function

BoundaryConditions

  interpolate2applybc

  apply interpolating inter-patch boundaries

 

  Language: c
  Options: level
  Reads: grid::coordinates
    coordinates::jacobian
    sn
  Type: function

Aliased Functions

 

Alias Name:         Function Name:
ApplyBCs Interpolate2TestApplyBCs