diff options
author | schnetter <> | 2003-05-23 21:51:00 +0000 |
---|---|---|
committer | schnetter <> | 2003-05-23 21:51:00 +0000 |
commit | f88a1d5fa370a1b22af2188eb0ec7240908e1be1 (patch) | |
tree | 8750f7362f008f875185b0b4dd1af57c62ba1b45 /Carpet/Carpet/src/Storage.cc | |
parent | 822b8fc72f37db2f739ef9c1e6d1dc0bb6737803 (diff) |
Handle empty groups.
Handle empty groups.
Check for complex variables by testing the CCTK_REAL* macros.
set_component: when a component is not on the local processor, treat
it in the same way as in level mode.
darcs-hash:20030523215117-07bb3-56b046bfd26adfe416a5285b6feed8db8162ae13.gz
Diffstat (limited to 'Carpet/Carpet/src/Storage.cc')
-rw-r--r-- | Carpet/Carpet/src/Storage.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Carpet/Carpet/src/Storage.cc b/Carpet/Carpet/src/Storage.cc index c17842da5..3214ff5fe 100644 --- a/Carpet/Carpet/src/Storage.cc +++ b/Carpet/Carpet/src/Storage.cc @@ -10,7 +10,7 @@ #include "carpet.hh" extern "C" { - static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/Storage.cc,v 1.18 2003/05/21 14:30:25 schnetter Exp $"; + static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/Storage.cc,v 1.19 2003/05/23 23:51:17 schnetter Exp $"; CCTK_FILEVERSION(Carpet_Carpet_Storage_cc); } @@ -39,6 +39,8 @@ namespace Carpet { const int group = CCTK_GroupIndex(groupname); assert (group>=0 && group<CCTK_NumGroups()); + if (CCTK_NumVarsInGroupI(group)==0) return 0; + const int grouptype = CCTK_GroupTypeI(group); // No storage change in local mode @@ -48,11 +50,12 @@ namespace Carpet { // storage was enabled previously return 1; } - + // Check whether this group has transfer operators if (grouptype == CCTK_GF) { if (! arrdata[group].do_transfer) { const int var = CCTK_FirstVarIndexI(group); + assert (var>=0); const int vartype = CCTK_VarTypeI(var); const char * vartypename = CCTK_VarTypeName(vartype); CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, @@ -180,6 +183,8 @@ namespace Carpet { } assert (group>=0 && group<CCTK_NumGroups()); + if (CCTK_NumVarsInGroupI(group)==0) return 0; + const int n = CCTK_FirstVarIndexI(group); assert (n>=0 && n<CCTK_NumVars()); const int var = 0; |