diff options
author | schnetter <> | 2003-05-13 14:31:00 +0000 |
---|---|---|
committer | schnetter <> | 2003-05-13 14:31:00 +0000 |
commit | 48e194f027e1024dd0c96d347c81edadf3f380f3 (patch) | |
tree | 0e20b39041ea09a5b82119a9d1de59e5459d7805 /Carpet/Carpet/src/Poison.cc | |
parent | 361ead75fd28f7273dabef58463cc617ee4eb1c1 (diff) |
Poison: Check storage of GFs and GAs differently.
Poison: Check storage of GFs and GAs differently.
Small changes; debug helpers.
darcs-hash:20030513143147-07bb3-019312f33bda76cdc2a250b0335a9fca76926202.gz
Diffstat (limited to 'Carpet/Carpet/src/Poison.cc')
-rw-r--r-- | Carpet/Carpet/src/Poison.cc | 54 |
1 files changed, 32 insertions, 22 deletions
diff --git a/Carpet/Carpet/src/Poison.cc b/Carpet/Carpet/src/Poison.cc index ca0292603..2e8922158 100644 --- a/Carpet/Carpet/src/Poison.cc +++ b/Carpet/Carpet/src/Poison.cc @@ -8,7 +8,7 @@ #include "carpet.hh" extern "C" { - static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/Poison.cc,v 1.9 2002/10/24 10:39:38 schnetter Exp $"; + static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/Poison.cc,v 1.10 2003/05/13 16:31:47 schnetter Exp $"; CCTK_FILEVERSION(Carpet_Carpet_Poison_cc); } @@ -52,31 +52,41 @@ namespace Carpet { return; } - for (int var=0; var<CCTK_NumVarsInGroupI(group); ++var) { + const int var0 = CCTK_FirstVarIndexI(group); + const int nvar = CCTK_NumVarsInGroupI(group); + const int sz = CCTK_VarTypeSize(CCTK_VarTypeI(var0)); + assert (sz>0); + + const int num_tl = CCTK_NumTimeLevelsFromVarI(var0); + assert (num_tl>0); + const int min_tl = mintl(where, num_tl); + const int max_tl = maxtl(where, num_tl); + + int np = 1; + const int gpdim = CCTK_GroupDimI(group); + for (int d=0; d<gpdim; ++d) { + np *= *CCTK_ArrayGroupSizeI(cgh, d, group); + } + + if (CCTK_GroupTypeI(group) == CCTK_GF) { - const int n = CCTK_FirstVarIndexI(group) + var; - const int sz = CCTK_VarTypeSize(CCTK_VarTypeI(n)); - assert (sz>0); + BEGIN_LOCAL_COMPONENT_LOOP(cgh) { + for (int n=var0; n<var0+nvar; ++n) { + for (int tl=min_tl; tl<=max_tl; ++tl) { + memset (cgh->data[n][tl], poison_value, np*sz); + } // for tl + } // for var + } END_LOCAL_COMPONENT_LOOP(cgh); - const int num_tl = CCTK_NumTimeLevelsFromVarI(n); - assert (num_tl>0); - const int min_tl = mintl(where, num_tl); - const int max_tl = maxtl(where, num_tl); + } else { - for (int tl=min_tl; tl<=max_tl; ++tl) { - - BEGIN_LOCAL_COMPONENT_LOOP(cgh) { - int np = 1; - const int gpdim = arrdata[group].info.dim; - for (int d=0; d<gpdim; ++d) { - np *= *CCTK_ArrayGroupSizeI(cgh, d, group); - } - memset (cgh->data[n][tl], poison_value, np*sz); - } END_LOCAL_COMPONENT_LOOP(cgh); - - } // for tl + for (int n=var0; n<var0+nvar; ++n) { + for (int tl=min_tl; tl<=max_tl; ++tl) { + memset (cgh->data[n][tl], poison_value, np*sz); + } // for tl + } // for var - } // for var + } // group type != gf } |