InterpToArray

Erik Schnetter <schnetter@cct.lsu.edu>

June 30, 2010

Abstract

Interpolate grid functions to grid arrays on a regular grid of locations, so that these can e.g. be output more easily.

1 Introduction

Some post-processing and visualisation tools cannot handle mesh refinement or multi-block systems. These tools then require interpolating the result onto a regular, uniform grid. This is what this thorn does.

InterpToArray can interpolate to 0D, 1D, 2D, and 3D grids. The interpolation result is stored in grid arrays. These can be either replicated or distributed over all processes. Note that using replicated (DISTRIB=constant) grid arrays can require a substantial amount of memory on each process.

2 Numerical Implementation

InterpToArray uses standard Cactus interpolators such as PUGHInterp or CarpetInterp.

3 Using This Thorn

The variables which should be interpolated are specified by parameters; currently, up to 100 variables can be interpolated.

The interpolator and its options are also specified via parameters.

Finally, the locations of the points of the regular grid are also specified via parameters. These grid points are specified via an origin and offsets, and they do not have to be aligned with the coordinate axes. For example, a 2D grid is specified via three (real) vectors \(x^a\), \(di^a\), and \(dj^a\), and via its (integer) size \(ni\) and \(nj\). The coordinates of the grid points are then given via

 a       a      a      a
x (i,j) = x + i⋅di + j ⋅dj

for \(0 \le i < ni\) and \(0 \le j < nj\). Grids with other dimensions are specified equivalently.

4 Parameters




array1d_dx_i
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






array1d_dy_i
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






array1d_dz_i
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






array1d_npoints_i
Scope: restricted INT



Description: Number of grid points for the 1D grid arrays in the i direction



Range Default: (none)
0:*






array1d_spacederivs
Scope: restricted INT



Description: Space derivative orders for each grid function



Range Default: (none)
0:*






array1d_timederivs
Scope: restricted INT



Description: Time derivative order for each grid function



Range Default: (none)
0:*






array1d_vars
Scope: restricted STRING



Description: Names of the grid functions that should be interpolated on a line



Range Default: (none)
ˆ
$
do not interpolate
see [1] below
grid function name



[1]

\^[A-Za-z][A-Za-z0-9\_]*[:][:][A-Za-z][A-Za-z0-9\_]*\$




array1d_x0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






array1d_y0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






array1d_z0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






array2d_dx_i
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






array2d_dx_j
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






array2d_dy_i
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






array2d_dy_j
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






array2d_dz_i
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






array2d_dz_j
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






array2d_npoints_i
Scope: restricted INT



Description: Number of grid points for the 2D grid arrays in the i direction



Range Default: (none)
0:*






array2d_npoints_j
Scope: restricted INT



Description: Number of grid points for the 2D grid arrays in the j direction



Range Default: (none)
0:*






array2d_vars
Scope: restricted STRING



Description: Names of the grid functions that should be interpolated on a 2D grid



Range Default: (none)
ˆ$
do not interpolate
see [1] below
grid function name



[1]

\^[A-Za-z][A-Za-z0-9\_]*[:][:][A-Za-z][A-Za-z0-9\_]*\$




array2d_x0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






array2d_y0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






array2d_z0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






array3d_dx_i
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






array3d_dx_j
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






array3d_dx_k
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






array3d_dy_i
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






array3d_dy_j
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






array3d_dy_k
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






array3d_dz_i
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






array3d_dz_j
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






array3d_dz_k
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






array3d_npoints_i
Scope: restricted INT



Description: Number of grid points for the 3D grid arrays in the i direction



Range Default: (none)
0:*






array3d_npoints_j
Scope: restricted INT



Description: Number of grid points for the 3D grid arrays in the j direction



Range Default: (none)
0:*






array3d_npoints_k
Scope: restricted INT



Description: Number of grid points for the 3D grid arrays in the k direction



Range Default: (none)
0:*






array3d_vars
Scope: restricted STRING



Description: Names of the grid functions that should be interpolated on a 3D grid



Range Default: (none)
ˆ$
do not interpolate
see [1] below
grid function name



[1]

\^[A-Za-z][A-Za-z0-9\_]*[:][:][A-Za-z][A-Za-z0-9\_]*\$




array3d_x0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






array3d_y0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






array3d_z0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






carpetinterp2_interpolator_order
Scope: restricted INT



Description: Order of interpolation for CarpetInterp2



Range Default: 2
0:*
any order supported by CarpetInterp2






interpolator_coordinates
Scope: restricted STRING



Description: Coordinate system



Range Default: cart3d
.*
must be a registered coordinate system






interpolator_name
Scope: restricted STRING



Description: Name of the interpolator



Range Default: Lagrange polynomial interpolation
.*
must be a registered interpolator






interpolator_options
Scope: restricted STRING



Description: Options for the interpolator



Range Default: order=2
.*
must be a valid option specification






narrays1d
Scope: restricted INT



Description: Number of 1D grid arrays



Range Default: (none)
0:100






narrays2d
Scope: restricted INT



Description: Number of 2D grid arrays



Range Default: (none)
0:100






narrays3d
Scope: restricted INT



Description: Number of 3D grid arrays



Range Default: (none)
0:100






nghosts
Scope: restricted INT



Description: Number of ghost zones



Range Default: (none)
0:*






nparrays1d
Scope: restricted INT



Description: Number of 1D parallel grid arrays



Range Default: (none)
0:100






nparrays2d
Scope: restricted INT



Description: Number of 2D parallel grid arrays



Range Default: (none)
0:100






nparrays3d
Scope: restricted INT



Description: Number of 3D grid parrays



Range Default: (none)
0:100






nscalars
Scope: restricted INT



Description: Number of grid scalars



Range Default: (none)
0:100






parray1d_dx_i
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






parray1d_dy_i
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






parray1d_dz_i
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






parray1d_npoints_i
Scope: restricted INT



Description: Number of grid points for the 1D grid parrays in the i direction



Range Default: (none)
0:*






parray1d_spacederivs
Scope: restricted INT



Description: Space derivative orders for each grid function



Range Default: (none)
0:*






parray1d_timederivs
Scope: restricted INT



Description: Time derivative order for each grid function



Range Default: (none)
0:*






parray1d_vars
Scope: restricted STRING



Description: Names of the grid functions that should be interpolated on a line



Range Default: (none)
ˆ$
do not interpolate
see [1] below
grid function name



[1]

\^[A-Za-z][A-Za-z0-9\_]*[:][:][A-Za-z][A-Za-z0-9\_]*\$




parray1d_x0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






parray1d_y0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






parray1d_z0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






parray2d_dx_i
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






parray2d_dx_j
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






parray2d_dy_i
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






parray2d_dy_j
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






parray2d_dz_i
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






parray2d_dz_j
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






parray2d_npoints_i
Scope: restricted INT



Description: Number of grid points for the 2D parallel grid arrays in the i direction



Range Default: (none)
0:*






parray2d_npoints_j
Scope: restricted INT



Description: Number of grid points for the 2D parallel grid arrays in the j direction



Range Default: (none)
0:*






parray2d_vars
Scope: restricted STRING



Description: Names of the grid functions that should be interpolated on a 2D grid



Range Default: (none)
ˆ$
do not interpolate
see [1] below
grid function name



[1]

\^[A-Za-z][A-Za-z0-9\_]*[:][:][A-Za-z][A-Za-z0-9\_]*\$




parray2d_x0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






parray2d_y0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






parray2d_z0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






parray3d_dx_i
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






parray3d_dx_j
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






parray3d_dx_k
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






parray3d_dy_i
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






parray3d_dy_j
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






parray3d_dy_k
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






parray3d_dz_i
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






parray3d_dz_j
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






parray3d_dz_k
Scope: restricted REAL



Description: Spacing



Range Default: 0.0
0.0:*






parray3d_npoints_i
Scope: restricted INT



Description: Number of grid points for the 3D parallel grid arrays in the i direction



Range Default: (none)
0:*






parray3d_npoints_j
Scope: restricted INT



Description: Number of grid points for the 3D parallel grid arrays in the j direction



Range Default: (none)
0:*






parray3d_npoints_k
Scope: restricted INT



Description: Number of grid points for the 3D parallel grid arrays in the k direction



Range Default: (none)
0:*






parray3d_vars
Scope: restricted STRING



Description: Names of the grid functions that should be interpolated on a 3D grid



Range Default: (none)
ˆ$
do not interpolate
see [1] below
grid function name



[1]

\^[A-Za-z][A-Za-z0-9\_]*[:][:][A-Za-z][A-Za-z0-9\_]*\$




parray3d_x0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






parray3d_y0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






parray3d_z0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






scalar_vars
Scope: restricted STRING



Description: Names of the grid functions that should be interpolated on a point



Range Default: (none)
ˆ$
do not interpolate
see [1] below
grid function name



[1]

\^[A-Za-z][A-Za-z0-9\_]*[:][:][A-Za-z][A-Za-z0-9\_]*\$




scalar_x0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






scalar_y0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






scalar_z0
Scope: restricted REAL



Description: Origin



Range Default: 0.0
*:*






use_carpetinterp2
Scope: restricted BOOLEAN



Description: Use InterpGridArrays rather than CCTK_InterpGridArrays



Default: no



5 Interfaces

General

Implements:

interptoarray

Grid Variables

5.0.1 PUBLIC GROUPS





  Group Names     Variable Names   Details    




scalars scalars compact 0
dimensions 0
distribution CONSTANT
group type SCALAR
timelevels 1
vararray_size nscalars
variable type REAL




arrays1d arrays1d compact 0
dimensions 1
distribution CONSTANT
group type ARRAY
size ARRAY1D_NPOINTS_I
timelevels 1
vararray_size narrays1d
variable type REAL




arrays2d arrays2d compact 0
dimensions 2
distribution CONSTANT
group type ARRAY
size ARRAY2D_NPOINTS_I
  size ARRAY2D_NPOINTS_J
timelevels 1
vararray_size narrays2d
variable type REAL




arrays3d arrays3d compact 0
dimensions 3
distribution CONSTANT
group type ARRAY
size ARRAY3D_NPOINTS_I
  size ARRAY3D_NPOINTS_J
size ARRAY3D_NPOINTS_K
timelevels 1
vararray_size narrays3d
variable type REAL




parrays1d parrays1d compact 0
dimensions 1
distribution DEFAULT
ghostsize NGHOSTS
group type ARRAY
size PARRAY1D_NPOINTS_I
timelevels 1
vararray_size nparrays1d
variable type REAL




parrays2d parrays2d compact 0
dimensions 2
distribution DEFAULT
ghostsize NGHOSTS
  ghostsize NGHOSTS
group type ARRAY
size PARRAY2D_NPOINTS_I
  size PARRAY2D_NPOINTS_J
timelevels 1
vararray_size nparrays2d
variable type REAL








  Group Names     Variable Names   Details    




parrays3d parrays3d compact 0
dimensions 3
distribution DEFAULT
ghostsize NGHOSTS
  ghostsize NGHOSTS
ghostsize NGHOSTS
group type ARRAY
size PARRAY3D_NPOINTS_I
  size PARRAY3D_NPOINTS_J
size PARRAY3D_NPOINTS_K
timelevels 1
vararray_size nparrays3d
variable type REAL




6 Schedule

This section lists all the variables which are assigned storage by thorn CactusNumerical/InterpToArray. 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

NONE

Scheduled Functions

CCTK_ANALYSIS

  interptoarray

  interpolate to grid arrays

 

  Language: c
  Options: global
  Storage: scalars
    arrays1d
    arrays2d
    arrays3d
    parrays1d
    parrays2d
    parrays3d
  Triggers: scalars
    arrays1d
    arrays2d
    arrays3d
    parrays1d
    parrays2d
    parrays3d
  Type: function
  Writes: interptoarray::scalars
    arrays1d
    arrays2d
    arrays3d
    interptoarray::parrays1d
    parrays2d
    parrays3d