aboutsummaryrefslogtreecommitdiff
path: root/src/Interpolation.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Interpolation.c')
-rw-r--r--src/Interpolation.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/Interpolation.c b/src/Interpolation.c
index 6873ebe..7835d7f 100644
--- a/src/Interpolation.c
+++ b/src/Interpolation.c
@@ -108,6 +108,8 @@ CCTK_FILEVERSION (CactusBase_SymBase_Interpolation_c);
0 for success
-91 GH is NULL
-92 N_dims is not equal to cctkGH->cctk_dim
+ -93 Input array has illegal group type
+ -94 Mixing grid functions and grid arrays
@endreturndesc
@@*/
@@ -130,6 +132,8 @@ SymBase_SymmetryInterpolate (CCTK_POINTER_TO_CONST const cctkGH_,
CCTK_INT sym_table;
CCTK_FPOINTER symmetry_interpolate[100];
CCTK_INT faces;
+ int has_grid_arrays, has_only_grid_arrays;
+ int n;
int f;
int ierr;
@@ -140,6 +144,48 @@ SymBase_SymmetryInterpolate (CCTK_POINTER_TO_CONST const cctkGH_,
return -91;
}
+ /* If this interpolates grid arrays, then do not apply symmetries --
+ there are no symmetries registered for grid arrays (yet). */
+ has_grid_arrays = 0;
+ has_only_grid_arrays = 1;
+ for (n=0; n<N_input_arrays; ++n)
+ {
+ switch (CCTK_GroupTypeFromVarI (input_array_indices[n]))
+ {
+ case CCTK_GF:
+ has_only_grid_arrays = 0;
+ break;
+ case CCTK_SCALAR:
+ case CCTK_ARRAY:
+ has_grid_arrays = 1;
+ break;
+ default:
+ CCTK_WARN (1, "Could not determine group type of input arrays");
+ return -93;
+ }
+ }
+ if (has_grid_arrays && ! has_only_grid_arrays)
+ {
+ CCTK_WARN (1, "The input arrays contain both grid function and grid arrays; this is not possible");
+ return -94;
+ }
+ if (has_grid_arrays)
+ {
+ /* Call the real interpolator */
+ ierr = CCTK_IsFunctionAliased ("DriverInterpolate");
+ if (! ierr)
+ {
+ CCTK_WARN (0, "The aliased function \"DriverInterpolate\" has not been provided");
+ }
+ return DriverInterpolate
+ (cctkGH, N_dims,
+ local_interp_handle, param_table_handle, coord_system_handle,
+ N_interp_points, interp_coords_type, interp_coords,
+ N_input_arrays, input_array_indices,
+ N_output_arrays, output_array_types, output_arrays);
+ }
+
+ /* Check arguments */
if (N_dims != cctkGH->cctk_dim)
{
CCTK_WARN (1, "The number of dimensions is not equal to the GH's number of dimensions");