diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-02-17 16:01:48 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-02-17 16:01:48 +0000 |
commit | 3e0bcab1dbe95fcde20e558116629787f78ac373 (patch) | |
tree | 113197813b629ea20ed0d0039545cd31439ceda1 /src/comm/CactusDefaultComm.c | |
parent | 9c09ece00db7035929540022025087a00faecbea (diff) |
Changes to get timelevels working.
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@302 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/comm/CactusDefaultComm.c')
-rw-r--r-- | src/comm/CactusDefaultComm.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/comm/CactusDefaultComm.c b/src/comm/CactusDefaultComm.c index b532c996..67ffb693 100644 --- a/src/comm/CactusDefaultComm.c +++ b/src/comm/CactusDefaultComm.c @@ -12,6 +12,7 @@ #include <stdlib.h> #include "flesh.h" +#include "Groups.h" #include "CactusMainDefaults.h" #include "GHExtensions.h" @@ -41,6 +42,8 @@ cGH *CactusDefaultSetupGH(tFleshConfig *config, int convergence_level) int n_groups; int n_variables; int variable; + int ntimelevels; + int level; retval = NULL; @@ -75,13 +78,26 @@ cGH *CactusDefaultSetupGH(tFleshConfig *config, int convergence_level) /* Allocate memory for the variable data pointers. * Note we want at least one to prevent memory allocattion from failing ! */ - thisGH->data = (void **)malloc((n_variables ? n_variables:1)*sizeof(void *)); + thisGH->data = (void ***)malloc((n_variables ? n_variables:1)*sizeof(void **)); if(thisGH->data) { for(variable = 0; variable < n_variables; variable++) { - thisGH->data[variable] = NULL; + ntimelevels = CCTK_GetNumTimeLevels(variable); + + thisGH->data[variable] = (void **)malloc(ntimelevels*sizeof(void *)); + if(thisGH->data[variable]) + { + for(level = 0; level < ntimelevels; level++) + { + thisGH->data[variable][level] = NULL; + } + } + else + { + break; + } } } @@ -102,6 +118,7 @@ cGH *CactusDefaultSetupGH(tFleshConfig *config, int convergence_level) thisGH->upper_bound && thisGH->bbox && thisGH->data && + variable == n_variables && thisGH->GroupData) { /* Traverse list of GH setup routines. */ @@ -112,5 +129,3 @@ cGH *CactusDefaultSetupGH(tFleshConfig *config, int convergence_level) return retval; } - - |