aboutsummaryrefslogtreecommitdiff
path: root/Carpet/Carpet/src/carpet_public.hh
diff options
context:
space:
mode:
authorschnetter <>2003-05-05 12:57:00 +0000
committerschnetter <>2003-05-05 12:57:00 +0000
commitf160f39f40a66c7207a8d3c67b4a68840be2f34b (patch)
tree62e228f8df69ca221072f488441b719a13a0731f /Carpet/Carpet/src/carpet_public.hh
parenta56fdc58d5639eb5251156c28277175fd70531b4 (diff)
Handle extended local mode.
darcs-hash:20030505125728-07bb3-d787aab6d601677762824278d3cbe5b4ae61838f.gz
Diffstat (limited to 'Carpet/Carpet/src/carpet_public.hh')
-rw-r--r--Carpet/Carpet/src/carpet_public.hh34
1 files changed, 17 insertions, 17 deletions
diff --git a/Carpet/Carpet/src/carpet_public.hh b/Carpet/Carpet/src/carpet_public.hh
index 862bbd67a..d26ffaaee 100644
--- a/Carpet/Carpet/src/carpet_public.hh
+++ b/Carpet/Carpet/src/carpet_public.hh
@@ -1,4 +1,4 @@
-// $Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/carpet_public.hh,v 1.24 2003/05/02 14:22:08 schnetter Exp $
+// $Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/carpet_public.hh,v 1.25 2003/05/05 14:57:28 schnetter Exp $
// It is assumed that the number of components of all arrays is equal
// to the number of components of the grid functions, and that their
@@ -232,23 +232,23 @@ namespace Carpet {
-#define BEGIN_LOCAL_COMPONENT_LOOP(cgh) \
- do { \
- int _lcl; \
- assert (reflevel>=0 && reflevel<hh->reflevels()); \
- assert (mglevel>=0 && mglevel<mglevels); \
- assert (component==-1); \
- for (int _c=0; _c<hh->components(reflevel); ++_c) { \
- if (hh->is_local(reflevel,_c)) { \
- set_component ((cGH*)(cgh), _c); \
+#define BEGIN_LOCAL_COMPONENT_LOOP(cgh) \
+ do { \
+ int _lcl; \
+ assert (reflevel>=0 && reflevel<hh->reflevels()); \
+ assert (mglevel>=0 && mglevel<mglevels); \
+ assert (hh->local_components(reflevel)==1 || component==-1); \
+ int const saved_component = component; \
+ for (int _c=0; _c<hh->components(reflevel); ++_c) { \
+ if (hh->is_local(reflevel,_c)) { \
+ set_component ((cGH*)(cgh), _c); \
{
-#define END_LOCAL_COMPONENT_LOOP(cgh) \
- } \
- } \
- } \
- set_component ((cGH*)(cgh), -1); \
- assert (component==-1); \
- _lcl = 0; \
+#define END_LOCAL_COMPONENT_LOOP(cgh) \
+ } \
+ } \
+ } \
+ set_component ((cGH*)(cgh), saved_component); \
+ _lcl = 0; \
} while (0)
} // namespace Carpet