From fd85154cc2b399b7b3a38397f8bae3c158656d6a Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Wed, 16 Aug 2006 20:22:00 +0000 Subject: CarpetInterp: Ignore input variable indices which are -1 An input variable index which is set to -1 indicates that this variable should not be interpolated. Ignore these variables. darcs-hash:20060816202211-dae7b-061068b01c39fde284fb733f378ee01552b5cc3d.gz --- Carpet/CarpetInterp/src/interp.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Carpet/CarpetInterp/src') diff --git a/Carpet/CarpetInterp/src/interp.cc b/Carpet/CarpetInterp/src/interp.cc index d4e63974f..12b952202 100644 --- a/Carpet/CarpetInterp/src/interp.cc +++ b/Carpet/CarpetInterp/src/interp.cc @@ -209,6 +209,7 @@ namespace CarpetInterp { // Check input arrays int coord_group = -1; cGroupDynamicData coord_group_data; + int real_N_input_arrays = 0; for (int n = 0; n < N_input_arrays; n++) { // Negative indices are ignored @@ -216,6 +217,7 @@ namespace CarpetInterp { if (vindex < 0) { continue; } + ++ real_N_input_arrays; const int group = CCTK_GroupIndexFromVarI (vindex); if (group < 0) { @@ -254,6 +256,10 @@ namespace CarpetInterp { } } } + if (real_N_input_arrays == 0) { + // When there are no interpolation variables, use a pseudo group + coord_group = CCTK_GroupIndex ("grid::coordinates"); + } assert (coord_group >= 0); // Check output arrays @@ -1220,7 +1226,7 @@ namespace CarpetInterp { for (int n=0; n= 0 and vi < CCTK_NumVars()); + assert (vi == -1 or (vi >= 0 and vi < CCTK_NumVars())); if (vi == -1) { input_arrays[n] = NULL; -- cgit v1.2.3