aboutsummaryrefslogtreecommitdiff
path: root/Carpet/Carpet/src/carpet_public.hh
diff options
context:
space:
mode:
authorschnetter <>2003-05-02 12:22:00 +0000
committerschnetter <>2003-05-02 12:22:00 +0000
commit3076318709363ac0c1de93993df67c183c164b7b (patch)
treea77aaee3e029ec91672b99e39d71442c2a5e0cea /Carpet/Carpet/src/carpet_public.hh
parent92b19fa4f2efdd5cf2bf8fafb00b0543f768dae0 (diff)
Allow component loops in "extented local mode", which is a local mode
Allow component loops in "extented local mode", which is a local mode in single-patch mode. darcs-hash:20030502122208-07bb3-622cb2d2f46f48a79abbc22964f3ace5baf45c0c.gz
Diffstat (limited to 'Carpet/Carpet/src/carpet_public.hh')
-rw-r--r--Carpet/Carpet/src/carpet_public.hh30
1 files changed, 15 insertions, 15 deletions
diff --git a/Carpet/Carpet/src/carpet_public.hh b/Carpet/Carpet/src/carpet_public.hh
index f88e873f7..862bbd67a 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.23 2003/01/03 15:49:36 schnetter Exp $
+// $Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/carpet_public.hh,v 1.24 2003/05/02 14:22:08 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
@@ -213,21 +213,21 @@ namespace Carpet {
// Component iterator
-#define BEGIN_COMPONENT_LOOP(cgh) \
- do { \
- int _cl; \
- assert (reflevel>=0 && reflevel<hh->reflevels()); \
- assert (mglevel>=0 && mglevel<mglevels); \
- assert (component==-1); \
- for (int _c=0; _c<hh->components(reflevel); ++_c) { \
- set_component ((cGH*)(cgh), _c); \
+#define BEGIN_COMPONENT_LOOP(cgh) \
+ do { \
+ int _cl; \
+ 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) { \
+ set_component ((cGH*)(cgh), _c); \
{
-#define END_COMPONENT_LOOP(cgh) \
- } \
- } \
- set_component ((cGH*)(cgh), -1); \
- assert (component==-1); \
- _cl = 0; \
+#define END_COMPONENT_LOOP(cgh) \
+ } \
+ } \
+ set_component ((cGH*)(cgh), saved_component); \
+ _cl = 0; \
} while (0)