diff options
Diffstat (limited to 'src/interp.c')
-rw-r--r-- | src/interp.c | 94 |
1 files changed, 87 insertions, 7 deletions
diff --git a/src/interp.c b/src/interp.c index d5d67b5..51c76a7 100644 --- a/src/interp.c +++ b/src/interp.c @@ -17,17 +17,26 @@ InterpToArray (CCTK_ARGUMENTS) - int const interpolator = CCTK_InterpHandle (interpolator_name); - assert (interpolator >= 0); - - int const options_table = Util_TableCreateFromString (interpolator_options); - assert (options_table >= 0); + int interpolator = -1; + if (!use_carpetinterp2) { + interpolator = CCTK_InterpHandle (interpolator_name); + assert (interpolator >= 0); + } - int const coord_handle = CCTK_CoordSystemHandle (interpolator_coordinates); - assert (coord_handle >= 0); + int options_table = -1; + if (!use_carpetinterp2) { + options_table = Util_TableCreateFromString (interpolator_options); + assert (options_table >= 0); + } + int coord_handle = -1; + if (!use_carpetinterp2) { + coord_handle = CCTK_CoordSystemHandle (interpolator_coordinates); + assert (coord_handle >= 0); + } + /* Scalars */ { int const nvars = nscalars; @@ -81,6 +90,16 @@ InterpToArray (CCTK_ARGUMENTS) outputs[n] = &scalars[npoints * n]; } + if (use_carpetinterp2) + { + int const ierr = InterpGridArrays + (cctkGH, 3, carpetinterp2_interpolator_order, + npoints, coords, + nvars, inputs, + nvars, outputs); + assert (! ierr); + } + else { int const ierr = CCTK_InterpGridArrays (cctkGH, 3, interpolator, options_table, coord_handle, @@ -185,6 +204,16 @@ InterpToArray (CCTK_ARGUMENTS) assert (! ierr); } + if (use_carpetinterp2) + { + int const ierr = InterpGridArrays + (cctkGH, 3, carpetinterp2_interpolator_order, + npoints, coords, + nvars, inputs, + nvars, outputs); + assert (! ierr); + } + else { int const ierr = CCTK_InterpGridArrays (cctkGH, 3, interpolator, options_table, coord_handle, @@ -275,6 +304,16 @@ InterpToArray (CCTK_ARGUMENTS) outputs[n] = &arrays2d[npoints * n]; } + if (use_carpetinterp2) + { + int const ierr = InterpGridArrays + (cctkGH, 3, carpetinterp2_interpolator_order, + npoints, coords, + nvars, inputs, + nvars, outputs); + assert (! ierr); + } + else { int const ierr = CCTK_InterpGridArrays (cctkGH, 3, interpolator, options_table, coord_handle, @@ -355,6 +394,16 @@ InterpToArray (CCTK_ARGUMENTS) outputs[n] = &arrays3d[npoints * n]; } + if (use_carpetinterp2) + { + int const ierr = InterpGridArrays + (cctkGH, 3, carpetinterp2_interpolator_order, + npoints, coords, + nvars, inputs, + nvars, outputs); + assert (! ierr); + } + else { int const ierr = CCTK_InterpGridArrays (cctkGH, 3, interpolator, options_table, coord_handle, @@ -470,6 +519,16 @@ InterpToArray (CCTK_ARGUMENTS) assert (! ierr); } + if (use_carpetinterp2) + { + int const ierr = InterpGridArrays + (cctkGH, 3, carpetinterp2_interpolator_order, + npoints, coords, + nvars, inputs, + nvars, outputs); + assert (! ierr); + } + else { int const ierr = CCTK_InterpGridArrays (cctkGH, 3, interpolator, options_table, coord_handle, @@ -574,6 +633,16 @@ InterpToArray (CCTK_ARGUMENTS) outputs[n] = &parrays2d[npoints * n]; } + if (use_carpetinterp2) + { + int const ierr = InterpGridArrays + (cctkGH, 3, carpetinterp2_interpolator_order, + npoints, coords, + nvars, inputs, + nvars, outputs); + assert (! ierr); + } + else { int const ierr = CCTK_InterpGridArrays (cctkGH, 3, interpolator, options_table, coord_handle, @@ -670,6 +739,16 @@ InterpToArray (CCTK_ARGUMENTS) outputs[n] = &parrays3d[npoints * n]; } + if (use_carpetinterp2) + { + int const ierr = InterpGridArrays + (cctkGH, 3, carpetinterp2_interpolator_order, + npoints, coords, + nvars, inputs, + nvars, outputs); + assert (! ierr); + } + else { int const ierr = CCTK_InterpGridArrays (cctkGH, 3, interpolator, options_table, coord_handle, @@ -690,6 +769,7 @@ InterpToArray (CCTK_ARGUMENTS) + if (options_table >= 0) { int const ierr = Util_TableDestroy (options_table); assert (! ierr); |