aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetInterp
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2006-08-16 20:22:00 +0000
committerErik Schnetter <schnetter@cct.lsu.edu>2006-08-16 20:22:00 +0000
commitfd85154cc2b399b7b3a38397f8bae3c158656d6a (patch)
treed16f03af2f6d575f5442d02337ef5896893c6109 /Carpet/CarpetInterp
parent118181d8d214ee07388ca34831dd549b3a768a02 (diff)
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
Diffstat (limited to 'Carpet/CarpetInterp')
-rw-r--r--Carpet/CarpetInterp/src/interp.cc8
1 files changed, 7 insertions, 1 deletions
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<N_input_arrays; ++n) {
int const vi = input_array_variable_indices[n];
- assert (vi >= 0 and vi < CCTK_NumVars());
+ assert (vi == -1 or (vi >= 0 and vi < CCTK_NumVars()));
if (vi == -1) {
input_arrays[n] = NULL;