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 xa, dia, and dja, and via its (integer) size ni and nj. The coordinates of the grid points are then given via

xa(i,j) = xa + i dia + j dja

for 0 i < ni and 0 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   compact0
scalars   dimensions0
  distributionCONSTANT
  group typeSCALAR
  timelevels1
 vararray_sizenscalars
 variable typeREAL




arrays1d   compact0
arrays1d   dimensions1
  distributionCONSTANT
  group typeARRAY
  sizeARRAY1D_NPOINTS_I
  timelevels1
 vararray_sizenarrays1d
 variable typeREAL




arrays2d   compact0
arrays2d   dimensions2
  distributionCONSTANT
  group typeARRAY
  sizeARRAY2D_NPOINTS_I
    sizeARRAY2D_NPOINTS_J
  timelevels1
 vararray_sizenarrays2d
 variable typeREAL




arrays3d   compact0
arrays3d   dimensions3
  distributionCONSTANT
  group typeARRAY
  sizeARRAY3D_NPOINTS_I
    sizeARRAY3D_NPOINTS_J
  sizeARRAY3D_NPOINTS_K
  timelevels1
 vararray_sizenarrays3d
 variable typeREAL




parrays1d   compact0
parrays1d   dimensions1
  distributionDEFAULT
  ghostsizeNGHOSTS
  group typeARRAY
  sizePARRAY1D_NPOINTS_I
  timelevels1
 vararray_sizenparrays1d
 variable typeREAL




parrays2d   compact0
parrays2d   dimensions2
  distributionDEFAULT
  ghostsizeNGHOSTS
    ghostsizeNGHOSTS
  group typeARRAY
  sizePARRAY2D_NPOINTS_I
    sizePARRAY2D_NPOINTS_J
  timelevels1
 vararray_sizenparrays2d
 variable typeREAL








  Group Names    Variable Names    Details   




parrays3d   compact0
parrays3d   dimensions3
  distributionDEFAULT
  ghostsizeNGHOSTS
    ghostsizeNGHOSTS
  ghostsizeNGHOSTS
  group typeARRAY
  sizePARRAY3D_NPOINTS_I
    sizePARRAY3D_NPOINTS_J
  sizePARRAY3D_NPOINTS_K
  timelevels1
 vararray_sizenparrays3d
 variable typeREAL




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