diff options
Diffstat (limited to 'src/interp.c')
-rw-r--r-- | src/interp.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/interp.c b/src/interp.c index badaead..91a84b8 100644 --- a/src/interp.c +++ b/src/interp.c @@ -28,6 +28,8 @@ InterpToArray (CCTK_ARGUMENTS) CCTK_INT * restrict inputs; CCTK_INT * restrict output_types; CCTK_POINTER * restrict outputs; + CCTK_INT * restrict operation_codes; + CCTK_INT * restrict time_deriv_order; int nvars; int npoints; @@ -97,7 +99,7 @@ InterpToArray (CCTK_ARGUMENTS) for (n=0; n<nvars; ++n) { outputs[n] = &scalars[npoints * n]; } - + ierr = CCTK_InterpGridArrays (cctkGH, 3, interpolator, options_table, coord_handle, npoints, CCTK_VARIABLE_REAL, coords, @@ -165,19 +167,50 @@ InterpToArray (CCTK_ARGUMENTS) for (n=0; n<nvars; ++n) { outputs[n] = &arrays1d[npoints * n]; } + + operation_codes = malloc (nvars * sizeof * operation_codes); + assert (operation_codes); + + for (n=0; n<nvars; ++n) { + operation_codes[n] = array1d_spacederivs[n]; + } + + ierr = Util_TableSetIntArray + (options_table, nvars, operation_codes, "operation_codes"); + assert (! ierr); + + time_deriv_order = malloc (nvars * sizeof * time_deriv_order); + assert (time_deriv_order); + + for (n=0; n<nvars; ++n) { + time_deriv_order[n] = array1d_timederivs[n]; + } + ierr = Util_TableSetIntArray + (options_table, nvars, time_deriv_order, "time_deriv_order"); + assert (! ierr); + ierr = CCTK_InterpGridArrays (cctkGH, 3, interpolator, options_table, coord_handle, npoints, CCTK_VARIABLE_REAL, coords, nvars, inputs, nvars, output_types, outputs); + assert (! ierr); + + ierr = Util_TableDeleteKey (options_table, "operation_codes"); + assert (! ierr); + ierr = Util_TableDeleteKey (options_table, "time_deriv_order"); + assert (! ierr); + free (coordsx); free (coordsy); free (coordsz); free (inputs); free (output_types); free (outputs); + free (operation_codes); + free (time_deriv_order); } } |