From c5e68615d13e2d12779c9d0347fbcc0eebaf4f5e Mon Sep 17 00:00:00 2001 From: schnetter <> Date: Tue, 13 May 2003 10:14:00 +0000 Subject: Handle empty grids. Handle empty grids. Fix global and level mode handling of the interpolator. Allow local mode calls for the interpolator, reduction operator, and hyperslabber, assuming that people know what they are doing. darcs-hash:20030513101400-07bb3-42af7544c2ea98dbef5a7ad6d5112bea2dcc404f.gz --- Carpet/CarpetReduce/src/reduce.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'Carpet/CarpetReduce/src/reduce.cc') diff --git a/Carpet/CarpetReduce/src/reduce.cc b/Carpet/CarpetReduce/src/reduce.cc index e05bf56d4..118ecf5be 100644 --- a/Carpet/CarpetReduce/src/reduce.cc +++ b/Carpet/CarpetReduce/src/reduce.cc @@ -1,4 +1,4 @@ -// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetReduce/src/reduce.cc,v 1.19 2003/05/12 16:25:28 schnetter Exp $ +// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetReduce/src/reduce.cc,v 1.20 2003/05/13 12:14:00 schnetter Exp $ #include #include @@ -22,7 +22,7 @@ #include "reduce.hh" extern "C" { - static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetReduce/src/reduce.cc,v 1.19 2003/05/12 16:25:28 schnetter Exp $"; + static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetReduce/src/reduce.cc,v 1.20 2003/05/13 12:14:00 schnetter Exp $"; CCTK_FILEVERSION(Carpet_CarpetReduce_reduce_cc); } @@ -667,7 +667,7 @@ namespace CarpetReduce { // TODO: allow all modes for grid scalars and grid arrays, and // restrict usage only for grid functions. for (int n=0; nlocal_components(reflevel) != 1 && component != -1) { - CCTK_WARN (0, "It is not possible to use a grid variable reduction operator in local mode"); - } - if (hh->local_components(reflevel) != 1) assert (component == -1); assert (cgh); @@ -715,6 +711,10 @@ namespace CarpetReduce { Initialise (cgh, proc, num_outvals, &myoutvals[0], outtype, &mycounts[0], red); + int const saved_component = component; + if (component!=-1) { + set_component (cgh, -1); + } BEGIN_LOCAL_COMPONENT_LOOP(cgh) { int lsh[grpdim], bbox[2*grpdim], nghostzones[grpdim]; @@ -761,6 +761,9 @@ namespace CarpetReduce { &mycounts[0], red); } END_LOCAL_COMPONENT_LOOP(cgh); + if (saved_component!=-1) { + set_component (cgh, saved_component); + } Finalise (cgh, proc, num_outvals, outvals, outtype, &myoutvals[0], &mycounts[0], -- cgit v1.2.3